Skip to content

Commit ec45c80

Browse files
committed
Deprecate FlowController.create()
1 parent cfac545 commit ec45c80

File tree

2 files changed

+63
-1
lines changed

2 files changed

+63
-1
lines changed

MIGRATING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- Changes to `PaymentSheet`:
55
* The constructors have been deprecated and will be removed in a future release. Use the `Builder()` or the `rememberPaymentSheet()` method instead.
66
- Changes to `PaymentSheet.FlowController`:
7-
* The constructors have been deprecated and will be removed in a future release. Use the `Builder()` or the `rememberPaymentSheetFlowController()` method instead.
7+
* `FlowController.create()` has been deprecated and will be removed in a future release. Use the `Builder()` or the `rememberPaymentSheetFlowController()` method instead.
88

99
## Migrating from versions < 21.0.0
1010
- Basic Integration has been removed. [Please use Mobile Payment Element instead](https://docs.stripe.com/payments/mobile/migrating-to-mobile-payment-element-from-basic-integration).

paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentSheet.kt

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2488,6 +2488,12 @@ class PaymentSheet internal constructor(
24882488
* [PaymentSheet] is dismissed.
24892489
*/
24902490
@JvmStatic
2491+
@Deprecated(
2492+
message = "This will be removed in a future release.",
2493+
replaceWith = ReplaceWith(
2494+
"FlowController.Builder(paymentResultCallback, paymentOptionCallback).build(activity)"
2495+
)
2496+
)
24912497
fun create(
24922498
activity: ComponentActivity,
24932499
paymentOptionCallback: PaymentOptionCallback,
@@ -2515,6 +2521,14 @@ class PaymentSheet internal constructor(
25152521
* [PaymentSheet] is dismissed.
25162522
*/
25172523
@JvmStatic
2524+
@Deprecated(
2525+
message = "This will be removed in a future release.",
2526+
replaceWith = ReplaceWith(
2527+
"FlowController.Builder(paymentResultCallback, paymentOptionCallback)" +
2528+
".externalPaymentMethodConfirmHandler(externalPaymentMethodConfirmHandler)" +
2529+
".build(activity)"
2530+
)
2531+
)
25182532
fun create(
25192533
activity: ComponentActivity,
25202534
externalPaymentMethodConfirmHandler: ExternalPaymentMethodConfirmHandler,
@@ -2545,6 +2559,14 @@ class PaymentSheet internal constructor(
25452559
* [PaymentSheet] is dismissed.
25462560
*/
25472561
@JvmStatic
2562+
@Deprecated(
2563+
message = "This will be removed in a future release.",
2564+
replaceWith = ReplaceWith(
2565+
"FlowController.Builder(paymentResultCallback, paymentOptionCallback)" +
2566+
".createIntentCallback(createIntentCallback)" +
2567+
".build(activity)"
2568+
)
2569+
)
25482570
fun create(
25492571
activity: ComponentActivity,
25502572
paymentOptionCallback: PaymentOptionCallback,
@@ -2579,6 +2601,15 @@ class PaymentSheet internal constructor(
25792601
* [PaymentSheet] is dismissed.
25802602
*/
25812603
@JvmStatic
2604+
@Deprecated(
2605+
message = "This will be removed in a future release.",
2606+
replaceWith = ReplaceWith(
2607+
"FlowController.Builder(paymentResultCallback, paymentOptionCallback)" +
2608+
".createIntentCallback(createIntentCallback)" +
2609+
".externalPaymentMethodConfirmHandler(externalPaymentMethodConfirmHandler)" +
2610+
".build(activity)"
2611+
)
2612+
)
25822613
fun create(
25832614
activity: ComponentActivity,
25842615
paymentOptionCallback: PaymentOptionCallback,
@@ -2608,6 +2639,12 @@ class PaymentSheet internal constructor(
26082639
* @param paymentResultCallback called when a [PaymentSheetResult] is available.
26092640
*/
26102641
@JvmStatic
2642+
@Deprecated(
2643+
message = "This will be removed in a future release.",
2644+
replaceWith = ReplaceWith(
2645+
"FlowController.Builder(paymentResultCallback, paymentOptionCallback).build(fragment)"
2646+
)
2647+
)
26112648
fun create(
26122649
fragment: Fragment,
26132650
paymentOptionCallback: PaymentOptionCallback,
@@ -2633,6 +2670,14 @@ class PaymentSheet internal constructor(
26332670
* @param paymentResultCallback called when a [PaymentSheetResult] is available.
26342671
*/
26352672
@JvmStatic
2673+
@Deprecated(
2674+
message = "This will be removed in a future release.",
2675+
replaceWith = ReplaceWith(
2676+
"FlowController.Builder(paymentResultCallback, paymentOptionCallback)" +
2677+
".externalPaymentMethodConfirmHandler(externalPaymentMethodConfirmHandler)" +
2678+
".build(fragment)"
2679+
)
2680+
)
26362681
fun create(
26372682
fragment: Fragment,
26382683
externalPaymentMethodConfirmHandler: ExternalPaymentMethodConfirmHandler,
@@ -2663,6 +2708,14 @@ class PaymentSheet internal constructor(
26632708
* [PaymentSheet] is dismissed.
26642709
*/
26652710
@JvmStatic
2711+
@Deprecated(
2712+
message = "This will be removed in a future release.",
2713+
replaceWith = ReplaceWith(
2714+
"FlowController.Builder(paymentResultCallback, paymentOptionCallback)" +
2715+
".createIntentCallback(createIntentCallback)" +
2716+
".build(fragment)"
2717+
)
2718+
)
26662719
fun create(
26672720
fragment: Fragment,
26682721
paymentOptionCallback: PaymentOptionCallback,
@@ -2697,6 +2750,15 @@ class PaymentSheet internal constructor(
26972750
* [PaymentSheet] is dismissed.
26982751
*/
26992752
@JvmStatic
2753+
@Deprecated(
2754+
message = "This will be removed in a future release.",
2755+
replaceWith = ReplaceWith(
2756+
"FlowController.Builder(paymentResultCallback, paymentOptionCallback)" +
2757+
".createIntentCallback(createIntentCallback)" +
2758+
".externalPaymentMethodConfirmHandler(externalPaymentMethodConfirmHandler)" +
2759+
".build(fragment)"
2760+
)
2761+
)
27002762
fun create(
27012763
fragment: Fragment,
27022764
paymentOptionCallback: PaymentOptionCallback,

0 commit comments

Comments
 (0)