From e3cdc505e9da46415778906f6007a754b7d4992e Mon Sep 17 00:00:00 2001 From: Michael Shafrir Date: Mon, 26 Apr 2021 10:06:28 -0400 Subject: [PATCH 1/5] Deprecate ConfirmPaymentIntentParams extraParams parameter `extraParams` were previously used to set `setupFutureUsage`. [0] We now have a `setupFutureUsage` property, so there's no use for this property. Add overloaded "create" methods without an `extraParams` property and mark the variant with the property as deprecated. [0] https://stripe.com/docs/payments/save-during-payment?platform=android#android-submit-payment --- .../model/ConfirmPaymentIntentParams.kt | 202 +++++++++++++++++- .../model/ConfirmPaymentIntentParamsTest.kt | 10 +- 2 files changed, 197 insertions(+), 15 deletions(-) diff --git a/stripe/src/main/java/com/stripe/android/model/ConfirmPaymentIntentParams.kt b/stripe/src/main/java/com/stripe/android/model/ConfirmPaymentIntentParams.kt index e9139fab347..0c1c2429fa3 100644 --- a/stripe/src/main/java/com/stripe/android/model/ConfirmPaymentIntentParams.kt +++ b/stripe/src/main/java/com/stripe/android/model/ConfirmPaymentIntentParams.kt @@ -28,6 +28,7 @@ data class ConfirmPaymentIntentParams internal constructor( val sourceParams: SourceParams? = null, val sourceId: String? = null, + @Deprecated("Will be removed in an upcoming major version.") val extraParams: Map? = null, /** @@ -326,7 +327,27 @@ data class ConfirmPaymentIntentParams internal constructor( fun create( clientSecret: String, returnUrl: String? = null, - extraParams: Map? = null, + shipping: Shipping? = null + ): ConfirmPaymentIntentParams { + return ConfirmPaymentIntentParams( + clientSecret = clientSecret, + returnUrl = returnUrl, + shipping = shipping + ) + } + + /** + * Create a [ConfirmPaymentIntentParams] without a payment method. + */ + @JvmOverloads + @JvmStatic + @Deprecated( + "The [extraParams] property is deprecated and will be removed in an upcoming major version. Use the [setupFutureUsage] to specify a value for setup_future_usage." + ) + fun create( + clientSecret: String, + returnUrl: String? = null, + extraParams: Map?, shipping: Shipping? = null ): ConfirmPaymentIntentParams { return ConfirmPaymentIntentParams( @@ -365,7 +386,57 @@ data class ConfirmPaymentIntentParams internal constructor( clientSecret: String, returnUrl: String? = null, savePaymentMethod: Boolean? = null, - extraParams: Map? = null, + paymentMethodOptions: PaymentMethodOptionsParams? = null, + mandateId: String? = null, + mandateData: MandateDataParams? = null, + setupFutureUsage: SetupFutureUsage? = null, + shipping: Shipping? = null + ): ConfirmPaymentIntentParams { + return ConfirmPaymentIntentParams( + clientSecret = clientSecret, + paymentMethodId = paymentMethodId, + returnUrl = returnUrl, + savePaymentMethod = savePaymentMethod, + paymentMethodOptions = paymentMethodOptions, + mandateId = mandateId, + mandateData = mandateData, + setupFutureUsage = setupFutureUsage, + shipping = shipping + ) + } + + /** + * Create the parameters necessary for confirming a PaymentIntent while attaching a + * PaymentMethod that already exits. + * + * @param paymentMethodId the ID of the PaymentMethod that is being attached to the + * PaymentIntent being confirmed + * @param clientSecret client secret from the PaymentIntent being confirmed + * @param returnUrl the URL the customer should be redirected to after the authorization + * process + * @param savePaymentMethod Set to `true` to save this PaymentIntent’s payment method to + * the associated Customer, if the payment method is not already + * attached. This parameter only applies to the payment method passed + * in the same request or the current payment method attached to the + * PaymentIntent and must be specified again if a new payment method is + * added. + * @param paymentMethodOptions Optional [PaymentMethodOptionsParams] + * @param mandateId Optional ID of the Mandate to be used for this payment. + * @param mandateData Optional details about the Mandate to create. + * @param setupFutureUsage Optional. See [SetupFutureUsage]. + * @param shipping Optional. See [Shipping]. + */ + @JvmOverloads + @JvmStatic + @Deprecated( + "The [extraParams] property is deprecated and will be removed in an upcoming major version. Use the [setupFutureUsage] to specify a value for setup_future_usage." + ) + fun createWithPaymentMethodId( + paymentMethodId: String, + clientSecret: String, + returnUrl: String? = null, + savePaymentMethod: Boolean? = null, + extraParams: Map?, paymentMethodOptions: PaymentMethodOptionsParams? = null, mandateId: String? = null, mandateData: MandateDataParams? = null, @@ -413,7 +484,54 @@ data class ConfirmPaymentIntentParams internal constructor( clientSecret: String, returnUrl: String? = null, savePaymentMethod: Boolean? = null, - extraParams: Map? = null, + mandateId: String? = null, + mandateData: MandateDataParams? = null, + setupFutureUsage: SetupFutureUsage? = null, + shipping: Shipping? = null + ): ConfirmPaymentIntentParams { + return ConfirmPaymentIntentParams( + clientSecret = clientSecret, + paymentMethodCreateParams = paymentMethodCreateParams, + returnUrl = returnUrl, + savePaymentMethod = savePaymentMethod, + mandateId = mandateId, + mandateData = mandateData, + setupFutureUsage = setupFutureUsage, + shipping = shipping + ) + } + + /** + * Create the parameters necessary for confirming a PaymentIntent while attaching + * [PaymentMethodCreateParams] data + * + * @param paymentMethodCreateParams params for the PaymentMethod that will be attached to this + * PaymentIntent + * @param clientSecret client secret from the PaymentIntent that is to be confirmed + * @param returnUrl the URL the customer should be redirected to after the authorization + * process + * @param savePaymentMethod Set to `true` to save this PaymentIntent’s payment method to + * the associated Customer, if the payment method is not already + * attached. This parameter only applies to the payment method passed + * in the same request or the current payment method attached to the + * PaymentIntent and must be specified again if a new payment method is + * added. + * @param mandateId optional ID of the Mandate to be used for this payment. + * @param mandateData optional details about the Mandate to create. + * @param setupFutureUsage Optional. See [SetupFutureUsage]. + * @param shipping Optional. See [Shipping]. + */ + @JvmOverloads + @JvmStatic + @Deprecated( + "The [extraParams] property is deprecated and will be removed in an upcoming major version. Use the [setupFutureUsage] to specify a value for setup_future_usage." + ) + fun createWithPaymentMethodCreateParams( + paymentMethodCreateParams: PaymentMethodCreateParams, + clientSecret: String, + returnUrl: String? = null, + savePaymentMethod: Boolean? = null, + extraParams: Map?, mandateId: String? = null, mandateData: MandateDataParams? = null, setupFutureUsage: SetupFutureUsage? = null, @@ -455,7 +573,44 @@ data class ConfirmPaymentIntentParams internal constructor( clientSecret: String, returnUrl: String, savePaymentMethod: Boolean? = null, - extraParams: Map? = null, + shipping: Shipping? = null + ): ConfirmPaymentIntentParams { + return ConfirmPaymentIntentParams( + clientSecret = clientSecret, + sourceId = sourceId, + returnUrl = returnUrl, + savePaymentMethod = savePaymentMethod, + shipping = shipping + ) + } + + /** + * Create the parameters necessary for confirming a PaymentIntent with an + * existing [Source]. + * + * @param sourceId the ID of the source that is being attached to the PaymentIntent being + * confirmed + * @param clientSecret client secret from the PaymentIntent being confirmed + * @param returnUrl the URL the customer should be redirected to after the authorization + * process + * @param savePaymentMethod Set to `true` to save this PaymentIntent’s source to the + * associated Customer, if the source is not already attached. + * This parameter only applies to the source passed in the same request + * or the current source attached to the PaymentIntent and must be + * specified again if a new source is added. + * @param shipping Optional. See [Shipping]. + */ + @JvmOverloads + @JvmStatic + @Deprecated( + "The [extraParams] property is deprecated and will be removed in an upcoming major version. Use the [setupFutureUsage] to specify a value for setup_future_usage." + ) + fun createWithSourceId( + sourceId: String, + clientSecret: String, + returnUrl: String, + savePaymentMethod: Boolean? = null, + extraParams: Map?, shipping: Shipping? = null ): ConfirmPaymentIntentParams { return ConfirmPaymentIntentParams( @@ -489,7 +644,6 @@ data class ConfirmPaymentIntentParams internal constructor( clientSecret: String, returnUrl: String, savePaymentMethod: Boolean? = null, - extraParams: Map? = null, shipping: Shipping? = null ): ConfirmPaymentIntentParams { return ConfirmPaymentIntentParams( @@ -497,17 +651,51 @@ data class ConfirmPaymentIntentParams internal constructor( sourceParams = sourceParams, returnUrl = returnUrl, savePaymentMethod = savePaymentMethod, - extraParams = extraParams, shipping = shipping ) } /** - * Create the parameters necessary for confirming a [PaymentIntent] with Alipay + * Create the parameters necessary for confirming a PaymentIntent with [SourceParams] * + * @param sourceParams params for the source that will be attached to this PaymentIntent * @param clientSecret client secret from the PaymentIntent that is to be confirmed * @param returnUrl the URL the customer should be redirected to after the authorization * process + * @param savePaymentMethod Set to `true` to save this PaymentIntent’s source to the + * associated Customer, if the source is not already attached. + * This parameter only applies to the source passed in the same request + * or the current source attached to the PaymentIntent and must be + * specified again if a new source is added. + * @param shipping Optional. See [Shipping]. + */ + @JvmOverloads + @JvmStatic + @Deprecated( + "The [extraParams] property is deprecated and will be removed in an upcoming major version. Use the [setupFutureUsage] to specify a value for setup_future_usage." + ) + fun createWithSourceParams( + sourceParams: SourceParams, + clientSecret: String, + returnUrl: String, + savePaymentMethod: Boolean? = null, + extraParams: Map?, + shipping: Shipping? = null + ): ConfirmPaymentIntentParams { + return ConfirmPaymentIntentParams( + clientSecret = clientSecret, + sourceParams = sourceParams, + returnUrl = returnUrl, + savePaymentMethod = savePaymentMethod, + extraParams = extraParams, + shipping = shipping + ) + } + + /** + * Create the parameters necessary for confirming a [PaymentIntent] with Alipay + * + * @param clientSecret client secret from the PaymentIntent that is to be confirmed */ @JvmStatic fun createAlipay( diff --git a/stripe/src/test/java/com/stripe/android/model/ConfirmPaymentIntentParamsTest.kt b/stripe/src/test/java/com/stripe/android/model/ConfirmPaymentIntentParamsTest.kt index 945503503f8..143a99d3fbd 100644 --- a/stripe/src/test/java/com/stripe/android/model/ConfirmPaymentIntentParamsTest.kt +++ b/stripe/src/test/java/com/stripe/android/model/ConfirmPaymentIntentParamsTest.kt @@ -143,11 +143,7 @@ class ConfirmPaymentIntentParamsTest { val params = ConfirmPaymentIntentParams .createWithPaymentMethodId( "pm_123", - CLIENT_SECRET, - extraParams = mapOf( - "animal" to "dog", - "color" to "brown" - ) + CLIENT_SECRET ) .toParamMap() @@ -156,9 +152,7 @@ class ConfirmPaymentIntentParamsTest { mapOf( "client_secret" to CLIENT_SECRET, "use_stripe_sdk" to false, - "payment_method" to "pm_123", - "animal" to "dog", - "color" to "brown" + "payment_method" to "pm_123" ) ) } From 2304bd87846078aa033ab5af859c5f1e0a18df38 Mon Sep 17 00:00:00 2001 From: Michael Shafrir Date: Mon, 26 Apr 2021 11:49:11 -0400 Subject: [PATCH 2/5] Update api --- stripe/api/stripe.api | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/stripe/api/stripe.api b/stripe/api/stripe.api index da01fdde4a1..11e6483dc43 100644 --- a/stripe/api/stripe.api +++ b/stripe/api/stripe.api @@ -1769,34 +1769,53 @@ public final class com/stripe/android/model/ConfirmPaymentIntentParams : com/str public static synthetic fun copy$default (Lcom/stripe/android/model/ConfirmPaymentIntentParams;Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Lcom/stripe/android/model/SourceParams;Ljava/lang/String;Ljava/util/Map;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;ZLcom/stripe/android/model/PaymentMethodOptionsParams;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;Ljava/lang/String;ILjava/lang/Object;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun create (Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun create (Ljava/lang/String;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static final fun create (Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun create (Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun create (Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static final fun create (Ljava/lang/String;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createAlipay (Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Lcom/stripe/android/model/PaymentMethodOptionsParams;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Lcom/stripe/android/model/PaymentMethodOptionsParams;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Lcom/stripe/android/model/PaymentMethodOptionsParams;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Lcom/stripe/android/model/PaymentMethodOptionsParams;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Lcom/stripe/android/model/PaymentMethodOptionsParams;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Lcom/stripe/android/model/PaymentMethodOptionsParams;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Lcom/stripe/android/model/PaymentMethodOptionsParams;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Lcom/stripe/android/model/PaymentMethodOptionsParams;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Lcom/stripe/android/model/PaymentMethodOptionsParams;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Lcom/stripe/android/model/PaymentMethodOptionsParams;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithSourceId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithSourceId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static final fun createWithSourceId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithSourceId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithSourceId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static final fun createWithSourceId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithSourceParams (Lcom/stripe/android/model/SourceParams;Ljava/lang/String;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithSourceParams (Lcom/stripe/android/model/SourceParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static final fun createWithSourceParams (Lcom/stripe/android/model/SourceParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithSourceParams (Lcom/stripe/android/model/SourceParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun createWithSourceParams (Lcom/stripe/android/model/SourceParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static final fun createWithSourceParams (Lcom/stripe/android/model/SourceParams;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public fun equals (Ljava/lang/Object;)Z public fun getClientSecret ()Ljava/lang/String; public final fun getExtraParams ()Ljava/util/Map; @@ -1832,38 +1851,62 @@ public final class com/stripe/android/model/ConfirmPaymentIntentParams : com/str public final class com/stripe/android/model/ConfirmPaymentIntentParams$Companion { public final fun create (Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun create (Ljava/lang/String;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public final fun create (Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun create (Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun create (Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public final fun create (Ljava/lang/String;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static synthetic fun create$default (Lcom/stripe/android/model/ConfirmPaymentIntentParams$Companion;Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;ILjava/lang/Object;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static synthetic fun create$default (Lcom/stripe/android/model/ConfirmPaymentIntentParams$Companion;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;ILjava/lang/Object;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createAlipay (Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static synthetic fun createWithPaymentMethodCreateParams$default (Lcom/stripe/android/model/ConfirmPaymentIntentParams$Companion;Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;ILjava/lang/Object;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static synthetic fun createWithPaymentMethodCreateParams$default (Lcom/stripe/android/model/ConfirmPaymentIntentParams$Companion;Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;ILjava/lang/Object;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Lcom/stripe/android/model/PaymentMethodOptionsParams;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Lcom/stripe/android/model/PaymentMethodOptionsParams;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Lcom/stripe/android/model/PaymentMethodOptionsParams;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Lcom/stripe/android/model/PaymentMethodOptionsParams;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Lcom/stripe/android/model/PaymentMethodOptionsParams;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Lcom/stripe/android/model/PaymentMethodOptionsParams;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Lcom/stripe/android/model/PaymentMethodOptionsParams;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Lcom/stripe/android/model/PaymentMethodOptionsParams;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Lcom/stripe/android/model/PaymentMethodOptionsParams;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Lcom/stripe/android/model/PaymentMethodOptionsParams;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public final fun createWithPaymentMethodId (Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static synthetic fun createWithPaymentMethodId$default (Lcom/stripe/android/model/ConfirmPaymentIntentParams$Companion;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Lcom/stripe/android/model/PaymentMethodOptionsParams;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;ILjava/lang/Object;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static synthetic fun createWithPaymentMethodId$default (Lcom/stripe/android/model/ConfirmPaymentIntentParams$Companion;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Lcom/stripe/android/model/PaymentMethodOptionsParams;Ljava/lang/String;Lcom/stripe/android/model/MandateDataParams;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;ILjava/lang/Object;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithSourceId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithSourceId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public final fun createWithSourceId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithSourceId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithSourceId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public final fun createWithSourceId (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static synthetic fun createWithSourceId$default (Lcom/stripe/android/model/ConfirmPaymentIntentParams$Companion;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;ILjava/lang/Object;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static synthetic fun createWithSourceId$default (Lcom/stripe/android/model/ConfirmPaymentIntentParams$Companion;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;ILjava/lang/Object;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithSourceParams (Lcom/stripe/android/model/SourceParams;Ljava/lang/String;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithSourceParams (Lcom/stripe/android/model/SourceParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public final fun createWithSourceParams (Lcom/stripe/android/model/SourceParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithSourceParams (Lcom/stripe/android/model/SourceParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithSourceParams (Lcom/stripe/android/model/SourceParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public final fun createWithSourceParams (Lcom/stripe/android/model/SourceParams;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static synthetic fun createWithSourceParams$default (Lcom/stripe/android/model/ConfirmPaymentIntentParams$Companion;Lcom/stripe/android/model/SourceParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;ILjava/lang/Object;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static synthetic fun createWithSourceParams$default (Lcom/stripe/android/model/ConfirmPaymentIntentParams$Companion;Lcom/stripe/android/model/SourceParams;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;Ljava/util/Map;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;ILjava/lang/Object;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; } From 172b0f52db26f9c5f9fea578c770ca4a4aa6af0f Mon Sep 17 00:00:00 2001 From: Michael Shafrir Date: Tue, 27 Apr 2021 21:58:47 -0400 Subject: [PATCH 3/5] Update --- .../android/model/ConfirmPaymentIntentParams.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/stripe/src/main/java/com/stripe/android/model/ConfirmPaymentIntentParams.kt b/stripe/src/main/java/com/stripe/android/model/ConfirmPaymentIntentParams.kt index 0c1c2429fa3..9c32354074d 100644 --- a/stripe/src/main/java/com/stripe/android/model/ConfirmPaymentIntentParams.kt +++ b/stripe/src/main/java/com/stripe/android/model/ConfirmPaymentIntentParams.kt @@ -327,11 +327,13 @@ data class ConfirmPaymentIntentParams internal constructor( fun create( clientSecret: String, returnUrl: String? = null, - shipping: Shipping? = null + shipping: Shipping? = null, + setupFutureUsage: SetupFutureUsage? = null ): ConfirmPaymentIntentParams { return ConfirmPaymentIntentParams( clientSecret = clientSecret, returnUrl = returnUrl, + setupFutureUsage = setupFutureUsage, shipping = shipping ) } @@ -342,7 +344,7 @@ data class ConfirmPaymentIntentParams internal constructor( @JvmOverloads @JvmStatic @Deprecated( - "The [extraParams] property is deprecated and will be removed in an upcoming major version. Use the [setupFutureUsage] to specify a value for setup_future_usage." + "The [extraParams] property is deprecated and will be removed in an upcoming major version. Use the [setupFutureUsage] paramter to specify a value for setup_future_usage." ) fun create( clientSecret: String, @@ -429,7 +431,7 @@ data class ConfirmPaymentIntentParams internal constructor( @JvmOverloads @JvmStatic @Deprecated( - "The [extraParams] property is deprecated and will be removed in an upcoming major version. Use the [setupFutureUsage] to specify a value for setup_future_usage." + "The [extraParams] property is deprecated and will be removed in an upcoming major version. Use the [setupFutureUsage] parameter to specify a value for setup_future_usage." ) fun createWithPaymentMethodId( paymentMethodId: String, @@ -524,7 +526,7 @@ data class ConfirmPaymentIntentParams internal constructor( @JvmOverloads @JvmStatic @Deprecated( - "The [extraParams] property is deprecated and will be removed in an upcoming major version. Use the [setupFutureUsage] to specify a value for setup_future_usage." + "The [extraParams] property is deprecated and will be removed in an upcoming major version. Use the [setupFutureUsage] parameter to specify a value for setup_future_usage." ) fun createWithPaymentMethodCreateParams( paymentMethodCreateParams: PaymentMethodCreateParams, @@ -603,7 +605,7 @@ data class ConfirmPaymentIntentParams internal constructor( @JvmOverloads @JvmStatic @Deprecated( - "The [extraParams] property is deprecated and will be removed in an upcoming major version. Use the [setupFutureUsage] to specify a value for setup_future_usage." + "The [extraParams] property is deprecated and will be removed in an upcoming major version. Use the [setupFutureUsage] parameter to specify a value for setup_future_usage." ) fun createWithSourceId( sourceId: String, @@ -672,7 +674,7 @@ data class ConfirmPaymentIntentParams internal constructor( @JvmOverloads @JvmStatic @Deprecated( - "The [extraParams] property is deprecated and will be removed in an upcoming major version. Use the [setupFutureUsage] to specify a value for setup_future_usage." + "The [extraParams] property is deprecated and will be removed in an upcoming major version. Use the [setupFutureUsage] parameter to specify a value for setup_future_usage." ) fun createWithSourceParams( sourceParams: SourceParams, From e060660cecf230200382a466a3c55bfdaa8b5ab9 Mon Sep 17 00:00:00 2001 From: Michael Shafrir Date: Wed, 28 Apr 2021 06:51:54 -0400 Subject: [PATCH 4/5] Update api --- stripe/api/stripe.api | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stripe/api/stripe.api b/stripe/api/stripe.api index 11e6483dc43..61793b246ba 100644 --- a/stripe/api/stripe.api +++ b/stripe/api/stripe.api @@ -1770,6 +1770,7 @@ public final class com/stripe/android/model/ConfirmPaymentIntentParams : com/str public static final fun create (Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun create (Ljava/lang/String;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun create (Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static final fun create (Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun create (Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun create (Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static final fun create (Ljava/lang/String;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; @@ -1852,10 +1853,11 @@ public final class com/stripe/android/model/ConfirmPaymentIntentParams$Companion public final fun create (Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun create (Ljava/lang/String;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun create (Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public final fun create (Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun create (Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun create (Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun create (Ljava/lang/String;Ljava/util/Map;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; - public static synthetic fun create$default (Lcom/stripe/android/model/ConfirmPaymentIntentParams$Companion;Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;ILjava/lang/Object;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; + public static synthetic fun create$default (Lcom/stripe/android/model/ConfirmPaymentIntentParams$Companion;Ljava/lang/String;Ljava/lang/String;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;Lcom/stripe/android/model/ConfirmPaymentIntentParams$SetupFutureUsage;ILjava/lang/Object;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public static synthetic fun create$default (Lcom/stripe/android/model/ConfirmPaymentIntentParams$Companion;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;Lcom/stripe/android/model/ConfirmPaymentIntentParams$Shipping;ILjava/lang/Object;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createAlipay (Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; public final fun createWithPaymentMethodCreateParams (Lcom/stripe/android/model/PaymentMethodCreateParams;Ljava/lang/String;)Lcom/stripe/android/model/ConfirmPaymentIntentParams; From ce64dc5e482a929ab10e2a4cf7306a5b1c1c02e9 Mon Sep 17 00:00:00 2001 From: Michael Shafrir Date: Wed, 28 Apr 2021 15:45:49 -0400 Subject: [PATCH 5/5] Respond to comments --- .../model/ConfirmPaymentIntentParams.kt | 20 ++++++++++++++----- .../model/ConfirmPaymentIntentParamsTest.kt | 6 ++++-- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/stripe/src/main/java/com/stripe/android/model/ConfirmPaymentIntentParams.kt b/stripe/src/main/java/com/stripe/android/model/ConfirmPaymentIntentParams.kt index 9c32354074d..2b5898e67ca 100644 --- a/stripe/src/main/java/com/stripe/android/model/ConfirmPaymentIntentParams.kt +++ b/stripe/src/main/java/com/stripe/android/model/ConfirmPaymentIntentParams.kt @@ -344,7 +344,9 @@ data class ConfirmPaymentIntentParams internal constructor( @JvmOverloads @JvmStatic @Deprecated( - "The [extraParams] property is deprecated and will be removed in an upcoming major version. Use the [setupFutureUsage] paramter to specify a value for setup_future_usage." + "The [extraParams] property is deprecated and will be removed in an " + + "upcoming major version. Use the [setupFutureUsage] parameter to specify a " + + "value for setup_future_usage." ) fun create( clientSecret: String, @@ -431,7 +433,9 @@ data class ConfirmPaymentIntentParams internal constructor( @JvmOverloads @JvmStatic @Deprecated( - "The [extraParams] property is deprecated and will be removed in an upcoming major version. Use the [setupFutureUsage] parameter to specify a value for setup_future_usage." + "The [extraParams] property is deprecated and will be removed in an " + + "upcoming major version. Use the [setupFutureUsage] parameter to specify a " + + "value for setup_future_usage." ) fun createWithPaymentMethodId( paymentMethodId: String, @@ -526,7 +530,9 @@ data class ConfirmPaymentIntentParams internal constructor( @JvmOverloads @JvmStatic @Deprecated( - "The [extraParams] property is deprecated and will be removed in an upcoming major version. Use the [setupFutureUsage] parameter to specify a value for setup_future_usage." + "The [extraParams] property is deprecated and will be removed in an " + + "upcoming major version. Use the [setupFutureUsage] parameter to specify a " + + "value for setup_future_usage." ) fun createWithPaymentMethodCreateParams( paymentMethodCreateParams: PaymentMethodCreateParams, @@ -605,7 +611,9 @@ data class ConfirmPaymentIntentParams internal constructor( @JvmOverloads @JvmStatic @Deprecated( - "The [extraParams] property is deprecated and will be removed in an upcoming major version. Use the [setupFutureUsage] parameter to specify a value for setup_future_usage." + "The [extraParams] property is deprecated and will be removed in an " + + "upcoming major version. Use the [setupFutureUsage] parameter to specify a " + + "value for setup_future_usage." ) fun createWithSourceId( sourceId: String, @@ -674,7 +682,9 @@ data class ConfirmPaymentIntentParams internal constructor( @JvmOverloads @JvmStatic @Deprecated( - "The [extraParams] property is deprecated and will be removed in an upcoming major version. Use the [setupFutureUsage] parameter to specify a value for setup_future_usage." + "The [extraParams] property is deprecated and will be removed in an " + + "upcoming major version. Use the [setupFutureUsage] parameter to specify a " + + "value for setup_future_usage." ) fun createWithSourceParams( sourceParams: SourceParams, diff --git a/stripe/src/test/java/com/stripe/android/model/ConfirmPaymentIntentParamsTest.kt b/stripe/src/test/java/com/stripe/android/model/ConfirmPaymentIntentParamsTest.kt index 143a99d3fbd..611b76d34fc 100644 --- a/stripe/src/test/java/com/stripe/android/model/ConfirmPaymentIntentParamsTest.kt +++ b/stripe/src/test/java/com/stripe/android/model/ConfirmPaymentIntentParamsTest.kt @@ -143,7 +143,8 @@ class ConfirmPaymentIntentParamsTest { val params = ConfirmPaymentIntentParams .createWithPaymentMethodId( "pm_123", - CLIENT_SECRET + CLIENT_SECRET, + setupFutureUsage = ConfirmPaymentIntentParams.SetupFutureUsage.OnSession ) .toParamMap() @@ -152,7 +153,8 @@ class ConfirmPaymentIntentParamsTest { mapOf( "client_secret" to CLIENT_SECRET, "use_stripe_sdk" to false, - "payment_method" to "pm_123" + "payment_method" to "pm_123", + "setup_future_usage" to "on_session" ) ) }