@stripe/stripe-react-native 0.42.0 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.husky/pre-commit +0 -3
- package/CHANGELOG.md +14 -0
- package/android/.gradle/8.11.1/checksums/checksums.lock +0 -0
- package/android/.gradle/8.11.1/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.11.1/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.11.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/8.11.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
- package/android/.project +0 -11
- package/android/.settings/org.eclipse.buildship.core.prefs +3 -3
- package/android/build.gradle +7 -1
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/android/gradle.properties +4 -1
- package/android/gradlew +249 -0
- package/android/gradlew.bat +92 -0
- package/android/spotless.gradle +19 -0
- package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormView.kt +30 -34
- package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormViewManager.kt +20 -10
- package/android/src/main/java/com/reactnativestripesdk/CardChangedEvent.kt +12 -13
- package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +242 -105
- package/android/src/main/java/com/reactnativestripesdk/CardFieldViewManager.kt +58 -20
- package/android/src/main/java/com/reactnativestripesdk/CardFocusEvent.kt +8 -11
- package/android/src/main/java/com/reactnativestripesdk/CardFormCompleteEvent.kt +10 -12
- package/android/src/main/java/com/reactnativestripesdk/CardFormView.kt +135 -87
- package/android/src/main/java/com/reactnativestripesdk/CardFormViewManager.kt +57 -22
- package/android/src/main/java/com/reactnativestripesdk/CollectBankAccountLauncherFragment.kt +33 -24
- package/android/src/main/java/com/reactnativestripesdk/FinancialConnectionsSheetFragment.kt +107 -85
- package/android/src/main/java/com/reactnativestripesdk/FormCompleteEvent.kt +9 -11
- package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonManager.kt +16 -9
- package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonView.kt +36 -28
- package/android/src/main/java/com/reactnativestripesdk/GooglePayLauncherFragment.kt +67 -43
- package/android/src/main/java/com/reactnativestripesdk/GooglePayPaymentMethodLauncherFragment.kt +21 -16
- package/android/src/main/java/com/reactnativestripesdk/GooglePayRequestHelper.kt +101 -56
- package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +244 -166
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +137 -156
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetAppearance.kt +181 -57
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +402 -258
- package/android/src/main/java/com/reactnativestripesdk/StripeContainerManager.kt +11 -4
- package/android/src/main/java/com/reactnativestripesdk/StripeContainerView.kt +5 -1
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +654 -299
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkPackage.kt +12 -14
- package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressLauncherFragment.kt +42 -37
- package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetEvent.kt +12 -11
- package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetView.kt +29 -29
- package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetViewManager.kt +50 -18
- package/android/src/main/java/com/reactnativestripesdk/customersheet/CustomerSheetFragment.kt +227 -147
- package/android/src/main/java/com/reactnativestripesdk/customersheet/ReactNativeCustomerAdapter.kt +15 -18
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonManager.kt +33 -15
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.kt +63 -37
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletCompleteEvent.kt +9 -13
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/EphemeralKeyProvider.kt +15 -17
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/PushProvisioningProxy.kt +76 -60
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/TapAndPayProxy.kt +71 -47
- package/android/src/main/java/com/reactnativestripesdk/utils/Errors.kt +117 -51
- package/android/src/main/java/com/reactnativestripesdk/utils/Extensions.kt +4 -3
- package/android/src/main/java/com/reactnativestripesdk/utils/KeepJsAwakeTask.kt +39 -0
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +295 -258
- package/android/src/main/java/com/reactnativestripesdk/utils/PostalCodeUtilities.kt +2 -11
- package/ios/CustomerSheet/CustomerSheetUtils.swift +3 -1
- package/ios/FinancialConnections.swift +6 -2
- package/ios/StripeSdk+CustomerSheet.swift +2 -1
- package/ios/StripeSdk+PaymentSheet.swift +42 -0
- package/ios/StripeSdk.m +2 -0
- package/ios/StripeSdk.swift +72 -11
- package/lib/commonjs/NativeStripeSdk.js +1 -1
- package/lib/commonjs/NativeStripeSdk.js.map +1 -1
- package/lib/commonjs/components/AddToWalletButton.js +1 -1
- package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
- package/lib/commonjs/components/AddressSheet.js +1 -1
- package/lib/commonjs/components/AddressSheet.js.map +1 -1
- package/lib/commonjs/components/ApplePayButtonNative.js +1 -1
- package/lib/commonjs/components/ApplePayButtonNative.js.map +1 -1
- package/lib/commonjs/components/AuBECSDebitForm.js +1 -1
- package/lib/commonjs/components/AuBECSDebitForm.js.map +1 -1
- package/lib/commonjs/components/CardField.js +1 -1
- package/lib/commonjs/components/CardField.js.map +1 -1
- package/lib/commonjs/components/CardForm.js +1 -1
- package/lib/commonjs/components/CardForm.js.map +1 -1
- package/lib/commonjs/components/CustomerSheet.js +1 -1
- package/lib/commonjs/components/CustomerSheet.js.map +1 -1
- package/lib/commonjs/components/GooglePayButtonNative.js +1 -1
- package/lib/commonjs/components/GooglePayButtonNative.js.map +1 -1
- package/lib/commonjs/components/PlatformPayButton.js +1 -1
- package/lib/commonjs/components/PlatformPayButton.js.map +1 -1
- package/lib/commonjs/components/StripeContainer.js +1 -1
- package/lib/commonjs/components/StripeContainer.js.map +1 -1
- package/lib/commonjs/components/StripeProvider.js +1 -1
- package/lib/commonjs/components/StripeProvider.js.map +1 -1
- package/lib/commonjs/functions.js +1 -1
- package/lib/commonjs/functions.js.map +1 -1
- package/lib/commonjs/helpers.js +1 -1
- package/lib/commonjs/helpers.js.map +1 -1
- package/lib/commonjs/hooks/useConfirmPayment.js.map +1 -1
- package/lib/commonjs/hooks/useConfirmSetupIntent.js.map +1 -1
- package/lib/commonjs/hooks/useFinancialConnectionsSheet.js.map +1 -1
- package/lib/commonjs/hooks/usePaymentSheet.js.map +1 -1
- package/lib/commonjs/hooks/usePlatformPay.js.map +1 -1
- package/lib/commonjs/hooks/useStripe.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/plugin/withStripe.js +1 -1
- package/lib/commonjs/plugin/withStripe.js.map +1 -1
- package/lib/commonjs/types/ApplePay.js.map +1 -1
- package/lib/commonjs/types/Common.js +1 -1
- package/lib/commonjs/types/Common.js.map +1 -1
- package/lib/commonjs/types/CustomerSheet.js.map +1 -1
- package/lib/commonjs/types/Errors.js +1 -1
- package/lib/commonjs/types/Errors.js.map +1 -1
- package/lib/commonjs/types/FinancialConnections.js +1 -1
- package/lib/commonjs/types/FinancialConnections.js.map +1 -1
- package/lib/commonjs/types/NextAction.js.map +1 -1
- package/lib/commonjs/types/PaymentIntent.js +1 -1
- package/lib/commonjs/types/PaymentIntent.js.map +1 -1
- package/lib/commonjs/types/PaymentMethod.js.map +1 -1
- package/lib/commonjs/types/PaymentSheet.js +1 -1
- package/lib/commonjs/types/PaymentSheet.js.map +1 -1
- package/lib/commonjs/types/PlatformPay.js +1 -1
- package/lib/commonjs/types/PlatformPay.js.map +1 -1
- package/lib/commonjs/types/PushProvisioning.js +1 -1
- package/lib/commonjs/types/PushProvisioning.js.map +1 -1
- package/lib/commonjs/types/SetupIntent.js +1 -1
- package/lib/commonjs/types/SetupIntent.js.map +1 -1
- package/lib/commonjs/types/ThreeDSecure.js +1 -1
- package/lib/commonjs/types/ThreeDSecure.js.map +1 -1
- package/lib/commonjs/types/Token.js.map +1 -1
- package/lib/commonjs/types/components/ApplePayButtonComponent.js.map +1 -1
- package/lib/commonjs/types/components/AuBECSDebitFormComponent.js.map +1 -1
- package/lib/commonjs/types/components/CardFieldInput.js +1 -1
- package/lib/commonjs/types/components/CardFieldInput.js.map +1 -1
- package/lib/commonjs/types/components/CardFormView.js.map +1 -1
- package/lib/commonjs/types/components/GooglePayButtonComponent.js.map +1 -1
- package/lib/commonjs/types/index.js +1 -1
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/module/NativeStripeSdk.js +1 -1
- package/lib/module/NativeStripeSdk.js.map +1 -1
- package/lib/module/components/AddToWalletButton.js +1 -1
- package/lib/module/components/AddToWalletButton.js.map +1 -1
- package/lib/module/components/AddressSheet.js +1 -1
- package/lib/module/components/AddressSheet.js.map +1 -1
- package/lib/module/components/ApplePayButtonNative.js +1 -1
- package/lib/module/components/ApplePayButtonNative.js.map +1 -1
- package/lib/module/components/AuBECSDebitForm.js +1 -1
- package/lib/module/components/AuBECSDebitForm.js.map +1 -1
- package/lib/module/components/CardField.js +1 -1
- package/lib/module/components/CardField.js.map +1 -1
- package/lib/module/components/CardForm.js +1 -1
- package/lib/module/components/CardForm.js.map +1 -1
- package/lib/module/components/CustomerSheet.js +1 -1
- package/lib/module/components/CustomerSheet.js.map +1 -1
- package/lib/module/components/GooglePayButtonNative.js +1 -1
- package/lib/module/components/GooglePayButtonNative.js.map +1 -1
- package/lib/module/components/PlatformPayButton.js +1 -1
- package/lib/module/components/PlatformPayButton.js.map +1 -1
- package/lib/module/components/StripeContainer.js +1 -1
- package/lib/module/components/StripeContainer.js.map +1 -1
- package/lib/module/components/StripeProvider.js +1 -1
- package/lib/module/components/StripeProvider.js.map +1 -1
- package/lib/module/functions.js +1 -1
- package/lib/module/functions.js.map +1 -1
- package/lib/module/helpers.js +1 -1
- package/lib/module/helpers.js.map +1 -1
- package/lib/module/hooks/useConfirmPayment.js.map +1 -1
- package/lib/module/hooks/useConfirmSetupIntent.js.map +1 -1
- package/lib/module/hooks/useFinancialConnectionsSheet.js.map +1 -1
- package/lib/module/hooks/usePaymentSheet.js.map +1 -1
- package/lib/module/hooks/usePlatformPay.js.map +1 -1
- package/lib/module/hooks/useStripe.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/package.json +1 -0
- package/lib/module/plugin/withStripe.js +1 -1
- package/lib/module/plugin/withStripe.js.map +1 -1
- package/lib/module/types/ApplePay.js.map +1 -1
- package/lib/module/types/Common.js +1 -1
- package/lib/module/types/Common.js.map +1 -1
- package/lib/module/types/CustomerSheet.js.map +1 -1
- package/lib/module/types/Errors.js +1 -1
- package/lib/module/types/Errors.js.map +1 -1
- package/lib/module/types/FinancialConnections.js +1 -1
- package/lib/module/types/FinancialConnections.js.map +1 -1
- package/lib/module/types/NextAction.js.map +1 -1
- package/lib/module/types/PaymentIntent.js +1 -1
- package/lib/module/types/PaymentIntent.js.map +1 -1
- package/lib/module/types/PaymentMethod.js.map +1 -1
- package/lib/module/types/PaymentSheet.js +1 -1
- package/lib/module/types/PaymentSheet.js.map +1 -1
- package/lib/module/types/PlatformPay.js +1 -1
- package/lib/module/types/PlatformPay.js.map +1 -1
- package/lib/module/types/PushProvisioning.js +1 -1
- package/lib/module/types/PushProvisioning.js.map +1 -1
- package/lib/module/types/SetupIntent.js +1 -1
- package/lib/module/types/SetupIntent.js.map +1 -1
- package/lib/module/types/ThreeDSecure.js +1 -1
- package/lib/module/types/ThreeDSecure.js.map +1 -1
- package/lib/module/types/Token.js.map +1 -1
- package/lib/module/types/components/ApplePayButtonComponent.js.map +1 -1
- package/lib/module/types/components/AuBECSDebitFormComponent.js.map +1 -1
- package/lib/module/types/components/CardFieldInput.js +1 -1
- package/lib/module/types/components/CardFieldInput.js.map +1 -1
- package/lib/module/types/components/CardFormView.js.map +1 -1
- package/lib/module/types/components/GooglePayButtonComponent.js.map +1 -1
- package/lib/module/types/index.js +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/typescript/src/NativeStripeSdk.d.ts +4 -3
- package/lib/typescript/src/NativeStripeSdk.d.ts.map +1 -0
- package/lib/typescript/src/components/AddToWalletButton.d.ts +3 -1
- package/lib/typescript/src/components/AddToWalletButton.d.ts.map +1 -0
- package/lib/typescript/src/components/AddressSheet.d.ts +4 -2
- package/lib/typescript/src/components/AddressSheet.d.ts.map +1 -0
- package/lib/typescript/src/components/ApplePayButtonNative.d.ts +1 -0
- package/lib/typescript/src/components/ApplePayButtonNative.d.ts.map +1 -0
- package/lib/typescript/src/components/AuBECSDebitForm.d.ts +3 -1
- package/lib/typescript/src/components/AuBECSDebitForm.d.ts.map +1 -0
- package/lib/typescript/src/components/CardField.d.ts +1 -0
- package/lib/typescript/src/components/CardField.d.ts.map +1 -0
- package/lib/typescript/src/components/CardForm.d.ts +1 -0
- package/lib/typescript/src/components/CardForm.d.ts.map +1 -0
- package/lib/typescript/src/components/CustomerSheet.d.ts +2 -1
- package/lib/typescript/src/components/CustomerSheet.d.ts.map +1 -0
- package/lib/typescript/src/components/GooglePayButtonNative.d.ts +1 -0
- package/lib/typescript/src/components/GooglePayButtonNative.d.ts.map +1 -0
- package/lib/typescript/src/components/PlatformPayButton.d.ts +3 -1
- package/lib/typescript/src/components/PlatformPayButton.d.ts.map +1 -0
- package/lib/typescript/src/components/StripeContainer.d.ts +2 -1
- package/lib/typescript/src/components/StripeContainer.d.ts.map +1 -0
- package/lib/typescript/src/components/StripeProvider.d.ts +3 -2
- package/lib/typescript/src/components/StripeProvider.d.ts.map +1 -0
- package/lib/typescript/src/functions.d.ts +6 -5
- package/lib/typescript/src/functions.d.ts.map +1 -0
- package/lib/typescript/src/helpers.d.ts +1 -0
- package/lib/typescript/src/helpers.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useConfirmPayment.d.ts +2 -1
- package/lib/typescript/src/hooks/useConfirmPayment.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useConfirmSetupIntent.d.ts +1 -0
- package/lib/typescript/src/hooks/useConfirmSetupIntent.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useFinancialConnectionsSheet.d.ts +3 -2
- package/lib/typescript/src/hooks/useFinancialConnectionsSheet.d.ts.map +1 -0
- package/lib/typescript/src/hooks/usePaymentSheet.d.ts +2 -1
- package/lib/typescript/src/hooks/usePaymentSheet.d.ts.map +1 -0
- package/lib/typescript/src/hooks/usePlatformPay.d.ts +4 -3
- package/lib/typescript/src/hooks/usePlatformPay.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useStripe.d.ts +11 -8
- package/lib/typescript/src/hooks/useStripe.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/plugin/withStripe.d.ts +2 -1
- package/lib/typescript/src/plugin/withStripe.d.ts.map +1 -0
- package/lib/typescript/src/types/ApplePay.d.ts +6 -5
- package/lib/typescript/src/types/ApplePay.d.ts.map +1 -0
- package/lib/typescript/src/types/Common.d.ts +4 -1
- package/lib/typescript/src/types/Common.d.ts.map +1 -0
- package/lib/typescript/src/types/CustomerSheet.d.ts +12 -4
- package/lib/typescript/src/types/CustomerSheet.d.ts.map +1 -0
- package/lib/typescript/src/types/Errors.d.ts +2 -1
- package/lib/typescript/src/types/Errors.d.ts.map +1 -0
- package/lib/typescript/src/types/FinancialConnections.d.ts +21 -17
- package/lib/typescript/src/types/FinancialConnections.d.ts.map +1 -0
- package/lib/typescript/src/types/NextAction.d.ts +9 -8
- package/lib/typescript/src/types/NextAction.d.ts.map +1 -0
- package/lib/typescript/src/types/PaymentIntent.d.ts +16 -15
- package/lib/typescript/src/types/PaymentIntent.d.ts.map +1 -0
- package/lib/typescript/src/types/PaymentMethod.d.ts +21 -16
- package/lib/typescript/src/types/PaymentMethod.d.ts.map +1 -0
- package/lib/typescript/src/types/PaymentSheet.d.ts +72 -22
- package/lib/typescript/src/types/PaymentSheet.d.ts.map +1 -0
- package/lib/typescript/src/types/PlatformPay.d.ts +22 -21
- package/lib/typescript/src/types/PlatformPay.d.ts.map +1 -0
- package/lib/typescript/src/types/PushProvisioning.d.ts +5 -4
- package/lib/typescript/src/types/PushProvisioning.d.ts.map +1 -0
- package/lib/typescript/src/types/SetupIntent.d.ts +4 -3
- package/lib/typescript/src/types/SetupIntent.d.ts.map +1 -0
- package/lib/typescript/src/types/ThreeDSecure.d.ts +1 -0
- package/lib/typescript/src/types/ThreeDSecure.d.ts.map +1 -0
- package/lib/typescript/src/types/Token.d.ts +10 -9
- package/lib/typescript/src/types/Token.d.ts.map +1 -0
- package/lib/typescript/src/types/components/ApplePayButtonComponent.d.ts +3 -2
- package/lib/typescript/src/types/components/ApplePayButtonComponent.d.ts.map +1 -0
- package/lib/typescript/src/types/components/AuBECSDebitFormComponent.d.ts +1 -0
- package/lib/typescript/src/types/components/AuBECSDebitFormComponent.d.ts.map +1 -0
- package/lib/typescript/src/types/components/CardFieldInput.d.ts +8 -5
- package/lib/typescript/src/types/components/CardFieldInput.d.ts.map +1 -0
- package/lib/typescript/src/types/components/CardFormView.d.ts +9 -6
- package/lib/typescript/src/types/components/CardFormView.d.ts.map +1 -0
- package/lib/typescript/src/types/components/GooglePayButtonComponent.d.ts +1 -0
- package/lib/typescript/src/types/components/GooglePayButtonComponent.d.ts.map +1 -0
- package/lib/typescript/src/types/index.d.ts +24 -23
- package/lib/typescript/src/types/index.d.ts.map +1 -0
- package/package.json +32 -40
- package/src/NativeStripeSdk.tsx +4 -2
- package/src/components/CardField.tsx +1 -1
- package/src/components/CardForm.tsx +12 -9
- package/src/components/CustomerSheet.tsx +4 -6
- package/src/components/StripeProvider.tsx +17 -0
- package/src/functions.ts +13 -14
- package/src/types/Common.ts +3 -0
- package/src/types/CustomerSheet.ts +7 -0
- package/src/types/FinancialConnections.ts +3 -0
- package/src/types/PaymentMethod.ts +5 -1
- package/src/types/PaymentSheet.ts +64 -4
- package/src/types/components/CardFieldInput.ts +8 -4
- package/src/types/components/CardFormView.ts +8 -4
- package/stripe-react-native.podspec +2 -1
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/gc.properties +0 -0
- /package/android/.gradle/{8.9 → 8.11.1}/fileChanges/last-build.bin +0 -0
- /package/android/.gradle/{8.9/dependencies-accessors → 8.11.1}/gc.properties +0 -0
package/src/functions.ts
CHANGED
|
@@ -121,9 +121,8 @@ export const retrieveSetupIntent = async (
|
|
|
121
121
|
clientSecret: string
|
|
122
122
|
): Promise<RetrieveSetupIntentResult> => {
|
|
123
123
|
try {
|
|
124
|
-
const { setupIntent, error } =
|
|
125
|
-
clientSecret
|
|
126
|
-
);
|
|
124
|
+
const { setupIntent, error } =
|
|
125
|
+
await NativeStripeSdk.retrieveSetupIntent(clientSecret);
|
|
127
126
|
if (error) {
|
|
128
127
|
return {
|
|
129
128
|
error,
|
|
@@ -271,9 +270,8 @@ export const createTokenForCVCUpdate = async (
|
|
|
271
270
|
cvc: string
|
|
272
271
|
): Promise<CreateTokenForCVCUpdateResult> => {
|
|
273
272
|
try {
|
|
274
|
-
const { tokenId, error } =
|
|
275
|
-
cvc
|
|
276
|
-
);
|
|
273
|
+
const { tokenId, error } =
|
|
274
|
+
await NativeStripeSdk.createTokenForCVCUpdate(cvc);
|
|
277
275
|
if (error) {
|
|
278
276
|
return {
|
|
279
277
|
error,
|
|
@@ -423,9 +421,8 @@ export const presentPaymentSheet = async (
|
|
|
423
421
|
options: PaymentSheet.PresentOptions = {}
|
|
424
422
|
): Promise<PresentPaymentSheetResult> => {
|
|
425
423
|
try {
|
|
426
|
-
const { paymentOption, error } =
|
|
427
|
-
options
|
|
428
|
-
);
|
|
424
|
+
const { paymentOption, error } =
|
|
425
|
+
await NativeStripeSdk.presentPaymentSheet(options);
|
|
429
426
|
if (error) {
|
|
430
427
|
return {
|
|
431
428
|
error,
|
|
@@ -565,7 +562,7 @@ export const collectBankAccountToken = async (
|
|
|
565
562
|
|
|
566
563
|
try {
|
|
567
564
|
const { session, token, error } =
|
|
568
|
-
await NativeStripeSdk.collectBankAccountToken(clientSecret);
|
|
565
|
+
await NativeStripeSdk.collectBankAccountToken(clientSecret, params);
|
|
569
566
|
|
|
570
567
|
financialConnectionsEventListener?.remove();
|
|
571
568
|
|
|
@@ -608,7 +605,10 @@ export const collectFinancialConnectionsAccounts = async (
|
|
|
608
605
|
|
|
609
606
|
try {
|
|
610
607
|
const { session, error } =
|
|
611
|
-
await NativeStripeSdk.collectFinancialConnectionsAccounts(
|
|
608
|
+
await NativeStripeSdk.collectFinancialConnectionsAccounts(
|
|
609
|
+
clientSecret,
|
|
610
|
+
params
|
|
611
|
+
);
|
|
612
612
|
|
|
613
613
|
financialConnectionsEventListener?.remove();
|
|
614
614
|
|
|
@@ -662,9 +662,8 @@ export const isCardInWallet = async (params: {
|
|
|
662
662
|
cardLastFour: string;
|
|
663
663
|
}): Promise<IsCardInWalletResult> => {
|
|
664
664
|
try {
|
|
665
|
-
const { isInWallet, token, error } =
|
|
666
|
-
params
|
|
667
|
-
);
|
|
665
|
+
const { isInWallet, token, error } =
|
|
666
|
+
await NativeStripeSdk.isCardInWallet(params);
|
|
668
667
|
|
|
669
668
|
if (error) {
|
|
670
669
|
return {
|
package/src/types/Common.ts
CHANGED
|
@@ -47,6 +47,13 @@ export type CustomerSheetInitParams = {
|
|
|
47
47
|
* If false, the customer can't delete if they only have one saved payment method remaining.
|
|
48
48
|
*/
|
|
49
49
|
allowsRemovalOfLastSavedPaymentMethod?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* By default, CustomerSheet will accept all supported cards by Stripe.
|
|
52
|
+
* You can specify card brands CustomerSheet should block or allow payment for by providing an array of those card brands.
|
|
53
|
+
* Note: This is only a client-side solution.
|
|
54
|
+
* Note: Card brand filtering is not currently supported in Link.
|
|
55
|
+
*/
|
|
56
|
+
cardBrandAcceptance?: PaymentSheet.CardBrandAcceptance;
|
|
50
57
|
};
|
|
51
58
|
|
|
52
59
|
export type CustomerSheetPresentParams = {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import type { UserInterfaceStyle } from './Common';
|
|
1
2
|
import type { BankAccount } from './Token';
|
|
2
3
|
import type { StripeError } from './Errors';
|
|
3
4
|
|
|
4
5
|
export type CollectFinancialConnectionsAccountsParams = {
|
|
6
|
+
/** iOS Only. Style options for colors in Financial Connections. By default, the bank account collector will automatically switch between light and dark mode compatible colors based on device settings. */
|
|
7
|
+
style?: UserInterfaceStyle;
|
|
5
8
|
/** An optional event listener to receive @type {FinancialConnectionEvent} for specific events during the process of a user connecting their financial accounts. */
|
|
6
9
|
onEvent?: (event: FinancialConnectionsEvent) => void;
|
|
7
10
|
};
|
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
BankAcccountType,
|
|
6
6
|
} from './Token';
|
|
7
7
|
import type { FutureUsage } from './PaymentIntent';
|
|
8
|
-
import type { Address, BillingDetails } from './Common';
|
|
8
|
+
import type { Address, BillingDetails, UserInterfaceStyle } from './Common';
|
|
9
9
|
import type { FinancialConnectionsEvent } from './FinancialConnections';
|
|
10
10
|
|
|
11
11
|
export interface Result {
|
|
@@ -314,11 +314,15 @@ export type CollectBankAccountParams = {
|
|
|
314
314
|
email?: string;
|
|
315
315
|
};
|
|
316
316
|
};
|
|
317
|
+
/** iOS only. Style options for colors in Financial Connections. By default, the bank account collector will automatically switch between light and dark mode compatible colors based on device settings. */
|
|
318
|
+
style?: UserInterfaceStyle;
|
|
317
319
|
/** An optional event listener to receive @type {FinancialConnectionEvent} for specific events during the process of a user connecting their financial accounts. */
|
|
318
320
|
onEvent?: (event: FinancialConnectionsEvent) => void;
|
|
319
321
|
};
|
|
320
322
|
|
|
321
323
|
export type CollectBankAccountTokenParams = {
|
|
324
|
+
/** iOS only. Style options for colors in Financial Connections. By default, the bank account collector will automatically switch between light and dark mode compatible colors based on device settings. */
|
|
325
|
+
style?: UserInterfaceStyle;
|
|
322
326
|
/** An optional event listener to receive @type {FinancialConnectionEvent} for specific events during the process of a user connecting their financial accounts. */
|
|
323
327
|
onEvent?: (event: FinancialConnectionsEvent) => void;
|
|
324
328
|
};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
BillingDetails,
|
|
3
|
+
AddressDetails,
|
|
4
|
+
CardBrand,
|
|
5
|
+
UserInterfaceStyle,
|
|
6
|
+
} from './Common';
|
|
2
7
|
import type { CartSummaryItem } from './ApplePay';
|
|
3
8
|
import type {
|
|
4
9
|
ButtonType,
|
|
@@ -23,7 +28,7 @@ export type SetupParamsBase = IntentParams & {
|
|
|
23
28
|
/** Android only. Enable Google Pay in the Payment Sheet by passing a GooglePayParams object. */
|
|
24
29
|
googlePay?: GooglePayParams;
|
|
25
30
|
/** The color styling to use for PaymentSheet UI. Defaults to 'automatic'. */
|
|
26
|
-
style?:
|
|
31
|
+
style?: UserInterfaceStyle;
|
|
27
32
|
/** A URL that redirects back to your app that PaymentSheet can use to auto-dismiss web views used for additional authentication, e.g. 3DS2 */
|
|
28
33
|
returnURL?: string;
|
|
29
34
|
/** Configuration for how billing details are collected during checkout. */
|
|
@@ -70,6 +75,13 @@ export type SetupParamsBase = IntentParams & {
|
|
|
70
75
|
* - Note: Defaults to `Automatic` if not set
|
|
71
76
|
*/
|
|
72
77
|
paymentMethodLayout?: PaymentMethodLayout;
|
|
78
|
+
/**
|
|
79
|
+
* By default, PaymentSheet will accept all supported cards by Stripe.
|
|
80
|
+
* You can specify card brands PaymentSheet should block or allow payment for by providing an array of those card brands.
|
|
81
|
+
* Note: This is only a client-side solution.
|
|
82
|
+
* Note: Card brand filtering is not currently supported in Link.
|
|
83
|
+
*/
|
|
84
|
+
cardBrandAcceptance?: CardBrandAcceptance;
|
|
73
85
|
};
|
|
74
86
|
|
|
75
87
|
export type SetupParams =
|
|
@@ -303,8 +315,8 @@ type RecursivePartial<T> = {
|
|
|
303
315
|
[P in keyof T]?: T[P] extends (infer U)[]
|
|
304
316
|
? RecursivePartial<U>[]
|
|
305
317
|
: T[P] extends object
|
|
306
|
-
|
|
307
|
-
|
|
318
|
+
? RecursivePartial<T[P]>
|
|
319
|
+
: T[P];
|
|
308
320
|
};
|
|
309
321
|
export interface PaymentOption {
|
|
310
322
|
label: string;
|
|
@@ -441,3 +453,51 @@ export enum PaymentMethodLayout {
|
|
|
441
453
|
*/
|
|
442
454
|
Automatic = 'Automatic',
|
|
443
455
|
}
|
|
456
|
+
|
|
457
|
+
/** Card brand categories that can be allowed or disallowed */
|
|
458
|
+
export enum CardBrandCategory {
|
|
459
|
+
/** Visa branded cards */
|
|
460
|
+
Visa = 'visa',
|
|
461
|
+
/** Mastercard branded cards */
|
|
462
|
+
Mastercard = 'mastercard',
|
|
463
|
+
/** American Express branded cards */
|
|
464
|
+
Amex = 'amex',
|
|
465
|
+
/**
|
|
466
|
+
* Discover branded cards
|
|
467
|
+
* Note: Encompasses all of Discover Global Network (Discover, Diners, JCB, UnionPay, Elo)
|
|
468
|
+
*/
|
|
469
|
+
Discover = 'discover',
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/** Filter types for card brand acceptance */
|
|
473
|
+
export enum CardBrandAcceptanceFilter {
|
|
474
|
+
/** Accept all card brands supported by Stripe */
|
|
475
|
+
All = 'all',
|
|
476
|
+
/** Accept only the specified card brands */
|
|
477
|
+
Allowed = 'allowed',
|
|
478
|
+
/** Accept all card brands except the specified ones */
|
|
479
|
+
Disallowed = 'disallowed',
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/** Options to block certain card brands on the client */
|
|
483
|
+
export type CardBrandAcceptance =
|
|
484
|
+
| {
|
|
485
|
+
/** Accept all card brands supported by Stripe */
|
|
486
|
+
filter: CardBrandAcceptanceFilter.All;
|
|
487
|
+
}
|
|
488
|
+
| {
|
|
489
|
+
/** Accept only the specified card brands */
|
|
490
|
+
filter: CardBrandAcceptanceFilter.Allowed;
|
|
491
|
+
/** List of card brands to accept
|
|
492
|
+
* Note: Any card brands that do not map to a CardBrandCategory will be blocked when using an allow list
|
|
493
|
+
*/
|
|
494
|
+
brands: CardBrandCategory[];
|
|
495
|
+
}
|
|
496
|
+
| {
|
|
497
|
+
/** Accept all card brands except the specified ones */
|
|
498
|
+
filter: CardBrandAcceptanceFilter.Disallowed;
|
|
499
|
+
/** List of card brands to block
|
|
500
|
+
* Note: Any card brands that do not map to a CardBrandCategory will be accepted when using a disallow list
|
|
501
|
+
*/
|
|
502
|
+
brands: CardBrandCategory[];
|
|
503
|
+
};
|
|
@@ -51,6 +51,12 @@ export interface Placeholders {
|
|
|
51
51
|
postalCode?: string;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
export type OnFocusChangeEvent = NativeSyntheticEvent<{
|
|
55
|
+
focusedField: FieldName | null;
|
|
56
|
+
}>;
|
|
57
|
+
|
|
58
|
+
export type OnCardChangeEvent = NativeSyntheticEvent<Details>;
|
|
59
|
+
|
|
54
60
|
/**
|
|
55
61
|
* @ignore
|
|
56
62
|
*/
|
|
@@ -60,10 +66,8 @@ export interface NativeProps {
|
|
|
60
66
|
postalCodeEnabled?: boolean;
|
|
61
67
|
autofocus?: boolean;
|
|
62
68
|
countryCode: string | null;
|
|
63
|
-
onCardChange(event:
|
|
64
|
-
onFocusChange(
|
|
65
|
-
event: NativeSyntheticEvent<{ focusedField: FieldName | null }>
|
|
66
|
-
): void;
|
|
69
|
+
onCardChange(event: OnCardChangeEvent): void;
|
|
70
|
+
onFocusChange(event: OnFocusChangeEvent): void;
|
|
67
71
|
cardStyle?: Styles;
|
|
68
72
|
placeholders?: Placeholders;
|
|
69
73
|
disabled?: boolean;
|
|
@@ -49,6 +49,12 @@ export type DefaultValues = {
|
|
|
49
49
|
countryCode?: string;
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
+
export type OnFocusChangeEvent = NativeSyntheticEvent<{
|
|
53
|
+
focusedField: FieldName | null;
|
|
54
|
+
}>;
|
|
55
|
+
|
|
56
|
+
export type OnFormCompleteEvent = NativeSyntheticEvent<Details>;
|
|
57
|
+
|
|
52
58
|
/**
|
|
53
59
|
* @ignore
|
|
54
60
|
*/
|
|
@@ -61,10 +67,8 @@ export interface NativeProps {
|
|
|
61
67
|
/** Android only */
|
|
62
68
|
defaultValues?: DefaultValues;
|
|
63
69
|
// postalCodeEnabled: boolean;
|
|
64
|
-
onFocusChange(
|
|
65
|
-
|
|
66
|
-
): void;
|
|
67
|
-
onFormComplete(event: NativeSyntheticEvent<Details>): void;
|
|
70
|
+
onFocusChange(event: OnFocusChangeEvent): void;
|
|
71
|
+
onFormComplete(event: OnFormCompleteEvent): void;
|
|
68
72
|
disabled?: boolean;
|
|
69
73
|
}
|
|
70
74
|
|
|
@@ -2,7 +2,7 @@ require 'json'
|
|
|
2
2
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
4
|
# Keep stripe_version in sync with https://github.com/stripe/stripe-identity-react-native/blob/main/stripe-identity-react-native.podspec
|
|
5
|
-
stripe_version = '~> 24.
|
|
5
|
+
stripe_version = '~> 24.7.0'
|
|
6
6
|
|
|
7
7
|
Pod::Spec.new do |s|
|
|
8
8
|
s.name = 'stripe-react-native'
|
|
@@ -19,6 +19,7 @@ Pod::Spec.new do |s|
|
|
|
19
19
|
s.exclude_files = 'ios/Tests/'
|
|
20
20
|
|
|
21
21
|
s.test_spec 'Tests' do |test_spec|
|
|
22
|
+
test_spec.platforms = { ios: '15.1' }
|
|
22
23
|
test_spec.source_files = 'ios/Tests/**/*.{m,swift}'
|
|
23
24
|
end
|
|
24
25
|
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|