diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentSheetFragment.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentSheetFragment.kt index b1c08bbe..a49ff6e4 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentSheetFragment.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/PaymentSheetFragment.kt @@ -70,7 +70,7 @@ class PaymentSheetFragment( val billingDetailsBundle = arguments?.getBundle("defaultBillingDetails") val billingConfigParams = arguments?.getBundle("billingDetailsCollectionConfiguration") val paymentMethodOrder = arguments?.getStringArrayList("paymentMethodOrder") - val allowsRemovalOfLastSavedPaymentMethod = arguments?.getBoolean("allowsRemovalOfLastSavedPaymentMethod") + val allowsRemovalOfLastSavedPaymentMethod = arguments?.getBoolean("allowsRemovalOfLastSavedPaymentMethod", true) ?: true paymentIntentClientSecret = arguments?.getString("paymentIntentClientSecret").orEmpty() setupIntentClientSecret = arguments?.getString("setupIntentClientSecret").orEmpty() intentConfiguration = try { @@ -201,7 +201,7 @@ class PaymentSheetFragment( .shippingDetails(shippingDetails) .billingDetailsCollectionConfiguration(billingDetailsConfig) .preferredNetworks(mapToPreferredNetworks(arguments?.getIntegerArrayList("preferredNetworks"))) - .allowsRemovalOfLastSavedPaymentMethod(allowsRemovalOfLastSavedPaymentMethod ?: true) + .allowsRemovalOfLastSavedPaymentMethod(allowsRemovalOfLastSavedPaymentMethod) primaryButtonLabel?.let { configurationBuilder.primaryButtonLabel(it) } diff --git a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/customersheet/CustomerSheetFragment.kt b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/customersheet/CustomerSheetFragment.kt index 0347a4c8..0e1fdf74 100644 --- a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/customersheet/CustomerSheetFragment.kt +++ b/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/customersheet/CustomerSheetFragment.kt @@ -68,7 +68,7 @@ class CustomerSheetFragment : Fragment() { val customerId = arguments?.getString("customerId") val customerEphemeralKeySecret = arguments?.getString("customerEphemeralKeySecret") val customerAdapterOverrideParams = arguments?.getBundle("customerAdapter") - val allowsRemovalOfLastSavedPaymentMethod = arguments?.getBoolean("allowsRemovalOfLastSavedPaymentMethod") + val allowsRemovalOfLastSavedPaymentMethod = arguments?.getBoolean("allowsRemovalOfLastSavedPaymentMethod", true) ?: true val paymentMethodOrder = arguments?.getStringArrayList("paymentMethodOrder") if (customerId == null) { initPromise.resolve(createError(ErrorType.Failed.toString(), "You must provide a value for `customerId`")) @@ -91,7 +91,7 @@ class CustomerSheetFragment : Fragment() { .googlePayEnabled(googlePayEnabled) .headerTextForSelectionScreen(headerTextForSelectionScreen) .preferredNetworks(mapToPreferredNetworks(arguments?.getIntegerArrayList("preferredNetworks"))) - .allowsRemovalOfLastSavedPaymentMethod(allowsRemovalOfLastSavedPaymentMethod ?: true) + .allowsRemovalOfLastSavedPaymentMethod(allowsRemovalOfLastSavedPaymentMethod) paymentMethodOrder?.let { configuration.paymentMethodOrder(it)