From 5068fd7742a84cc1ad27aea04954fa6e72b1a4fc Mon Sep 17 00:00:00 2001 From: Till Hellmund Date: Tue, 4 Jul 2023 10:37:35 -0400 Subject: [PATCH 1/8] Remove `ExperimentalPaymentSheetDecouplingApi` annotation --- paymentsheet-example/detekt-baseline.xml | 4 ++-- .../activity/PaymentSheetPlaygroundActivity.kt | 4 ---- .../viewmodel/PaymentSheetPlaygroundViewModel.kt | 5 +---- .../paymentsheet/example/samples/model/CartState.kt | 2 -- .../ServerSideConfirmationCompleteFlowActivity.kt | 2 -- .../ServerSideConfirmationCompleteFlowViewModel.kt | 2 -- .../ServerSideConfirmationCustomFlowActivity.kt | 3 --- .../ServerSideConfirmationCustomFlowViewModel.kt | 2 -- paymentsheet/detekt-baseline.xml | 2 +- .../android/paymentsheet/CreateIntentCallback.kt | 4 ---- .../android/paymentsheet/DeferredIntentValidator.kt | 1 - .../ExperimentalPaymentSheetDecouplingApi.kt | 4 ++++ .../android/paymentsheet/FlowControllerCompose.kt | 2 -- .../paymentsheet/IntentConfirmationInterceptor.kt | 1 - .../com/stripe/android/paymentsheet/PaymentSheet.kt | 13 ------------- .../android/paymentsheet/PaymentSheetCompose.kt | 2 -- .../android/paymentsheet/PaymentSheetViewModel.kt | 2 -- .../flowcontroller/DefaultFlowController.kt | 2 -- .../paymentdatacollection/ach/USBankAccountForm.kt | 2 -- .../repositories/ElementsSessionRepository.kt | 5 ----- .../DefaultIntentConfirmationInterceptorTest.kt | 1 - .../paymentsheet/DefaultPaymentSheetLauncherTest.kt | 1 - .../paymentsheet/DeferredIntentValidatorTest.kt | 1 - .../paymentsheet/PaymentSheetViewModelTest.kt | 5 +---- .../flowcontroller/DefaultFlowControllerTest.kt | 4 +--- .../FlowControllerConfigurationHandlerTest.kt | 4 ---- .../repositories/ElementsSessionRepositoryTest.kt | 2 -- 27 files changed, 10 insertions(+), 72 deletions(-) diff --git a/paymentsheet-example/detekt-baseline.xml b/paymentsheet-example/detekt-baseline.xml index 34adf3298ed..72af279d0ab 100644 --- a/paymentsheet-example/detekt-baseline.xml +++ b/paymentsheet-example/detekt-baseline.xml @@ -15,7 +15,7 @@ LargeClass:PaymentSheetPlaygroundActivity.kt$PaymentSheetPlaygroundActivity : AppCompatActivity LongMethod:AppearanceBottomSheetDialogFragment.kt$@Composable private fun Colors( currentAppearance: PaymentSheet.Appearance, updateAppearance: (PaymentSheet.Appearance) -> Unit, ) LongMethod:AppearanceBottomSheetDialogFragment.kt$@Composable private fun PrimaryButton( currentAppearance: PaymentSheet.Appearance, updateAppearance: (PaymentSheet.Appearance) -> Unit, ) - LongMethod:PaymentSheetPlaygroundActivity.kt$PaymentSheetPlaygroundActivity$@OptIn(ExperimentalPaymentSheetDecouplingApi::class) override fun onCreate(savedInstanceState: Bundle?) + LongMethod:PaymentSheetPlaygroundActivity.kt$PaymentSheetPlaygroundActivity$override fun onCreate(savedInstanceState: Bundle?) LongMethod:PaymentSheetPlaygroundActivity.kt$PaymentSheetPlaygroundActivity$private fun setToggles( initialization: String?, customer: String?, link: Boolean, googlePay: Boolean, currency: String?, merchantCountryCode: String, mode: String?, shippingAddress: String, setDefaultBillingAddress: Boolean, setAutomaticPaymentMethods: Boolean, setDelayedPaymentMethods: Boolean, attachDefaultBillingAddress: Boolean, collectName: String, collectEmail: String, collectPhone: String, collectAddress: String, ) LongMethod:PaymentSheetPlaygroundActivity.kt$PaymentSheetPlaygroundActivity$private fun startShippingAddressCollection() LongMethod:PaymentSheetPlaygroundViewModel.kt$PaymentSheetPlaygroundViewModel$suspend fun getSavedToggleState(): SavedToggles @@ -26,7 +26,7 @@ MagicNumber:DrawablePainter.kt$DrawablePainter$255 MagicNumber:Payment.kt$0.5f MaxLineLength:PaymentSheetPlaygroundActivity.kt$PaymentSheetPlaygroundActivity$get() = viewBinding.allowsDelayedPaymentMethodsRadioGroup.checkedRadioButtonId == R.id.allowsDelayedPaymentMethods_on_button - MaximumLineLength:com.stripe.android.paymentsheet.example.playground.activity.PaymentSheetPlaygroundActivity.kt:147 + MaximumLineLength:com.stripe.android.paymentsheet.example.playground.activity.PaymentSheetPlaygroundActivity.kt:146 PackageNaming:CompleteFlowActivity.kt$package com.stripe.android.paymentsheet.example.samples.ui.paymentsheet.complete_flow PackageNaming:CompleteFlowViewModel.kt$package com.stripe.android.paymentsheet.example.samples.ui.paymentsheet.complete_flow PackageNaming:CompleteFlowViewState.kt$package com.stripe.android.paymentsheet.example.samples.ui.paymentsheet.complete_flow diff --git a/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/playground/activity/PaymentSheetPlaygroundActivity.kt b/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/playground/activity/PaymentSheetPlaygroundActivity.kt index 3b62d98dd63..3be5866fb2e 100644 --- a/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/playground/activity/PaymentSheetPlaygroundActivity.kt +++ b/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/playground/activity/PaymentSheetPlaygroundActivity.kt @@ -23,7 +23,6 @@ import com.google.android.material.snackbar.Snackbar import com.stripe.android.PaymentConfiguration import com.stripe.android.core.model.CountryCode import com.stripe.android.core.model.CountryUtils -import com.stripe.android.paymentsheet.ExperimentalPaymentSheetDecouplingApi import com.stripe.android.paymentsheet.PaymentSheet import com.stripe.android.paymentsheet.PaymentSheetResult import com.stripe.android.paymentsheet.addresselement.AddressDetails @@ -186,7 +185,6 @@ class PaymentSheetPlaygroundActivity : AppCompatActivity() { private lateinit var addressLauncher: AddressLauncher private var shippingAddress: AddressDetails? = null - @OptIn(ExperimentalPaymentSheetDecouplingApi::class) override fun onCreate(savedInstanceState: Bundle?) { val shouldUseDarkMode = intent.extras?.get(FORCE_DARK_MODE_EXTRA) as Boolean? if (shouldUseDarkMode != null) { @@ -571,7 +569,6 @@ class PaymentSheetPlaygroundActivity : AppCompatActivity() { viewBinding.paymentMethod.isClickable = false } - @OptIn(ExperimentalPaymentSheetDecouplingApi::class) private fun startCompleteCheckout() { if (viewModel.initializationType.value == InitializationType.Normal) { val clientSecret = viewModel.clientSecret.value ?: return @@ -690,7 +687,6 @@ class PaymentSheetPlaygroundActivity : AppCompatActivity() { ) } - @OptIn(ExperimentalPaymentSheetDecouplingApi::class) private fun configureCustomCheckout() { if (viewModel.initializationType.value == InitializationType.Normal) { val clientSecret = viewModel.clientSecret.value ?: return diff --git a/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/playground/viewmodel/PaymentSheetPlaygroundViewModel.kt b/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/playground/viewmodel/PaymentSheetPlaygroundViewModel.kt index c4c10cff9a1..cb65ef43c35 100644 --- a/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/playground/viewmodel/PaymentSheetPlaygroundViewModel.kt +++ b/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/playground/viewmodel/PaymentSheetPlaygroundViewModel.kt @@ -13,7 +13,6 @@ import com.stripe.android.PaymentConfiguration import com.stripe.android.core.model.CountryCode import com.stripe.android.paymentsheet.CreateIntentResult import com.stripe.android.paymentsheet.DelicatePaymentSheetApi -import com.stripe.android.paymentsheet.ExperimentalPaymentSheetDecouplingApi import com.stripe.android.paymentsheet.PaymentSheet import com.stripe.android.paymentsheet.example.playground.model.CheckoutCurrency import com.stripe.android.paymentsheet.example.playground.model.CheckoutCustomer @@ -268,14 +267,13 @@ class PaymentSheetPlaygroundViewModel( } } - @OptIn(ExperimentalPaymentSheetDecouplingApi::class) private fun createIntent(): CreateIntentResult { // Note: This is not how you'd do this in a real application. Instead, your app would // call your backend and create (and optionally confirm) a payment or setup intent. return CreateIntentResult.Success(clientSecret = clientSecret.value!!) } - @OptIn(ExperimentalPaymentSheetDecouplingApi::class, DelicatePaymentSheetApi::class) + @OptIn(DelicatePaymentSheetApi::class) suspend fun createAndConfirmIntent( paymentMethodId: String, shouldSavePaymentMethod: Boolean, @@ -308,7 +306,6 @@ class PaymentSheetPlaygroundViewModel( } } - @OptIn(ExperimentalPaymentSheetDecouplingApi::class) private suspend fun createAndConfirmIntentInternal( paymentMethodId: String, shouldSavePaymentMethod: Boolean, diff --git a/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/model/CartState.kt b/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/model/CartState.kt index 41934ae6a2e..b8e3622996d 100644 --- a/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/model/CartState.kt +++ b/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/model/CartState.kt @@ -1,6 +1,5 @@ package com.stripe.android.paymentsheet.example.samples.model -import com.stripe.android.paymentsheet.ExperimentalPaymentSheetDecouplingApi import com.stripe.android.paymentsheet.PaymentSheet import com.stripe.android.paymentsheet.example.samples.networking.ExampleCheckoutResponse import com.stripe.android.paymentsheet.example.samples.networking.ExampleUpdateResponse @@ -74,7 +73,6 @@ internal fun CartState.updateWithResponse( ) } -@OptIn(ExperimentalPaymentSheetDecouplingApi::class) internal fun CartState.toIntentConfiguration(): PaymentSheet.IntentConfiguration { return PaymentSheet.IntentConfiguration( mode = PaymentSheet.IntentConfiguration.Mode.Payment( diff --git a/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/ui/paymentsheet/server_side_confirm/complete_flow/ServerSideConfirmationCompleteFlowActivity.kt b/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/ui/paymentsheet/server_side_confirm/complete_flow/ServerSideConfirmationCompleteFlowActivity.kt index 792cb6f94bb..732b580b7bc 100644 --- a/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/ui/paymentsheet/server_side_confirm/complete_flow/ServerSideConfirmationCompleteFlowActivity.kt +++ b/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/ui/paymentsheet/server_side_confirm/complete_flow/ServerSideConfirmationCompleteFlowActivity.kt @@ -9,7 +9,6 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import com.google.android.material.snackbar.Snackbar -import com.stripe.android.paymentsheet.ExperimentalPaymentSheetDecouplingApi import com.stripe.android.paymentsheet.example.samples.model.toIntentConfiguration import com.stripe.android.paymentsheet.example.samples.ui.shared.BuyButton import com.stripe.android.paymentsheet.example.samples.ui.shared.CompletedPaymentAlertDialog @@ -29,7 +28,6 @@ internal class ServerSideConfirmationCompleteFlowActivity : AppCompatActivity() private val viewModel by viewModels() - @OptIn(ExperimentalPaymentSheetDecouplingApi::class) override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) diff --git a/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/ui/paymentsheet/server_side_confirm/complete_flow/ServerSideConfirmationCompleteFlowViewModel.kt b/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/ui/paymentsheet/server_side_confirm/complete_flow/ServerSideConfirmationCompleteFlowViewModel.kt index 0fdbdf17c42..511fdcec518 100644 --- a/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/ui/paymentsheet/server_side_confirm/complete_flow/ServerSideConfirmationCompleteFlowViewModel.kt +++ b/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/ui/paymentsheet/server_side_confirm/complete_flow/ServerSideConfirmationCompleteFlowViewModel.kt @@ -9,7 +9,6 @@ import com.github.kittinunf.fuel.core.requests.suspendable import com.stripe.android.PaymentConfiguration import com.stripe.android.model.PaymentMethod import com.stripe.android.paymentsheet.CreateIntentResult -import com.stripe.android.paymentsheet.ExperimentalPaymentSheetDecouplingApi import com.stripe.android.paymentsheet.PaymentSheetResult import com.stripe.android.paymentsheet.example.samples.model.CartProduct import com.stripe.android.paymentsheet.example.samples.model.CartState @@ -68,7 +67,6 @@ internal class ServerSideConfirmationCompleteFlowViewModel( } } - @OptIn(ExperimentalPaymentSheetDecouplingApi::class) suspend fun createAndConfirmIntent( paymentMethod: PaymentMethod, shouldSavePaymentMethod: Boolean, diff --git a/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/ui/paymentsheet/server_side_confirm/custom_flow/ServerSideConfirmationCustomFlowActivity.kt b/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/ui/paymentsheet/server_side_confirm/custom_flow/ServerSideConfirmationCustomFlowActivity.kt index a65a1342452..4c848513696 100644 --- a/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/ui/paymentsheet/server_side_confirm/custom_flow/ServerSideConfirmationCustomFlowActivity.kt +++ b/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/ui/paymentsheet/server_side_confirm/custom_flow/ServerSideConfirmationCustomFlowActivity.kt @@ -13,7 +13,6 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.remember import androidx.compose.ui.platform.LocalContext import com.google.android.material.snackbar.Snackbar -import com.stripe.android.paymentsheet.ExperimentalPaymentSheetDecouplingApi import com.stripe.android.paymentsheet.PaymentSheet import com.stripe.android.paymentsheet.example.R import com.stripe.android.paymentsheet.example.samples.model.toIntentConfiguration @@ -38,7 +37,6 @@ internal class ServerSideConfirmationCustomFlowActivity : AppCompatActivity() { private val viewModel by viewModels() - @OptIn(ExperimentalPaymentSheetDecouplingApi::class) override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -102,7 +100,6 @@ internal class ServerSideConfirmationCustomFlowActivity : AppCompatActivity() { } } - @OptIn(ExperimentalPaymentSheetDecouplingApi::class) @Composable fun AttachFlowControllerToViewModel( flowController: PaymentSheet.FlowController, diff --git a/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/ui/paymentsheet/server_side_confirm/custom_flow/ServerSideConfirmationCustomFlowViewModel.kt b/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/ui/paymentsheet/server_side_confirm/custom_flow/ServerSideConfirmationCustomFlowViewModel.kt index e9af3fa0499..3986c7a2f6e 100644 --- a/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/ui/paymentsheet/server_side_confirm/custom_flow/ServerSideConfirmationCustomFlowViewModel.kt +++ b/paymentsheet-example/src/main/java/com/stripe/android/paymentsheet/example/samples/ui/paymentsheet/server_side_confirm/custom_flow/ServerSideConfirmationCustomFlowViewModel.kt @@ -9,7 +9,6 @@ import com.github.kittinunf.fuel.core.requests.suspendable import com.stripe.android.PaymentConfiguration import com.stripe.android.model.PaymentMethod import com.stripe.android.paymentsheet.CreateIntentResult -import com.stripe.android.paymentsheet.ExperimentalPaymentSheetDecouplingApi import com.stripe.android.paymentsheet.PaymentSheetResult import com.stripe.android.paymentsheet.example.samples.model.CartProduct import com.stripe.android.paymentsheet.example.samples.model.CartState @@ -90,7 +89,6 @@ internal class ServerSideConfirmationCustomFlowViewModel( } } - @OptIn(ExperimentalPaymentSheetDecouplingApi::class) suspend fun createAndConfirmIntent( paymentMethod: PaymentMethod, shouldSavePaymentMethod: Boolean, diff --git a/paymentsheet/detekt-baseline.xml b/paymentsheet/detekt-baseline.xml index 0af5aff2d59..08794170e45 100644 --- a/paymentsheet/detekt-baseline.xml +++ b/paymentsheet/detekt-baseline.xml @@ -27,8 +27,8 @@ LongMethod:PaymentOptionFactory.kt$PaymentOptionFactory$fun create(selection: PaymentSelection): PaymentOption LongMethod:PaymentSheetConfigurationKtx.kt$internal fun PaymentSheet.Appearance.parseAppearance() LongMethod:PaymentSheetLoader.kt$DefaultPaymentSheetLoader$private suspend fun create( stripeIntent: StripeIntent, customerConfig: PaymentSheet.CustomerConfiguration?, config: PaymentSheet.Configuration?, isGooglePayReady: Boolean, merchantCountry: String?, ): PaymentSheetLoader.Result + LongMethod:USBankAccountForm.kt$@Composable internal fun USBankAccountForm( formArgs: FormArguments, sheetViewModel: BaseSheetViewModel, isProcessing: Boolean, modifier: Modifier = Modifier, ) LongMethod:USBankAccountForm.kt$@Composable private fun AccountDetailsForm( formArgs: FormArguments, isProcessing: Boolean, bankName: String?, last4: String?, saveForFutureUseElement: SaveForFutureUseElement, onRemoveAccount: () -> Unit, ) - LongMethod:USBankAccountForm.kt$@OptIn(ExperimentalPaymentSheetDecouplingApi::class) @Composable internal fun USBankAccountForm( formArgs: FormArguments, sheetViewModel: BaseSheetViewModel, isProcessing: Boolean, modifier: Modifier = Modifier, ) MagicNumber:AutocompleteScreen.kt$0.07f MagicNumber:BaseSheetActivity.kt$BaseSheetActivity$30 MagicNumber:GooglePayButton.kt$GooglePayButton$0.5f diff --git a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/CreateIntentCallback.kt b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/CreateIntentCallback.kt index eb45a56bce5..127f4f580aa 100644 --- a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/CreateIntentCallback.kt +++ b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/CreateIntentCallback.kt @@ -12,7 +12,6 @@ sealed interface AbsCreateIntentCallback * Callback to be used when you use `PaymentSheet` and intend to create and optionally confirm the * [PaymentIntent] or [SetupIntent] on your server. */ -@ExperimentalPaymentSheetDecouplingApi fun interface CreateIntentCallback : AbsCreateIntentCallback { /** @@ -38,13 +37,10 @@ fun interface CreateIntentCallback : AbsCreateIntentCallback { /** * Represents the result of a [CreateIntentCallback]. */ -@ExperimentalPaymentSheetDecouplingApi sealed interface CreateIntentResult { - @ExperimentalPaymentSheetDecouplingApi class Success(internal val clientSecret: String) : CreateIntentResult - @ExperimentalPaymentSheetDecouplingApi class Failure @JvmOverloads constructor( internal val cause: Exception, internal val displayMessage: String? = null, diff --git a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/DeferredIntentValidator.kt b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/DeferredIntentValidator.kt index 47368e81f5c..218607b7d43 100644 --- a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/DeferredIntentValidator.kt +++ b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/DeferredIntentValidator.kt @@ -8,7 +8,6 @@ import com.stripe.android.model.SetupIntent import com.stripe.android.model.StripeIntent import com.stripe.android.paymentsheet.repositories.toElementsSessionParams -@OptIn(ExperimentalPaymentSheetDecouplingApi::class) internal object DeferredIntentValidator { /** diff --git a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/ExperimentalPaymentSheetDecouplingApi.kt b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/ExperimentalPaymentSheetDecouplingApi.kt index 8603c09bc00..8286ff06e21 100644 --- a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/ExperimentalPaymentSheetDecouplingApi.kt +++ b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/ExperimentalPaymentSheetDecouplingApi.kt @@ -1,5 +1,9 @@ package com.stripe.android.paymentsheet +@Deprecated( + message = "This feature is no longer experimental. You can remove the annotation.", + level = DeprecationLevel.HIDDEN, +) @RequiresOptIn( level = RequiresOptIn.Level.ERROR, message = "This is an experimental API for finalizing payments on the server when using " + diff --git a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/FlowControllerCompose.kt b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/FlowControllerCompose.kt index 910c2cf2890..31f9a230d36 100644 --- a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/FlowControllerCompose.kt +++ b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/FlowControllerCompose.kt @@ -59,7 +59,6 @@ fun rememberPaymentSheetFlowController( * @param paymentOptionCallback Called when the customer's desired payment method changes. * @param paymentResultCallback Called when a [PaymentSheetResult] is available. */ -@ExperimentalPaymentSheetDecouplingApi @Composable fun rememberPaymentSheetFlowController( createIntentCallback: CreateIntentCallback, @@ -73,7 +72,6 @@ fun rememberPaymentSheetFlowController( ) } -@OptIn(ExperimentalPaymentSheetDecouplingApi::class) @Composable private fun UpdateIntentConfirmationInterceptor( createIntentCallback: CreateIntentCallback, diff --git a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/IntentConfirmationInterceptor.kt b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/IntentConfirmationInterceptor.kt index 2281bfc0960..e94f49fa9eb 100644 --- a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/IntentConfirmationInterceptor.kt +++ b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/IntentConfirmationInterceptor.kt @@ -87,7 +87,6 @@ internal enum class DeferredIntentConfirmationType(val value: String) { None("none"); } -@OptIn(ExperimentalPaymentSheetDecouplingApi::class) internal class DefaultIntentConfirmationInterceptor @Inject constructor( private val context: Context, private val stripeRepository: StripeRepository, diff --git a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentSheet.kt b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentSheet.kt index 0c558fdfba0..f463f600645 100644 --- a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentSheet.kt +++ b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentSheet.kt @@ -49,7 +49,6 @@ class PaymentSheet internal constructor( * @param paymentResultCallback Called with the result of the payment or setup after * [PaymentSheet] is dismissed. */ - @ExperimentalPaymentSheetDecouplingApi constructor( activity: ComponentActivity, createIntentCallback: CreateIntentCallback, @@ -82,7 +81,6 @@ class PaymentSheet internal constructor( * @param paymentResultCallback Called with the result of the payment or setup after * [PaymentSheet] is dismissed. */ - @ExperimentalPaymentSheetDecouplingApi constructor( fragment: Fragment, createIntentCallback: CreateIntentCallback, @@ -139,7 +137,6 @@ class PaymentSheet internal constructor( * @param intentConfiguration The [IntentConfiguration] to use. * @param configuration An optional [PaymentSheet] configuration. */ - @ExperimentalPaymentSheetDecouplingApi @JvmOverloads fun presentWithIntentConfiguration( intentConfiguration: IntentConfiguration, @@ -175,7 +172,6 @@ class PaymentSheet internal constructor( } } - @OptIn(ExperimentalPaymentSheetDecouplingApi::class) @Parcelize internal data class DeferredIntent( val intentConfiguration: IntentConfiguration, @@ -200,7 +196,6 @@ class PaymentSheet internal constructor( * @param onBehalfOf The account (if any) for which the funds of the intent are intended. See * [our docs](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-on_behalf_of) for more info. */ - @ExperimentalPaymentSheetDecouplingApi @Parcelize class IntentConfiguration @JvmOverloads constructor( val mode: Mode, @@ -211,7 +206,6 @@ class PaymentSheet internal constructor( /** * Contains information about the desired payment or setup flow. */ - @ExperimentalPaymentSheetDecouplingApi sealed class Mode : Parcelable { internal abstract val setupFutureUse: SetupFutureUse? @@ -230,7 +224,6 @@ class PaymentSheet internal constructor( * @param captureMethod Controls when the funds will be captured from the customer's * account. See [our docs](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method) for more info. */ - @ExperimentalPaymentSheetDecouplingApi @Parcelize class Payment @JvmOverloads constructor( val amount: Long, @@ -247,7 +240,6 @@ class PaymentSheet internal constructor( * @param setupFutureUse Indicates that you intend to make future payments. See * [our docs](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage) for more info. */ - @ExperimentalPaymentSheetDecouplingApi @Parcelize class Setup @JvmOverloads constructor( val currency: String? = null, @@ -263,7 +255,6 @@ class PaymentSheet internal constructor( * Indicates that you intend to make future payments with this [PaymentIntent]'s payment * method. See [our docs](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage) for more info. */ - @ExperimentalPaymentSheetDecouplingApi enum class SetupFutureUse { /** @@ -283,7 +274,6 @@ class PaymentSheet internal constructor( * * See [docs](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method). */ - @ExperimentalPaymentSheetDecouplingApi enum class CaptureMethod { /** @@ -1099,7 +1089,6 @@ class PaymentSheet internal constructor( * @param configuration An optional [PaymentSheet] configuration. * @param callback called with the result of configuring the FlowController. */ - @ExperimentalPaymentSheetDecouplingApi fun configureWithIntentConfiguration( intentConfiguration: IntentConfiguration, configuration: Configuration? = null, @@ -1175,7 +1164,6 @@ class PaymentSheet internal constructor( * @param paymentResultCallback Called with the result of the payment after * [PaymentSheet] is dismissed. */ - @ExperimentalPaymentSheetDecouplingApi @JvmStatic fun create( activity: ComponentActivity, @@ -1223,7 +1211,6 @@ class PaymentSheet internal constructor( * @param paymentResultCallback Called with the result of the payment after * [PaymentSheet] is dismissed. */ - @ExperimentalPaymentSheetDecouplingApi @JvmStatic fun create( fragment: Fragment, diff --git a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentSheetCompose.kt b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentSheetCompose.kt index 3b2e65a333d..17adcdee9b4 100644 --- a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentSheetCompose.kt +++ b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentSheetCompose.kt @@ -57,7 +57,6 @@ fun rememberPaymentSheet( * @param createIntentCallback Called when the customer confirms the payment or setup. * @param paymentResultCallback Called with the result of the payment after [PaymentSheet] is dismissed. */ -@ExperimentalPaymentSheetDecouplingApi @Composable fun rememberPaymentSheet( createIntentCallback: CreateIntentCallback, @@ -67,7 +66,6 @@ fun rememberPaymentSheet( return rememberPaymentSheet(paymentResultCallback) } -@OptIn(ExperimentalPaymentSheetDecouplingApi::class) @Composable private fun UpdateIntentConfirmationInterceptor( createIntentCallback: CreateIntentCallback, diff --git a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentSheetViewModel.kt b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentSheetViewModel.kt index d7a03ab2428..932a64d2303 100644 --- a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentSheetViewModel.kt +++ b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/PaymentSheetViewModel.kt @@ -78,7 +78,6 @@ import javax.inject.Provider import kotlin.coroutines.CoroutineContext import com.stripe.android.R as StripeR -@OptIn(ExperimentalPaymentSheetDecouplingApi::class) internal class PaymentSheetViewModel @Inject internal constructor( // Properties provided through PaymentSheetViewModelComponent.Builder application: Application, @@ -684,7 +683,6 @@ internal class PaymentSheetViewModel @Inject internal constructor( } } -@OptIn(ExperimentalPaymentSheetDecouplingApi::class) private val PaymentSheet.InitializationMode.isProcessingPayment: Boolean get() = when (this) { is PaymentSheet.InitializationMode.PaymentIntent -> true diff --git a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/flowcontroller/DefaultFlowController.kt b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/flowcontroller/DefaultFlowController.kt index ac998404e6a..0dda92319e0 100644 --- a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/flowcontroller/DefaultFlowController.kt +++ b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/flowcontroller/DefaultFlowController.kt @@ -37,7 +37,6 @@ import com.stripe.android.payments.paymentlauncher.PaymentLauncherContract import com.stripe.android.payments.paymentlauncher.PaymentResult import com.stripe.android.payments.paymentlauncher.StripePaymentLauncher import com.stripe.android.payments.paymentlauncher.StripePaymentLauncherAssistedFactory -import com.stripe.android.paymentsheet.ExperimentalPaymentSheetDecouplingApi import com.stripe.android.paymentsheet.IntentConfirmationInterceptor import com.stripe.android.paymentsheet.PaymentOptionCallback import com.stripe.android.paymentsheet.PaymentOptionContract @@ -212,7 +211,6 @@ internal class DefaultFlowController @Inject internal constructor( ) } - @ExperimentalPaymentSheetDecouplingApi override fun configureWithIntentConfiguration( intentConfiguration: PaymentSheet.IntentConfiguration, configuration: PaymentSheet.Configuration?, diff --git a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/paymentdatacollection/ach/USBankAccountForm.kt b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/paymentdatacollection/ach/USBankAccountForm.kt index dc4440a5fef..b2ff5a3fc08 100644 --- a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/paymentdatacollection/ach/USBankAccountForm.kt +++ b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/paymentdatacollection/ach/USBankAccountForm.kt @@ -30,7 +30,6 @@ import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.unit.dp import androidx.lifecycle.viewmodel.compose.viewModel import com.stripe.android.model.PaymentIntent -import com.stripe.android.paymentsheet.ExperimentalPaymentSheetDecouplingApi import com.stripe.android.paymentsheet.PaymentSheet import com.stripe.android.paymentsheet.PaymentSheet.BillingDetailsCollectionConfiguration.AddressCollectionMode import com.stripe.android.paymentsheet.PaymentSheet.BillingDetailsCollectionConfiguration.CollectionMode @@ -58,7 +57,6 @@ import com.stripe.android.uicore.stripeColors import com.stripe.android.R as StripeR import com.stripe.android.ui.core.R as PaymentsUiCoreR -@OptIn(ExperimentalPaymentSheetDecouplingApi::class) @Composable internal fun USBankAccountForm( formArgs: FormArguments, diff --git a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/repositories/ElementsSessionRepository.kt b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/repositories/ElementsSessionRepository.kt index 06d92504ca6..23ca3a73b5a 100644 --- a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/repositories/ElementsSessionRepository.kt +++ b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/repositories/ElementsSessionRepository.kt @@ -11,7 +11,6 @@ import com.stripe.android.model.PaymentIntent.CaptureMethod import com.stripe.android.model.StripeIntent import com.stripe.android.model.StripeIntent.Usage import com.stripe.android.networking.StripeRepository -import com.stripe.android.paymentsheet.ExperimentalPaymentSheetDecouplingApi import com.stripe.android.paymentsheet.PaymentSheet import kotlinx.coroutines.withContext import javax.inject.Inject @@ -126,7 +125,6 @@ internal sealed class ElementsSessionRepository { } } -@OptIn(ExperimentalPaymentSheetDecouplingApi::class) internal fun PaymentSheet.InitializationMode.toElementsSessionParams(): ElementsSessionParams { return when (this) { is PaymentSheet.InitializationMode.PaymentIntent -> { @@ -147,7 +145,6 @@ internal fun PaymentSheet.InitializationMode.toElementsSessionParams(): Elements } } -@OptIn(ExperimentalPaymentSheetDecouplingApi::class) private fun PaymentSheet.IntentConfiguration.Mode.toElementsSessionParam(): Mode { return when (this) { is PaymentSheet.IntentConfiguration.Mode.Payment -> { @@ -167,7 +164,6 @@ private fun PaymentSheet.IntentConfiguration.Mode.toElementsSessionParam(): Mode } } -@OptIn(ExperimentalPaymentSheetDecouplingApi::class) private fun PaymentSheet.IntentConfiguration.SetupFutureUse.toElementsSessionParam(): Usage { return when (this) { PaymentSheet.IntentConfiguration.SetupFutureUse.OnSession -> Usage.OnSession @@ -175,7 +171,6 @@ private fun PaymentSheet.IntentConfiguration.SetupFutureUse.toElementsSessionPar } } -@OptIn(ExperimentalPaymentSheetDecouplingApi::class) private fun PaymentSheet.IntentConfiguration.CaptureMethod.toElementsSessionParam(): CaptureMethod { return when (this) { PaymentSheet.IntentConfiguration.CaptureMethod.Automatic -> CaptureMethod.Automatic diff --git a/paymentsheet/src/test/java/com/stripe/android/paymentsheet/DefaultIntentConfirmationInterceptorTest.kt b/paymentsheet/src/test/java/com/stripe/android/paymentsheet/DefaultIntentConfirmationInterceptorTest.kt index 6e75837440d..64dd63d7f01 100644 --- a/paymentsheet/src/test/java/com/stripe/android/paymentsheet/DefaultIntentConfirmationInterceptorTest.kt +++ b/paymentsheet/src/test/java/com/stripe/android/paymentsheet/DefaultIntentConfirmationInterceptorTest.kt @@ -28,7 +28,6 @@ import org.robolectric.RobolectricTestRunner import java.util.Objects import kotlin.test.assertFailsWith -@OptIn(ExperimentalPaymentSheetDecouplingApi::class) @RunWith(RobolectricTestRunner::class) class DefaultIntentConfirmationInterceptorTest { diff --git a/paymentsheet/src/test/java/com/stripe/android/paymentsheet/DefaultPaymentSheetLauncherTest.kt b/paymentsheet/src/test/java/com/stripe/android/paymentsheet/DefaultPaymentSheetLauncherTest.kt index a90d3ab6902..f3922dfcb5d 100644 --- a/paymentsheet/src/test/java/com/stripe/android/paymentsheet/DefaultPaymentSheetLauncherTest.kt +++ b/paymentsheet/src/test/java/com/stripe/android/paymentsheet/DefaultPaymentSheetLauncherTest.kt @@ -53,7 +53,6 @@ class DefaultPaymentSheetLauncherTest { } } - @OptIn(ExperimentalPaymentSheetDecouplingApi::class) @Test fun `Clears out CreateIntentCallback when lifecycle owner is destroyed`() { IntentConfirmationInterceptor.createIntentCallback = CreateIntentCallback { _, _ -> diff --git a/paymentsheet/src/test/java/com/stripe/android/paymentsheet/DeferredIntentValidatorTest.kt b/paymentsheet/src/test/java/com/stripe/android/paymentsheet/DeferredIntentValidatorTest.kt index 51f7240fcf5..261919081b3 100644 --- a/paymentsheet/src/test/java/com/stripe/android/paymentsheet/DeferredIntentValidatorTest.kt +++ b/paymentsheet/src/test/java/com/stripe/android/paymentsheet/DeferredIntentValidatorTest.kt @@ -9,7 +9,6 @@ import com.stripe.android.testing.PaymentIntentFactory import kotlin.test.Test import kotlin.test.assertFailsWith -@OptIn(ExperimentalPaymentSheetDecouplingApi::class) internal class DeferredIntentValidatorTest { @Test diff --git a/paymentsheet/src/test/java/com/stripe/android/paymentsheet/PaymentSheetViewModelTest.kt b/paymentsheet/src/test/java/com/stripe/android/paymentsheet/PaymentSheetViewModelTest.kt index f261390344f..6bb7e8b11ed 100644 --- a/paymentsheet/src/test/java/com/stripe/android/paymentsheet/PaymentSheetViewModelTest.kt +++ b/paymentsheet/src/test/java/com/stripe/android/paymentsheet/PaymentSheetViewModelTest.kt @@ -1275,7 +1275,6 @@ internal class PaymentSheetViewModelTest { ) } - @OptIn(ExperimentalPaymentSheetDecouplingApi::class) @Test fun `Sends correct analytics event when using deferred intent with client-side confirmation`() = runTest { IntentConfirmationInterceptor.createIntentCallback = CreateIntentCallback { _, _ -> @@ -1290,7 +1289,6 @@ internal class PaymentSheetViewModelTest { ) } - @OptIn(ExperimentalPaymentSheetDecouplingApi::class) @Test fun `Sends correct analytics event when using deferred intent with server-side confirmation`() = runTest { IntentConfirmationInterceptor.createIntentCallback = @@ -1306,7 +1304,7 @@ internal class PaymentSheetViewModelTest { ) } - @OptIn(ExperimentalPaymentSheetDecouplingApi::class, DelicatePaymentSheetApi::class) + @OptIn(DelicatePaymentSheetApi::class) @Test fun `Sends correct analytics event based on force-success usage`() = runTest { val clientSecrets = listOf( @@ -1465,7 +1463,6 @@ internal class PaymentSheetViewModelTest { } } - @OptIn(ExperimentalPaymentSheetDecouplingApi::class) private fun createViewModelForDeferredIntent( args: PaymentSheetContractV2.Args = ARGS_CUSTOMER_WITH_GOOGLEPAY, paymentIntent: PaymentIntent = PAYMENT_INTENT, diff --git a/paymentsheet/src/test/java/com/stripe/android/paymentsheet/flowcontroller/DefaultFlowControllerTest.kt b/paymentsheet/src/test/java/com/stripe/android/paymentsheet/flowcontroller/DefaultFlowControllerTest.kt index f388d750b36..e9e037849d6 100644 --- a/paymentsheet/src/test/java/com/stripe/android/paymentsheet/flowcontroller/DefaultFlowControllerTest.kt +++ b/paymentsheet/src/test/java/com/stripe/android/paymentsheet/flowcontroller/DefaultFlowControllerTest.kt @@ -44,7 +44,6 @@ import com.stripe.android.paymentsheet.CreateIntentCallback import com.stripe.android.paymentsheet.CreateIntentResult import com.stripe.android.paymentsheet.DeferredIntentConfirmationType import com.stripe.android.paymentsheet.DelicatePaymentSheetApi -import com.stripe.android.paymentsheet.ExperimentalPaymentSheetDecouplingApi import com.stripe.android.paymentsheet.IntentConfirmationInterceptor import com.stripe.android.paymentsheet.PaymentOptionCallback import com.stripe.android.paymentsheet.PaymentOptionContract @@ -1213,7 +1212,7 @@ internal class DefaultFlowControllerTest { verify(paymentOptionActivityLauncher, never()).launch(any()) } - @OptIn(ExperimentalPaymentSheetDecouplingApi::class, DelicatePaymentSheetApi::class) + @OptIn(DelicatePaymentSheetApi::class) @Test fun `Sends correct analytics event based on force-success usage`() = runTest { val clientSecrets = listOf( @@ -1326,7 +1325,6 @@ internal class DefaultFlowControllerTest { ) } - @OptIn(ExperimentalPaymentSheetDecouplingApi::class) private fun createAndConfigureFlowControllerForDeferredIntent( paymentIntent: PaymentIntent = PaymentIntentFixtures.PI_SUCCEEDED, ): DefaultFlowController { diff --git a/paymentsheet/src/test/java/com/stripe/android/paymentsheet/flowcontroller/FlowControllerConfigurationHandlerTest.kt b/paymentsheet/src/test/java/com/stripe/android/paymentsheet/flowcontroller/FlowControllerConfigurationHandlerTest.kt index 919a5cad499..7b58b50fa1b 100644 --- a/paymentsheet/src/test/java/com/stripe/android/paymentsheet/flowcontroller/FlowControllerConfigurationHandlerTest.kt +++ b/paymentsheet/src/test/java/com/stripe/android/paymentsheet/flowcontroller/FlowControllerConfigurationHandlerTest.kt @@ -11,7 +11,6 @@ import com.stripe.android.PaymentConfiguration import com.stripe.android.core.networking.AnalyticsRequestFactory import com.stripe.android.model.PaymentIntentFixtures import com.stripe.android.paymentsheet.CreateIntentCallback -import com.stripe.android.paymentsheet.ExperimentalPaymentSheetDecouplingApi import com.stripe.android.paymentsheet.IntentConfirmationInterceptor import com.stripe.android.paymentsheet.PaymentSheet import com.stripe.android.paymentsheet.PaymentSheetFixtures @@ -332,7 +331,6 @@ class FlowControllerConfigurationHandlerTest { assertThat(onInitCallbacks).isEqualTo(0) } - @OptIn(ExperimentalPaymentSheetDecouplingApi::class) @Test fun `Cancels current configure job if new call to configure comes in`() = runTest { val loader = DelayingPaymentSheetLoader() @@ -436,7 +434,6 @@ class FlowControllerConfigurationHandlerTest { ) } - @OptIn(ExperimentalPaymentSheetDecouplingApi::class) @Test fun `Sends correct analytics event when using deferred intent with client-side confirmation`() = runTest { val configureTurbine = Turbine() @@ -469,7 +466,6 @@ class FlowControllerConfigurationHandlerTest { ) } - @OptIn(ExperimentalPaymentSheetDecouplingApi::class) @Test fun `Sends correct analytics event when using deferred intent with server-side confirmation`() = runTest { val configureTurbine = Turbine() diff --git a/paymentsheet/src/test/java/com/stripe/android/paymentsheet/repositories/ElementsSessionRepositoryTest.kt b/paymentsheet/src/test/java/com/stripe/android/paymentsheet/repositories/ElementsSessionRepositoryTest.kt index 36c78bbad62..6f8e9e5131d 100644 --- a/paymentsheet/src/test/java/com/stripe/android/paymentsheet/repositories/ElementsSessionRepositoryTest.kt +++ b/paymentsheet/src/test/java/com/stripe/android/paymentsheet/repositories/ElementsSessionRepositoryTest.kt @@ -9,7 +9,6 @@ import com.stripe.android.model.ElementsSession import com.stripe.android.model.ElementsSessionParams import com.stripe.android.model.PaymentIntentFixtures import com.stripe.android.networking.StripeRepository -import com.stripe.android.paymentsheet.ExperimentalPaymentSheetDecouplingApi import com.stripe.android.paymentsheet.PaymentSheet import kotlinx.coroutines.test.UnconfinedTestDispatcher import kotlinx.coroutines.test.runTest @@ -143,7 +142,6 @@ internal class ElementsSessionRepositoryTest { assertThat(argumentCaptor.firstValue.locale).isEqualTo(defaultLocale) } - @OptIn(ExperimentalPaymentSheetDecouplingApi::class) @Test fun `Returns the Elements Session endpoint's exception if there's no fallback`() = runTest { val endpointException = APIException(message = "this didn't work") From 0f9d24a06055c81d643b8d7bebd3ff5402cc6152 Mon Sep 17 00:00:00 2001 From: Till Hellmund Date: Tue, 4 Jul 2023 10:37:50 -0400 Subject: [PATCH 2/8] Make decoupling API stable --- build.gradle | 1 - paymentsheet/api/paymentsheet.api | 89 +++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 0e0f844e917..52e7acbd15f 100644 --- a/build.gradle +++ b/build.gradle @@ -102,6 +102,5 @@ apiValidation { "stripecardscan-example", ] nonPublicMarkers.add("androidx.annotation.RestrictTo") - nonPublicMarkers.add("com.stripe.android.paymentsheet.ExperimentalPaymentSheetDecouplingApi") nonPublicMarkers.add("dagger.internal.DaggerGenerated") } diff --git a/paymentsheet/api/paymentsheet.api b/paymentsheet/api/paymentsheet.api index 27561ed8ecd..d3077a1234e 100644 --- a/paymentsheet/api/paymentsheet.api +++ b/paymentsheet/api/paymentsheet.api @@ -45,6 +45,25 @@ public final class com/stripe/android/paymentsheet/ComposableSingletons$PaymentO public final fun getLambda-2$paymentsheet_release ()Lkotlin/jvm/functions/Function2; } +public abstract interface class com/stripe/android/paymentsheet/CreateIntentCallback : com/stripe/android/paymentsheet/AbsCreateIntentCallback { + public abstract fun onCreateIntent (Lcom/stripe/android/model/PaymentMethod;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; +} + +public abstract interface class com/stripe/android/paymentsheet/CreateIntentResult { +} + +public final class com/stripe/android/paymentsheet/CreateIntentResult$Failure : com/stripe/android/paymentsheet/CreateIntentResult { + public static final field $stable I + public fun (Ljava/lang/Exception;)V + public fun (Ljava/lang/Exception;Ljava/lang/String;)V + public synthetic fun (Ljava/lang/Exception;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V +} + +public final class com/stripe/android/paymentsheet/CreateIntentResult$Success : com/stripe/android/paymentsheet/CreateIntentResult { + public static final field $stable I + public fun (Ljava/lang/String;)V +} + public abstract interface annotation class com/stripe/android/paymentsheet/DelicatePaymentSheetApi : java/lang/annotation/Annotation { } @@ -102,8 +121,13 @@ public final class com/stripe/android/paymentsheet/PaymentOptionUiKt { public final class com/stripe/android/paymentsheet/PaymentSheet { public static final field $stable I public static final field Companion Lcom/stripe/android/paymentsheet/PaymentSheet$Companion; + public fun (Landroidx/activity/ComponentActivity;Lcom/stripe/android/paymentsheet/CreateIntentCallback;Lcom/stripe/android/paymentsheet/PaymentSheetResultCallback;)V public fun (Landroidx/activity/ComponentActivity;Lcom/stripe/android/paymentsheet/PaymentSheetResultCallback;)V + public fun (Landroidx/fragment/app/Fragment;Lcom/stripe/android/paymentsheet/CreateIntentCallback;Lcom/stripe/android/paymentsheet/PaymentSheetResultCallback;)V public fun (Landroidx/fragment/app/Fragment;Lcom/stripe/android/paymentsheet/PaymentSheetResultCallback;)V + public final fun presentWithIntentConfiguration (Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration;)V + public final fun presentWithIntentConfiguration (Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration;Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;)V + public static synthetic fun presentWithIntentConfiguration$default (Lcom/stripe/android/paymentsheet/PaymentSheet;Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration;Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;ILjava/lang/Object;)V public final fun presentWithPaymentIntent (Ljava/lang/String;)V public final fun presentWithPaymentIntent (Ljava/lang/String;Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;)V public static synthetic fun presentWithPaymentIntent$default (Lcom/stripe/android/paymentsheet/PaymentSheet;Ljava/lang/String;Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;ILjava/lang/Object;)V @@ -445,10 +469,13 @@ public final class com/stripe/android/paymentsheet/PaymentSheet$CustomerConfigur public abstract interface class com/stripe/android/paymentsheet/PaymentSheet$FlowController { public static final field Companion Lcom/stripe/android/paymentsheet/PaymentSheet$FlowController$Companion; + public abstract fun configureWithIntentConfiguration (Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration;Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;Lcom/stripe/android/paymentsheet/PaymentSheet$FlowController$ConfigCallback;)V public abstract fun configureWithPaymentIntent (Ljava/lang/String;Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;Lcom/stripe/android/paymentsheet/PaymentSheet$FlowController$ConfigCallback;)V public abstract fun configureWithSetupIntent (Ljava/lang/String;Lcom/stripe/android/paymentsheet/PaymentSheet$Configuration;Lcom/stripe/android/paymentsheet/PaymentSheet$FlowController$ConfigCallback;)V public abstract fun confirm ()V + public static fun create (Landroidx/activity/ComponentActivity;Lcom/stripe/android/paymentsheet/PaymentOptionCallback;Lcom/stripe/android/paymentsheet/CreateIntentCallback;Lcom/stripe/android/paymentsheet/PaymentSheetResultCallback;)Lcom/stripe/android/paymentsheet/PaymentSheet$FlowController; public static fun create (Landroidx/activity/ComponentActivity;Lcom/stripe/android/paymentsheet/PaymentOptionCallback;Lcom/stripe/android/paymentsheet/PaymentSheetResultCallback;)Lcom/stripe/android/paymentsheet/PaymentSheet$FlowController; + public static fun create (Landroidx/fragment/app/Fragment;Lcom/stripe/android/paymentsheet/PaymentOptionCallback;Lcom/stripe/android/paymentsheet/CreateIntentCallback;Lcom/stripe/android/paymentsheet/PaymentSheetResultCallback;)Lcom/stripe/android/paymentsheet/PaymentSheet$FlowController; public static fun create (Landroidx/fragment/app/Fragment;Lcom/stripe/android/paymentsheet/PaymentOptionCallback;Lcom/stripe/android/paymentsheet/PaymentSheetResultCallback;)Lcom/stripe/android/paymentsheet/PaymentSheet$FlowController; public abstract fun getPaymentOption ()Lcom/stripe/android/paymentsheet/model/PaymentOption; public abstract fun getShippingDetails ()Lcom/stripe/android/paymentsheet/addresselement/AddressDetails; @@ -457,7 +484,9 @@ public abstract interface class com/stripe/android/paymentsheet/PaymentSheet$Flo } public final class com/stripe/android/paymentsheet/PaymentSheet$FlowController$Companion { + public final fun create (Landroidx/activity/ComponentActivity;Lcom/stripe/android/paymentsheet/PaymentOptionCallback;Lcom/stripe/android/paymentsheet/CreateIntentCallback;Lcom/stripe/android/paymentsheet/PaymentSheetResultCallback;)Lcom/stripe/android/paymentsheet/PaymentSheet$FlowController; public final fun create (Landroidx/activity/ComponentActivity;Lcom/stripe/android/paymentsheet/PaymentOptionCallback;Lcom/stripe/android/paymentsheet/PaymentSheetResultCallback;)Lcom/stripe/android/paymentsheet/PaymentSheet$FlowController; + public final fun create (Landroidx/fragment/app/Fragment;Lcom/stripe/android/paymentsheet/PaymentOptionCallback;Lcom/stripe/android/paymentsheet/CreateIntentCallback;Lcom/stripe/android/paymentsheet/PaymentSheetResultCallback;)Lcom/stripe/android/paymentsheet/PaymentSheet$FlowController; public final fun create (Landroidx/fragment/app/Fragment;Lcom/stripe/android/paymentsheet/PaymentOptionCallback;Lcom/stripe/android/paymentsheet/PaymentSheetResultCallback;)Lcom/stripe/android/paymentsheet/PaymentSheet$FlowController; } @@ -546,6 +575,30 @@ public final class com/stripe/android/paymentsheet/PaymentSheet$InitializationMo public synthetic fun newArray (I)[Ljava/lang/Object; } +public final class com/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration : android/os/Parcelable { + public static final field $stable I + public static final field COMPLETE_WITHOUT_CONFIRMING_INTENT Ljava/lang/String; + public static final field CREATOR Landroid/os/Parcelable$Creator; + public static final field Companion Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$Companion; + public fun (Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$Mode;)V + public fun (Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$Mode;Ljava/util/List;)V + public fun (Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$Mode;Ljava/util/List;Ljava/lang/String;)V + public synthetic fun (Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$Mode;Ljava/util/List;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun describeContents ()I + public final fun getMode ()Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$Mode; + public final fun getOnBehalfOf ()Ljava/lang/String; + public final fun getPaymentMethodTypes ()Ljava/util/List; + public fun writeToParcel (Landroid/os/Parcel;I)V +} + +public final class com/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$CaptureMethod : java/lang/Enum { + public static final field Automatic Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$CaptureMethod; + public static final field AutomaticAsync Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$CaptureMethod; + public static final field Manual Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$CaptureMethod; + public static fun valueOf (Ljava/lang/String;)Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$CaptureMethod; + public static fun values ()[Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$CaptureMethod; +} + public final class com/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$Companion { } @@ -557,6 +610,23 @@ public final class com/stripe/android/paymentsheet/PaymentSheet$IntentConfigurat public synthetic fun newArray (I)[Ljava/lang/Object; } +public abstract class com/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$Mode : android/os/Parcelable { + public static final field $stable I +} + +public final class com/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$Mode$Payment : com/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$Mode { + public static final field $stable I + public static final field CREATOR Landroid/os/Parcelable$Creator; + public fun (JLjava/lang/String;)V + public fun (JLjava/lang/String;Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$SetupFutureUse;)V + public fun (JLjava/lang/String;Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$SetupFutureUse;Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$CaptureMethod;)V + public synthetic fun (JLjava/lang/String;Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$SetupFutureUse;Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$CaptureMethod;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun describeContents ()I + public final fun getAmount ()J + public final fun getCurrency ()Ljava/lang/String; + public fun writeToParcel (Landroid/os/Parcel;I)V +} + public final class com/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$Mode$Payment$Creator : android/os/Parcelable$Creator { public fun ()V public final fun createFromParcel (Landroid/os/Parcel;)Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$Mode$Payment; @@ -565,6 +635,18 @@ public final class com/stripe/android/paymentsheet/PaymentSheet$IntentConfigurat public synthetic fun newArray (I)[Ljava/lang/Object; } +public final class com/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$Mode$Setup : com/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$Mode { + public static final field $stable I + public static final field CREATOR Landroid/os/Parcelable$Creator; + public fun ()V + public fun (Ljava/lang/String;)V + public fun (Ljava/lang/String;Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$SetupFutureUse;)V + public synthetic fun (Ljava/lang/String;Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$SetupFutureUse;ILkotlin/jvm/internal/DefaultConstructorMarker;)V + public fun describeContents ()I + public final fun getCurrency ()Ljava/lang/String; + public fun writeToParcel (Landroid/os/Parcel;I)V +} + public final class com/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$Mode$Setup$Creator : android/os/Parcelable$Creator { public fun ()V public final fun createFromParcel (Landroid/os/Parcel;)Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$Mode$Setup; @@ -573,6 +655,13 @@ public final class com/stripe/android/paymentsheet/PaymentSheet$IntentConfigurat public synthetic fun newArray (I)[Ljava/lang/Object; } +public final class com/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$SetupFutureUse : java/lang/Enum { + public static final field OffSession Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$SetupFutureUse; + public static final field OnSession Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$SetupFutureUse; + public static fun valueOf (Ljava/lang/String;)Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$SetupFutureUse; + public static fun values ()[Lcom/stripe/android/paymentsheet/PaymentSheet$IntentConfiguration$SetupFutureUse; +} + public final class com/stripe/android/paymentsheet/PaymentSheet$PrimaryButton : android/os/Parcelable { public static final field $stable I public static final field CREATOR Landroid/os/Parcelable$Creator; From f224cac0241fe6aadc9b6cd6c64207f84fae3c83 Mon Sep 17 00:00:00 2001 From: Till Hellmund Date: Tue, 4 Jul 2023 10:37:56 -0400 Subject: [PATCH 3/8] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d75bb990fcb..8a3898602bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## XX.XX.XX - 2023-XX-XX +### PaymentSheet +* [ADDED][6857](https://github.com/stripe/stripe-android/pull/6857) The API for [finalizing payments on the server](https://stripe.com/docs/payments/finalize-payments-on-the-server?platform=android) is now stable. + ### PaymentSheet * [ADDED][6583](https://github.com/stripe/stripe-android/pull/6583) Added top-level methods `rememberPaymentSheet()` and `rememberPaymentSheetFlowController()` for easier integration in Compose. * [DEPRECATED][6583](https://github.com/stripe/stripe-android/pull/6583) `PaymentSheetContract` has been deprecated and will be removed in a future release. Use the `PaymentSheet` constructor or new `rememberPaymentSheet()` method instead. From aab4e5ba378ddcc00ab526ca6e8e4d717d4ad264 Mon Sep 17 00:00:00 2001 From: Till Hellmund Date: Tue, 4 Jul 2023 11:29:28 -0400 Subject: [PATCH 4/8] Update PaymentSheet API --- paymentsheet/api/paymentsheet.api | 2 ++ 1 file changed, 2 insertions(+) diff --git a/paymentsheet/api/paymentsheet.api b/paymentsheet/api/paymentsheet.api index d3077a1234e..80998ddae97 100644 --- a/paymentsheet/api/paymentsheet.api +++ b/paymentsheet/api/paymentsheet.api @@ -71,6 +71,7 @@ public abstract interface annotation class com/stripe/android/paymentsheet/Exper } public final class com/stripe/android/paymentsheet/FlowControllerComposeKt { + public static final fun rememberPaymentSheetFlowController (Lcom/stripe/android/paymentsheet/CreateIntentCallback;Lcom/stripe/android/paymentsheet/PaymentOptionCallback;Lcom/stripe/android/paymentsheet/PaymentSheetResultCallback;Landroidx/compose/runtime/Composer;I)Lcom/stripe/android/paymentsheet/PaymentSheet$FlowController; public static final fun rememberPaymentSheetFlowController (Lcom/stripe/android/paymentsheet/PaymentOptionCallback;Lcom/stripe/android/paymentsheet/PaymentSheetResultCallback;Landroidx/compose/runtime/Composer;I)Lcom/stripe/android/paymentsheet/PaymentSheet$FlowController; } @@ -847,6 +848,7 @@ public final class com/stripe/android/paymentsheet/PaymentSheet$Typography$Creat } public final class com/stripe/android/paymentsheet/PaymentSheetComposeKt { + public static final fun rememberPaymentSheet (Lcom/stripe/android/paymentsheet/CreateIntentCallback;Lcom/stripe/android/paymentsheet/PaymentSheetResultCallback;Landroidx/compose/runtime/Composer;I)Lcom/stripe/android/paymentsheet/PaymentSheet; public static final fun rememberPaymentSheet (Lcom/stripe/android/paymentsheet/PaymentSheetResultCallback;Landroidx/compose/runtime/Composer;I)Lcom/stripe/android/paymentsheet/PaymentSheet; } From d9b33b1cccebf4bab43dba44313321f0a8eb1903 Mon Sep 17 00:00:00 2001 From: Till Hellmund Date: Tue, 4 Jul 2023 11:31:13 -0400 Subject: [PATCH 5/8] Remove annotation in tests --- .../java/com/stripe/android/paymentsheet/FlowControllerTest.kt | 1 - .../java/com/stripe/android/paymentsheet/PaymentSheetTest.kt | 1 - .../android/paymentsheet/utils/FlowControllerTestFactory.kt | 2 -- .../android/paymentsheet/utils/FlowControllerTestRunner.kt | 2 -- .../android/paymentsheet/utils/PaymentSheetTestFactory.kt | 2 -- .../stripe/android/paymentsheet/utils/PaymentSheetTestRunner.kt | 2 -- 6 files changed, 10 deletions(-) diff --git a/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/FlowControllerTest.kt b/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/FlowControllerTest.kt index 82b8fb48824..2043fb3a4d5 100644 --- a/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/FlowControllerTest.kt +++ b/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/FlowControllerTest.kt @@ -21,7 +21,6 @@ import org.junit.runner.RunWith import java.util.concurrent.CountDownLatch import java.util.concurrent.TimeUnit -@OptIn(ExperimentalPaymentSheetDecouplingApi::class) @RunWith(AndroidJUnit4::class) internal class FlowControllerTest { @get:Rule diff --git a/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/PaymentSheetTest.kt b/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/PaymentSheetTest.kt index fc440efdc6b..cbc66f6c9d1 100644 --- a/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/PaymentSheetTest.kt +++ b/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/PaymentSheetTest.kt @@ -16,7 +16,6 @@ import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith -@OptIn(ExperimentalPaymentSheetDecouplingApi::class) @RunWith(AndroidJUnit4::class) internal class PaymentSheetTest { @get:Rule diff --git a/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/utils/FlowControllerTestFactory.kt b/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/utils/FlowControllerTestFactory.kt index 4fdef9f4b3e..e485d7abaf2 100644 --- a/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/utils/FlowControllerTestFactory.kt +++ b/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/utils/FlowControllerTestFactory.kt @@ -3,13 +3,11 @@ package com.stripe.android.paymentsheet.utils import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import com.stripe.android.paymentsheet.CreateIntentCallback -import com.stripe.android.paymentsheet.ExperimentalPaymentSheetDecouplingApi import com.stripe.android.paymentsheet.PaymentOptionCallback import com.stripe.android.paymentsheet.PaymentSheet import com.stripe.android.paymentsheet.PaymentSheetResultCallback import com.stripe.android.paymentsheet.rememberPaymentSheetFlowController -@OptIn(ExperimentalPaymentSheetDecouplingApi::class) internal class FlowControllerTestFactory( private val integrationType: IntegrationType, private val createIntentCallback: CreateIntentCallback? = null, diff --git a/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/utils/FlowControllerTestRunner.kt b/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/utils/FlowControllerTestRunner.kt index 19f8d7bd178..20eb8dd3cc7 100644 --- a/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/utils/FlowControllerTestRunner.kt +++ b/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/utils/FlowControllerTestRunner.kt @@ -6,7 +6,6 @@ import androidx.test.core.app.ActivityScenario import com.google.common.truth.Truth.assertThat import com.stripe.android.PaymentConfiguration import com.stripe.android.paymentsheet.CreateIntentCallback -import com.stripe.android.paymentsheet.ExperimentalPaymentSheetDecouplingApi import com.stripe.android.paymentsheet.MainActivity import com.stripe.android.paymentsheet.PaymentOptionCallback import com.stripe.android.paymentsheet.PaymentSheet @@ -28,7 +27,6 @@ internal class FlowControllerTestRunnerContext( } } -@OptIn(ExperimentalPaymentSheetDecouplingApi::class) internal fun runFlowControllerTest( createIntentCallback: CreateIntentCallback? = null, paymentOptionCallback: PaymentOptionCallback, diff --git a/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/utils/PaymentSheetTestFactory.kt b/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/utils/PaymentSheetTestFactory.kt index 7f2cfd83bf7..1b65e8b6db7 100644 --- a/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/utils/PaymentSheetTestFactory.kt +++ b/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/utils/PaymentSheetTestFactory.kt @@ -3,12 +3,10 @@ package com.stripe.android.paymentsheet.utils import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import com.stripe.android.paymentsheet.CreateIntentCallback -import com.stripe.android.paymentsheet.ExperimentalPaymentSheetDecouplingApi import com.stripe.android.paymentsheet.PaymentSheet import com.stripe.android.paymentsheet.PaymentSheetResultCallback import com.stripe.android.paymentsheet.rememberPaymentSheet -@OptIn(ExperimentalPaymentSheetDecouplingApi::class) internal class PaymentSheetTestFactory( private val integrationType: IntegrationType, private val createIntentCallback: CreateIntentCallback? = null, diff --git a/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/utils/PaymentSheetTestRunner.kt b/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/utils/PaymentSheetTestRunner.kt index 7924dd6fcaa..22d13e52f5c 100644 --- a/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/utils/PaymentSheetTestRunner.kt +++ b/paymentsheet/src/androidTest/java/com/stripe/android/paymentsheet/utils/PaymentSheetTestRunner.kt @@ -6,7 +6,6 @@ import androidx.test.core.app.ActivityScenario import com.google.common.truth.Truth.assertThat import com.stripe.android.PaymentConfiguration import com.stripe.android.paymentsheet.CreateIntentCallback -import com.stripe.android.paymentsheet.ExperimentalPaymentSheetDecouplingApi import com.stripe.android.paymentsheet.MainActivity import com.stripe.android.paymentsheet.PaymentSheet import com.stripe.android.paymentsheet.PaymentSheetResultCallback @@ -37,7 +36,6 @@ internal class PaymentSheetTestRunnerContext( } } -@OptIn(ExperimentalPaymentSheetDecouplingApi::class) internal fun runPaymentSheetTest( createIntentCallback: CreateIntentCallback? = null, resultCallback: PaymentSheetResultCallback, From 6ecb75c2e4700ef79df917bfe09fb762bfd7814b Mon Sep 17 00:00:00 2001 From: Till Hellmund Date: Wed, 5 Jul 2023 14:49:54 -0400 Subject: [PATCH 6/8] Align changelog with iOS --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a3898602bb..990f7e84cfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## XX.XX.XX - 2023-XX-XX ### PaymentSheet -* [ADDED][6857](https://github.com/stripe/stripe-android/pull/6857) The API for [finalizing payments on the server](https://stripe.com/docs/payments/finalize-payments-on-the-server?platform=android) is now stable. +* [ADDED][6857](https://github.com/stripe/stripe-android/pull/6857) You can now collect payment details before creating a PaymentIntent or SetupIntent. See [our docs](https://stripe.com/docs/payments/accept-a-payment-deferred) for more info. This integration also allows you to [confirm the Intent on the server](https://stripe.com/docs/payments/finalize-payments-on-the-server). ### PaymentSheet * [ADDED][6583](https://github.com/stripe/stripe-android/pull/6583) Added top-level methods `rememberPaymentSheet()` and `rememberPaymentSheetFlowController()` for easier integration in Compose. From 795646d3ad89e0bd827f2a20f6bd91c6e7e47c1b Mon Sep 17 00:00:00 2001 From: Till Hellmund Date: Thu, 6 Jul 2023 10:18:08 -0400 Subject: [PATCH 7/8] Explicitly link to Android docs --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 990f7e84cfb..382ab1694a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## XX.XX.XX - 2023-XX-XX ### PaymentSheet -* [ADDED][6857](https://github.com/stripe/stripe-android/pull/6857) You can now collect payment details before creating a PaymentIntent or SetupIntent. See [our docs](https://stripe.com/docs/payments/accept-a-payment-deferred) for more info. This integration also allows you to [confirm the Intent on the server](https://stripe.com/docs/payments/finalize-payments-on-the-server). +* [ADDED][6857](https://github.com/stripe/stripe-android/pull/6857) You can now collect payment details before creating a PaymentIntent or SetupIntent. See [our docs](https://stripe.com/docs/payments/accept-a-payment-deferred?platform=android) for more info. This integration also allows you to [confirm the Intent on the server](https://stripe.com/docs/payments/finalize-payments-on-the-server?platform=android). ### PaymentSheet * [ADDED][6583](https://github.com/stripe/stripe-android/pull/6583) Added top-level methods `rememberPaymentSheet()` and `rememberPaymentSheetFlowController()` for easier integration in Compose. From 930f65774bc94966bc059e42da68e9b20643296f Mon Sep 17 00:00:00 2001 From: Till Hellmund Date: Thu, 6 Jul 2023 10:57:58 -0400 Subject: [PATCH 8/8] Remove internal `AbsCreateIntentCallback` interface --- paymentsheet/api/paymentsheet.api | 2 +- .../com/stripe/android/paymentsheet/CreateIntentCallback.kt | 6 +----- .../android/paymentsheet/IntentConfirmationInterceptor.kt | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/paymentsheet/api/paymentsheet.api b/paymentsheet/api/paymentsheet.api index 80998ddae97..f3090ffa8c9 100644 --- a/paymentsheet/api/paymentsheet.api +++ b/paymentsheet/api/paymentsheet.api @@ -45,7 +45,7 @@ public final class com/stripe/android/paymentsheet/ComposableSingletons$PaymentO public final fun getLambda-2$paymentsheet_release ()Lkotlin/jvm/functions/Function2; } -public abstract interface class com/stripe/android/paymentsheet/CreateIntentCallback : com/stripe/android/paymentsheet/AbsCreateIntentCallback { +public abstract interface class com/stripe/android/paymentsheet/CreateIntentCallback { public abstract fun onCreateIntent (Lcom/stripe/android/model/PaymentMethod;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; } diff --git a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/CreateIntentCallback.kt b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/CreateIntentCallback.kt index 127f4f580aa..8c30ee85a6d 100644 --- a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/CreateIntentCallback.kt +++ b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/CreateIntentCallback.kt @@ -1,18 +1,14 @@ package com.stripe.android.paymentsheet -import androidx.annotation.RestrictTo import com.stripe.android.model.PaymentIntent import com.stripe.android.model.PaymentMethod import com.stripe.android.model.SetupIntent -@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) -sealed interface AbsCreateIntentCallback - /** * Callback to be used when you use `PaymentSheet` and intend to create and optionally confirm the * [PaymentIntent] or [SetupIntent] on your server. */ -fun interface CreateIntentCallback : AbsCreateIntentCallback { +fun interface CreateIntentCallback { /** * Called when the customer confirms the payment or setup. diff --git a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/IntentConfirmationInterceptor.kt b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/IntentConfirmationInterceptor.kt index e94f49fa9eb..576dd010311 100644 --- a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/IntentConfirmationInterceptor.kt +++ b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/IntentConfirmationInterceptor.kt @@ -75,7 +75,7 @@ internal interface IntentConfirmationInterceptor { ): NextStep companion object { - var createIntentCallback: AbsCreateIntentCallback? = null + var createIntentCallback: CreateIntentCallback? = null const val COMPLETE_WITHOUT_CONFIRMING_INTENT = "COMPLETE_WITHOUT_CONFIRMING_INTENT" }