@stripe/stripe-react-native 0.42.0 → 0.44.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 +26 -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 +8 -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 +422 -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 +656 -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 +13 -7
- package/ios/FinancialConnections.swift +6 -2
- package/ios/StripeSdk+CustomerSheet.swift +3 -1
- package/ios/StripeSdk+PaymentSheet.swift +86 -21
- 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 +16 -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 +91 -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/helpers.ts +2 -1
- package/src/types/Common.ts +3 -0
- package/src/types/CustomerSheet.ts +11 -0
- package/src/types/FinancialConnections.ts +3 -0
- package/src/types/PaymentMethod.ts +5 -1
- package/src/types/PaymentSheet.ts +85 -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
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
package com.reactnativestripesdk.utils
|
|
2
2
|
|
|
3
3
|
class PostalCodeUtilities {
|
|
4
|
-
|
|
5
4
|
companion object {
|
|
6
|
-
internal fun isValidGlobalPostalCodeCharacter(c: Char): Boolean
|
|
7
|
-
return Character.isLetterOrDigit(c)
|
|
8
|
-
|| c.isWhitespace()
|
|
9
|
-
|| c == '-'
|
|
10
|
-
}
|
|
5
|
+
internal fun isValidGlobalPostalCodeCharacter(c: Char): Boolean = Character.isLetterOrDigit(c) || c.isWhitespace() || c == '-'
|
|
11
6
|
|
|
12
|
-
internal fun isValidUsPostalCodeCharacter(c: Char): Boolean
|
|
13
|
-
return Character.isDigit(c)
|
|
14
|
-
|| c.isWhitespace()
|
|
15
|
-
|| c == '-'
|
|
16
|
-
}
|
|
7
|
+
internal fun isValidUsPostalCodeCharacter(c: Char): Boolean = Character.isDigit(c) || c.isWhitespace() || c == '-'
|
|
17
8
|
}
|
|
18
9
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
9
|
-
@_spi(PrivateBetaCustomerSheet) @_spi(STP) import StripePaymentSheet
|
|
9
|
+
@_spi(PrivateBetaCustomerSheet) @_spi(STP) @_spi(UpdatePaymentMethodBeta) import StripePaymentSheet
|
|
10
10
|
|
|
11
11
|
class CustomerSheetUtils {
|
|
12
12
|
internal class func buildCustomerSheetConfiguration(
|
|
@@ -20,7 +20,9 @@ class CustomerSheetUtils {
|
|
|
20
20
|
billingDetailsCollectionConfiguration: NSDictionary?,
|
|
21
21
|
defaultBillingDetails: NSDictionary?,
|
|
22
22
|
preferredNetworks: Array<Int>?,
|
|
23
|
-
allowsRemovalOfLastSavedPaymentMethod: Bool
|
|
23
|
+
allowsRemovalOfLastSavedPaymentMethod: Bool?,
|
|
24
|
+
updatePaymentMethodEnabled: Bool?,
|
|
25
|
+
cardBrandAcceptance: PaymentSheet.CardBrandAcceptance
|
|
24
26
|
) -> CustomerSheet.Configuration {
|
|
25
27
|
var config = CustomerSheet.Configuration()
|
|
26
28
|
config.appearance = appearance
|
|
@@ -58,9 +60,13 @@ class CustomerSheetUtils {
|
|
|
58
60
|
if let allowsRemovalOfLastSavedPaymentMethod = allowsRemovalOfLastSavedPaymentMethod {
|
|
59
61
|
config.allowsRemovalOfLastSavedPaymentMethod = allowsRemovalOfLastSavedPaymentMethod
|
|
60
62
|
}
|
|
63
|
+
if let updatePaymentMethodEnabled = updatePaymentMethodEnabled {
|
|
64
|
+
config.updatePaymentMethodEnabled = updatePaymentMethodEnabled
|
|
65
|
+
}
|
|
66
|
+
config.cardBrandAcceptance = cardBrandAcceptance
|
|
61
67
|
return config
|
|
62
68
|
}
|
|
63
|
-
|
|
69
|
+
|
|
64
70
|
internal class func buildStripeCustomerAdapter(
|
|
65
71
|
customerId: String,
|
|
66
72
|
ephemeralKeySecret: String,
|
|
@@ -77,7 +83,7 @@ class CustomerSheetUtils {
|
|
|
77
83
|
stripeSdk: stripeSdk
|
|
78
84
|
)
|
|
79
85
|
}
|
|
80
|
-
|
|
86
|
+
|
|
81
87
|
if let setupIntentClientSecret = setupIntentClientSecret {
|
|
82
88
|
return StripeCustomerAdapter(
|
|
83
89
|
customerEphemeralKeyProvider: {
|
|
@@ -95,7 +101,7 @@ class CustomerSheetUtils {
|
|
|
95
101
|
}
|
|
96
102
|
)
|
|
97
103
|
}
|
|
98
|
-
|
|
104
|
+
|
|
99
105
|
internal class func buildCustomerAdapterOverride(
|
|
100
106
|
customerAdapter: NSDictionary,
|
|
101
107
|
customerId: String,
|
|
@@ -151,7 +157,7 @@ class CustomerSheetUtils {
|
|
|
151
157
|
}
|
|
152
158
|
}
|
|
153
159
|
|
|
154
|
-
|
|
160
|
+
|
|
155
161
|
internal class func buildPaymentOptionResult(label: String, imageData: String?, paymentMethod: STPPaymentMethod?) -> NSMutableDictionary {
|
|
156
162
|
let result: NSMutableDictionary = [:]
|
|
157
163
|
let paymentOption: NSMutableDictionary = [:]
|
|
@@ -165,7 +171,7 @@ class CustomerSheetUtils {
|
|
|
165
171
|
}
|
|
166
172
|
return result
|
|
167
173
|
}
|
|
168
|
-
|
|
174
|
+
|
|
169
175
|
internal class func interpretResult(result: CustomerSheet.CustomerSheetResult) -> NSDictionary {
|
|
170
176
|
var payload: NSMutableDictionary = [:]
|
|
171
177
|
switch result {
|
|
@@ -14,13 +14,15 @@ class FinancialConnections {
|
|
|
14
14
|
internal static func present(
|
|
15
15
|
withClientSecret: String,
|
|
16
16
|
returnURL: String? = nil,
|
|
17
|
+
configuration: FinancialConnectionsSheet.Configuration? = nil,
|
|
17
18
|
onEvent: ((FinancialConnectionsEvent) -> Void)? = nil,
|
|
18
19
|
resolve: @escaping RCTPromiseResolveBlock
|
|
19
20
|
) -> Void {
|
|
20
21
|
DispatchQueue.main.async {
|
|
21
22
|
let financialConnectionsSheet = FinancialConnectionsSheet(
|
|
22
23
|
financialConnectionsSessionClientSecret: withClientSecret,
|
|
23
|
-
returnURL: returnURL
|
|
24
|
+
returnURL: returnURL,
|
|
25
|
+
configuration: configuration ?? .init()
|
|
24
26
|
)
|
|
25
27
|
financialConnectionsSheet.onEvent = onEvent
|
|
26
28
|
financialConnectionsSheet.present(
|
|
@@ -41,13 +43,15 @@ class FinancialConnections {
|
|
|
41
43
|
internal static func presentForToken(
|
|
42
44
|
withClientSecret: String,
|
|
43
45
|
returnURL: String? = nil,
|
|
46
|
+
configuration: FinancialConnectionsSheet.Configuration? = nil,
|
|
44
47
|
onEvent: ((FinancialConnectionsEvent) -> Void)? = nil,
|
|
45
48
|
resolve: @escaping RCTPromiseResolveBlock
|
|
46
49
|
) -> Void {
|
|
47
50
|
DispatchQueue.main.async {
|
|
48
51
|
let financialConnectionsSheet = FinancialConnectionsSheet(
|
|
49
52
|
financialConnectionsSessionClientSecret: withClientSecret,
|
|
50
|
-
returnURL: returnURL
|
|
53
|
+
returnURL: returnURL,
|
|
54
|
+
configuration: configuration ?? .init()
|
|
51
55
|
)
|
|
52
56
|
financialConnectionsSheet.onEvent = onEvent
|
|
53
57
|
financialConnectionsSheet.presentForToken(
|
|
@@ -24,7 +24,9 @@ extension StripeSdk {
|
|
|
24
24
|
billingDetailsCollectionConfiguration: params["billingDetailsCollectionConfiguration"] as? NSDictionary,
|
|
25
25
|
defaultBillingDetails: params["defaultBillingDetails"] as? NSDictionary,
|
|
26
26
|
preferredNetworks: params["preferredNetworks"] as? Array<Int>,
|
|
27
|
-
allowsRemovalOfLastSavedPaymentMethod: params["allowsRemovalOfLastSavedPaymentMethod"] as? Bool
|
|
27
|
+
allowsRemovalOfLastSavedPaymentMethod: params["allowsRemovalOfLastSavedPaymentMethod"] as? Bool,
|
|
28
|
+
updatePaymentMethodEnabled: params["updatePaymentMethodEnabled"] as? Bool,
|
|
29
|
+
cardBrandAcceptance: computeCardBrandAcceptance(params: params)
|
|
28
30
|
)
|
|
29
31
|
} catch {
|
|
30
32
|
resolve(
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
//
|
|
7
7
|
|
|
8
8
|
import Foundation
|
|
9
|
-
@_spi(ExperimentalAllowsRemovalOfLastSavedPaymentMethodAPI) @_spi(CustomerSessionBetaAccess) @_spi(STP) import StripePaymentSheet
|
|
9
|
+
@_spi(ExperimentalAllowsRemovalOfLastSavedPaymentMethodAPI) @_spi(CustomerSessionBetaAccess) @_spi(UpdatePaymentMethodBeta) @_spi(STP) import StripePaymentSheet
|
|
10
10
|
|
|
11
11
|
extension StripeSdk {
|
|
12
12
|
internal func buildPaymentSheetConfiguration(
|
|
13
13
|
params: NSDictionary
|
|
14
14
|
) -> (error: NSDictionary?, configuration: PaymentSheet.Configuration?) {
|
|
15
15
|
var configuration = PaymentSheet.Configuration()
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
configuration.primaryButtonLabel = params["primaryButtonLabel"] as? String
|
|
18
18
|
|
|
19
19
|
if let appearanceParams = params["appearance"] as? NSDictionary {
|
|
@@ -37,7 +37,16 @@ extension StripeSdk {
|
|
|
37
37
|
return(error: Errors.createError(ErrorType.Failed, error.localizedDescription), configuration: nil)
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
|
|
41
|
+
if let linkParams = params["link"] as? NSDictionary {
|
|
42
|
+
do {
|
|
43
|
+
let display = StripeSdk.mapToLinkDisplay(value: linkParams["display"] as? String)
|
|
44
|
+
configuration.link = PaymentSheet.LinkConfiguration(display: display)
|
|
45
|
+
} catch {
|
|
46
|
+
return(error: Errors.createError(ErrorType.Failed, error.localizedDescription), configuration: nil)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
41
50
|
if let merchantDisplayName = params["merchantDisplayName"] as? String {
|
|
42
51
|
configuration.merchantDisplayName = merchantDisplayName
|
|
43
52
|
}
|
|
@@ -49,11 +58,11 @@ extension StripeSdk {
|
|
|
49
58
|
if let allowsDelayedPaymentMethods = params["allowsDelayedPaymentMethods"] as? Bool {
|
|
50
59
|
configuration.allowsDelayedPaymentMethods = allowsDelayedPaymentMethods
|
|
51
60
|
}
|
|
52
|
-
|
|
61
|
+
|
|
53
62
|
if let removeSavedPaymentMethodMessage = params["removeSavedPaymentMethodMessage"] as? String {
|
|
54
63
|
configuration.removeSavedPaymentMethodMessage = removeSavedPaymentMethodMessage
|
|
55
64
|
}
|
|
56
|
-
|
|
65
|
+
|
|
57
66
|
if let billingConfigParams = params["billingDetailsCollectionConfiguration"] as? [String: Any?] {
|
|
58
67
|
configuration.billingDetailsCollectionConfiguration.name = StripeSdk.mapToCollectionMode(str: billingConfigParams["name"] as? String)
|
|
59
68
|
configuration.billingDetailsCollectionConfiguration.phone = StripeSdk.mapToCollectionMode(str: billingConfigParams["phone"] as? String)
|
|
@@ -77,19 +86,19 @@ extension StripeSdk {
|
|
|
77
86
|
}
|
|
78
87
|
|
|
79
88
|
}
|
|
80
|
-
|
|
89
|
+
|
|
81
90
|
if let defaultShippingDetails = params["defaultShippingDetails"] as? NSDictionary {
|
|
82
91
|
configuration.shippingDetails = {
|
|
83
92
|
return AddressSheetUtils.buildAddressDetails(params: defaultShippingDetails)
|
|
84
93
|
}
|
|
85
94
|
}
|
|
86
|
-
|
|
95
|
+
|
|
87
96
|
if #available(iOS 13.0, *) {
|
|
88
97
|
if let style = params["style"] as? String {
|
|
89
98
|
configuration.style = Mappers.mapToUserInterfaceStyle(style)
|
|
90
99
|
}
|
|
91
100
|
}
|
|
92
|
-
|
|
101
|
+
|
|
93
102
|
if let customerId = params["customerId"] as? String {
|
|
94
103
|
var customerEphemeralKeySecret = params["customerEphemeralKeySecret"] as? String
|
|
95
104
|
var customerClientSecret = params["customerSessionClientSecret"] as? String
|
|
@@ -104,19 +113,22 @@ extension StripeSdk {
|
|
|
104
113
|
configuration.customer = .init(id: customerId, customerSessionClientSecret: customerClientSecret)
|
|
105
114
|
}
|
|
106
115
|
}
|
|
107
|
-
|
|
116
|
+
|
|
108
117
|
if let preferredNetworksAsInts = params["preferredNetworks"] as? Array<Int> {
|
|
109
118
|
configuration.preferredNetworks = preferredNetworksAsInts.map(Mappers.intToCardBrand).compactMap { $0 }
|
|
110
119
|
}
|
|
111
|
-
|
|
120
|
+
|
|
112
121
|
if let allowsRemovalOfLastSavedPaymentMethod = params["allowsRemovalOfLastSavedPaymentMethod"] as? Bool {
|
|
113
122
|
configuration.allowsRemovalOfLastSavedPaymentMethod = allowsRemovalOfLastSavedPaymentMethod
|
|
114
123
|
}
|
|
115
|
-
|
|
124
|
+
|
|
116
125
|
if let paymentMethodOrder = params["paymentMethodOrder"] as? Array<String> {
|
|
117
126
|
configuration.paymentMethodOrder = paymentMethodOrder
|
|
118
127
|
}
|
|
119
|
-
|
|
128
|
+
|
|
129
|
+
if let updatePaymentMethodEnabled = params["updatePaymentMethodEnabled"] as? Bool {
|
|
130
|
+
configuration.updatePaymentMethodEnabled = updatePaymentMethodEnabled
|
|
131
|
+
}
|
|
120
132
|
switch params["paymentMethodLayout"] as? String? {
|
|
121
133
|
case "Horizontal":
|
|
122
134
|
configuration.paymentMethodLayout = .horizontal
|
|
@@ -125,17 +137,19 @@ extension StripeSdk {
|
|
|
125
137
|
default:
|
|
126
138
|
configuration.paymentMethodLayout = .automatic
|
|
127
139
|
}
|
|
128
|
-
|
|
140
|
+
|
|
141
|
+
configuration.cardBrandAcceptance = computeCardBrandAcceptance(params: params)
|
|
142
|
+
|
|
129
143
|
return (nil, configuration)
|
|
130
144
|
}
|
|
131
|
-
|
|
145
|
+
|
|
132
146
|
internal func preparePaymentSheetInstance(
|
|
133
147
|
params: NSDictionary,
|
|
134
148
|
configuration: PaymentSheet.Configuration,
|
|
135
149
|
resolve: @escaping RCTPromiseResolveBlock
|
|
136
150
|
) {
|
|
137
151
|
self.paymentSheetFlowController = nil
|
|
138
|
-
|
|
152
|
+
|
|
139
153
|
func handlePaymentSheetFlowControllerResult(result: Result<PaymentSheet.FlowController, Error>, stripeSdk: StripeSdk?) {
|
|
140
154
|
switch result {
|
|
141
155
|
case .failure(let error):
|
|
@@ -202,7 +216,7 @@ extension StripeSdk {
|
|
|
202
216
|
paymentMethodTypes: intentConfiguration["paymentMethodTypes"] as? [String],
|
|
203
217
|
captureMethod: mapCaptureMethod(captureMethodString)
|
|
204
218
|
)
|
|
205
|
-
|
|
219
|
+
|
|
206
220
|
if params["customFlow"] as? Bool == true {
|
|
207
221
|
PaymentSheet.FlowController.create(intentConfiguration: intentConfig, configuration: configuration) { [weak self] result in
|
|
208
222
|
handlePaymentSheetFlowControllerResult(result: result, stripeSdk: self)
|
|
@@ -216,7 +230,47 @@ extension StripeSdk {
|
|
|
216
230
|
}
|
|
217
231
|
}
|
|
218
232
|
}
|
|
219
|
-
|
|
233
|
+
|
|
234
|
+
internal func computeCardBrandAcceptance(params: NSDictionary) -> PaymentSheet.CardBrandAcceptance {
|
|
235
|
+
if let cardBrandAcceptanceParams = params["cardBrandAcceptance"] as? NSDictionary {
|
|
236
|
+
if let filter = cardBrandAcceptanceParams["filter"] as? String {
|
|
237
|
+
switch filter {
|
|
238
|
+
case "all":
|
|
239
|
+
return .all
|
|
240
|
+
case "allowed":
|
|
241
|
+
if let brands = cardBrandAcceptanceParams["brands"] as? [String] {
|
|
242
|
+
let cardBrands = brands.compactMap { mapToCardBrandCategory(brand: $0) }
|
|
243
|
+
return .allowed(brands: cardBrands)
|
|
244
|
+
}
|
|
245
|
+
case "disallowed":
|
|
246
|
+
if let brands = cardBrandAcceptanceParams["brands"] as? [String] {
|
|
247
|
+
let cardBrands = brands.compactMap { mapToCardBrandCategory(brand: $0) }
|
|
248
|
+
return .disallowed(brands: cardBrands)
|
|
249
|
+
}
|
|
250
|
+
default:
|
|
251
|
+
break
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return .all
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
private func mapToCardBrandCategory(brand: String) -> PaymentSheet.CardBrandAcceptance.BrandCategory? {
|
|
260
|
+
switch brand {
|
|
261
|
+
case "visa":
|
|
262
|
+
return .visa
|
|
263
|
+
case "mastercard":
|
|
264
|
+
return .mastercard
|
|
265
|
+
case "amex":
|
|
266
|
+
return .amex
|
|
267
|
+
case "discover":
|
|
268
|
+
return .discover
|
|
269
|
+
default:
|
|
270
|
+
return nil
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
220
274
|
private func mapCaptureMethod(_ captureMethod: String?) -> PaymentSheet.IntentConfiguration.CaptureMethod {
|
|
221
275
|
if let captureMethod = captureMethod {
|
|
222
276
|
switch captureMethod {
|
|
@@ -228,7 +282,7 @@ extension StripeSdk {
|
|
|
228
282
|
}
|
|
229
283
|
return PaymentSheet.IntentConfiguration.CaptureMethod.automatic
|
|
230
284
|
}
|
|
231
|
-
|
|
285
|
+
|
|
232
286
|
private func buildIntentConfiguration(
|
|
233
287
|
modeParams: NSDictionary,
|
|
234
288
|
paymentMethodTypes: [String]?,
|
|
@@ -266,7 +320,7 @@ extension StripeSdk {
|
|
|
266
320
|
}
|
|
267
321
|
})
|
|
268
322
|
}
|
|
269
|
-
|
|
323
|
+
|
|
270
324
|
private func buildCustomerHandlersForPaymentSheet(applePayParams: NSDictionary) -> PaymentSheet.ApplePayConfiguration.Handlers? {
|
|
271
325
|
if (applePayParams["request"] == nil) {
|
|
272
326
|
return nil
|
|
@@ -292,7 +346,7 @@ extension StripeSdk {
|
|
|
292
346
|
}
|
|
293
347
|
})
|
|
294
348
|
}
|
|
295
|
-
|
|
349
|
+
|
|
296
350
|
internal static func mapToCollectionMode(str: String?) -> PaymentSheet.BillingDetailsCollectionConfiguration.CollectionMode {
|
|
297
351
|
switch str {
|
|
298
352
|
case "automatic":
|
|
@@ -305,7 +359,7 @@ extension StripeSdk {
|
|
|
305
359
|
return .automatic
|
|
306
360
|
}
|
|
307
361
|
}
|
|
308
|
-
|
|
362
|
+
|
|
309
363
|
internal static func mapToAddressCollectionMode(str: String?) -> PaymentSheet.BillingDetailsCollectionConfiguration.AddressCollectionMode {
|
|
310
364
|
switch str {
|
|
311
365
|
case "automatic":
|
|
@@ -318,5 +372,16 @@ extension StripeSdk {
|
|
|
318
372
|
return .automatic
|
|
319
373
|
}
|
|
320
374
|
}
|
|
375
|
+
|
|
376
|
+
internal static func mapToLinkDisplay(value: String?) -> PaymentSheet.LinkConfiguration.Display {
|
|
377
|
+
switch value {
|
|
378
|
+
case "automatic":
|
|
379
|
+
return .automatic
|
|
380
|
+
case "never":
|
|
381
|
+
return .never
|
|
382
|
+
default:
|
|
383
|
+
return .automatic
|
|
384
|
+
}
|
|
385
|
+
}
|
|
321
386
|
}
|
|
322
387
|
|
package/ios/StripeSdk.m
CHANGED
|
@@ -170,11 +170,13 @@ RCT_EXTERN_METHOD(
|
|
|
170
170
|
)
|
|
171
171
|
RCT_EXTERN_METHOD(
|
|
172
172
|
collectBankAccountToken:(NSString *)clientSecret
|
|
173
|
+
params:(NSDictionary *)params
|
|
173
174
|
resolver: (RCTPromiseResolveBlock)resolve
|
|
174
175
|
rejecter: (RCTPromiseRejectBlock)reject
|
|
175
176
|
)
|
|
176
177
|
RCT_EXTERN_METHOD(
|
|
177
178
|
collectFinancialConnectionsAccounts:(NSString *)clientSecret
|
|
179
|
+
params:(NSDictionary *)params
|
|
178
180
|
resolver: (RCTPromiseResolveBlock)resolve
|
|
179
181
|
rejecter: (RCTPromiseRejectBlock)reject
|
|
180
182
|
)
|
package/ios/StripeSdk.swift
CHANGED
|
@@ -730,21 +730,24 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate {
|
|
|
730
730
|
if let urlScheme = urlScheme {
|
|
731
731
|
connectionsReturnURL = Mappers.mapToFinancialConnectionsReturnURL(urlScheme: urlScheme)
|
|
732
732
|
} else {
|
|
733
|
-
|
|
733
|
+
connectionsReturnURL = nil
|
|
734
734
|
}
|
|
735
735
|
|
|
736
736
|
var onEvent: ((FinancialConnectionsEvent) -> Void)? = nil
|
|
737
737
|
|
|
738
738
|
if hasEventListeners {
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
739
|
+
onEvent = { [weak self] event in
|
|
740
|
+
let mappedEvent = Mappers.financialConnectionsEventToMap(event)
|
|
741
|
+
self?.sendEvent(withName: "onFinancialConnectionsEvent", body: mappedEvent)
|
|
742
|
+
}
|
|
743
743
|
}
|
|
744
744
|
|
|
745
|
+
let style = STPBankAccountCollectorUserInterfaceStyle(from: params)
|
|
746
|
+
let bankAccountCollector = STPBankAccountCollector(style: style)
|
|
747
|
+
|
|
745
748
|
if (isPaymentIntent) {
|
|
746
749
|
DispatchQueue.main.async {
|
|
747
|
-
|
|
750
|
+
bankAccountCollector.collectBankAccountForPayment(
|
|
748
751
|
clientSecret: clientSecret as String,
|
|
749
752
|
returnURL: connectionsReturnURL,
|
|
750
753
|
params: collectParams,
|
|
@@ -771,7 +774,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate {
|
|
|
771
774
|
}
|
|
772
775
|
} else {
|
|
773
776
|
DispatchQueue.main.async {
|
|
774
|
-
|
|
777
|
+
bankAccountCollector.collectBankAccountForSetup(
|
|
775
778
|
clientSecret: clientSecret as String,
|
|
776
779
|
returnURL: connectionsReturnURL,
|
|
777
780
|
params: collectParams,
|
|
@@ -1037,9 +1040,10 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate {
|
|
|
1037
1040
|
resolve(["isInWallet": PushProvisioningUtils.getPassLocation(last4: last4) != nil])
|
|
1038
1041
|
}
|
|
1039
1042
|
|
|
1040
|
-
@objc(collectBankAccountToken:resolver:rejecter:)
|
|
1043
|
+
@objc(collectBankAccountToken:params:resolver:rejecter:)
|
|
1041
1044
|
func collectBankAccountToken(
|
|
1042
1045
|
clientSecret: String,
|
|
1046
|
+
params: NSDictionary,
|
|
1043
1047
|
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
1044
1048
|
rejecter reject: @escaping RCTPromiseRejectBlock
|
|
1045
1049
|
) -> Void {
|
|
@@ -1054,6 +1058,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate {
|
|
|
1054
1058
|
returnURL = nil
|
|
1055
1059
|
}
|
|
1056
1060
|
|
|
1061
|
+
let configuration = FinancialConnectionsSheet.Configuration(from: params)
|
|
1057
1062
|
var onEvent: ((FinancialConnectionsEvent) -> Void)? = nil
|
|
1058
1063
|
|
|
1059
1064
|
if hasEventListeners {
|
|
@@ -1063,12 +1068,19 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate {
|
|
|
1063
1068
|
}
|
|
1064
1069
|
}
|
|
1065
1070
|
|
|
1066
|
-
FinancialConnections.presentForToken(
|
|
1071
|
+
FinancialConnections.presentForToken(
|
|
1072
|
+
withClientSecret: clientSecret,
|
|
1073
|
+
returnURL: returnURL,
|
|
1074
|
+
configuration: configuration,
|
|
1075
|
+
onEvent: onEvent,
|
|
1076
|
+
resolve: resolve
|
|
1077
|
+
)
|
|
1067
1078
|
}
|
|
1068
1079
|
|
|
1069
|
-
@objc(collectFinancialConnectionsAccounts:resolver:rejecter:)
|
|
1080
|
+
@objc(collectFinancialConnectionsAccounts:params:resolver:rejecter:)
|
|
1070
1081
|
func collectFinancialConnectionsAccounts(
|
|
1071
1082
|
clientSecret: String,
|
|
1083
|
+
params: NSDictionary,
|
|
1072
1084
|
resolver resolve: @escaping RCTPromiseResolveBlock,
|
|
1073
1085
|
rejecter reject: @escaping RCTPromiseRejectBlock
|
|
1074
1086
|
) -> Void {
|
|
@@ -1083,6 +1095,7 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate {
|
|
|
1083
1095
|
returnURL = nil
|
|
1084
1096
|
}
|
|
1085
1097
|
|
|
1098
|
+
let configuration = FinancialConnectionsSheet.Configuration(from: params)
|
|
1086
1099
|
var onEvent: ((FinancialConnectionsEvent) -> Void)? = nil
|
|
1087
1100
|
|
|
1088
1101
|
if hasEventListeners {
|
|
@@ -1092,7 +1105,13 @@ class StripeSdk: RCTEventEmitter, UIAdaptivePresentationControllerDelegate {
|
|
|
1092
1105
|
}
|
|
1093
1106
|
}
|
|
1094
1107
|
|
|
1095
|
-
FinancialConnections.present(
|
|
1108
|
+
FinancialConnections.present(
|
|
1109
|
+
withClientSecret: clientSecret,
|
|
1110
|
+
returnURL: returnURL,
|
|
1111
|
+
configuration: configuration,
|
|
1112
|
+
onEvent: onEvent,
|
|
1113
|
+
resolve: resolve
|
|
1114
|
+
)
|
|
1096
1115
|
}
|
|
1097
1116
|
|
|
1098
1117
|
@objc(configureOrderTracking:orderIdentifier:webServiceUrl:authenticationToken:resolver:rejecter:)
|
|
@@ -1177,3 +1196,45 @@ extension StripeSdk: STPAuthenticationContext {
|
|
|
1177
1196
|
return findViewControllerPresenter(from: UIApplication.shared.delegate?.window??.rootViewController ?? UIViewController())
|
|
1178
1197
|
}
|
|
1179
1198
|
}
|
|
1199
|
+
|
|
1200
|
+
extension STPBankAccountCollectorUserInterfaceStyle {
|
|
1201
|
+
init(from params: NSDictionary) {
|
|
1202
|
+
guard let styleString = params["style"] as? String else {
|
|
1203
|
+
self = .automatic
|
|
1204
|
+
return
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
switch styleString {
|
|
1208
|
+
case "automatic":
|
|
1209
|
+
self = .automatic
|
|
1210
|
+
case "alwaysLight":
|
|
1211
|
+
self = .alwaysLight
|
|
1212
|
+
case "alwaysDark":
|
|
1213
|
+
self = .alwaysDark
|
|
1214
|
+
default:
|
|
1215
|
+
self = .automatic
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
extension FinancialConnectionsSheet.Configuration {
|
|
1221
|
+
init(from params: NSDictionary) {
|
|
1222
|
+
let style: FinancialConnectionsSheet.Configuration.UserInterfaceStyle = {
|
|
1223
|
+
guard let styleString = params["style"] as? String else {
|
|
1224
|
+
return .automatic
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
switch styleString {
|
|
1228
|
+
case "automatic":
|
|
1229
|
+
return .automatic
|
|
1230
|
+
case "alwaysLight":
|
|
1231
|
+
return .alwaysLight
|
|
1232
|
+
case "alwaysDark":
|
|
1233
|
+
return .alwaysDark
|
|
1234
|
+
default:
|
|
1235
|
+
return .automatic
|
|
1236
|
+
}
|
|
1237
|
+
}()
|
|
1238
|
+
self.init(style: style)
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var StripeSdk=_reactNative.NativeModules.StripeSdk;var _default=
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var StripeSdk=_reactNative.NativeModules.StripeSdk;var _default=exports.default=StripeSdk;
|
|
2
2
|
//# sourceMappingURL=NativeStripeSdk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StripeSdk","NativeModules"
|
|
1
|
+
{"version":3,"names":["_reactNative","require","StripeSdk","NativeModules","_default","exports","default"],"sourceRoot":"../../src","sources":["NativeStripeSdk.tsx"],"mappings":"gFAAA,IAAAA,YAAA,CAAAC,OAAA,iBA4JA,GAAQ,CAAAC,SAAS,CAAKC,0BAAa,CAA3BD,SAAS,CAAmB,IAAAE,QAAA,CAAAC,OAAA,CAAAC,OAAA,CAErBJ,SAAS","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddToWalletButton=AddToWalletButton;var
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddToWalletButton=AddToWalletButton;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/AddToWalletButton.tsx";var _excluded=["onComplete"];var AddToWalletButtonNative=(0,_reactNative.requireNativeComponent)('AddToWalletButton');function AddToWalletButton(_ref){var onComplete=_ref.onComplete,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return(0,_jsxRuntime.jsx)(AddToWalletButtonNative,Object.assign({},props,{onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);}}));}
|
|
2
2
|
//# sourceMappingURL=AddToWalletButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_jsxRuntime","_jsxFileName","_excluded","AddToWalletButtonNative","requireNativeComponent","AddToWalletButton","_ref","onComplete","props","_objectWithoutProperties2","default","jsx","Object","assign","onCompleteAction","value","nativeEvent"],"sourceRoot":"../../../src","sources":["components/AddToWalletButton.tsx"],"mappings":"wSAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBAOsB,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,4FAAAC,SAAA,gBAQtB,GAAM,CAAAC,uBAAuB,CAC3B,GAAAC,mCAAsB,EAAM,mBAAmB,CAAC,CAgE3C,QAAS,CAAAC,iBAAiBA,CAAAC,IAAA,CAAkC,IAA/B,CAAAC,UAAU,CAAAD,IAAA,CAAVC,UAAU,CAAKC,KAAK,IAAAC,yBAAA,CAAAC,OAAA,EAAAJ,IAAA,CAAAJ,SAAA,EACtD,MACE,GAAAF,WAAA,CAAAW,GAAA,EAACR,uBAAuB,CAAAS,MAAA,CAAAC,MAAA,IAClBL,KAAK,EACTM,gBAAgB,CAAE,QAAlB,CAAAA,gBAAgBA,CACdC,KAEE,QACC,CAAAR,UAAU,CAACQ,KAAK,CAACC,WAAW,CAAC,EAAC,EACpC,CAAC,CAEN","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddressSheet=AddressSheet;var
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AddressSheet=AddressSheet;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/AddressSheet.tsx";var _excluded=["onSubmit","onError"];var AddressSheetNative=(0,_reactNative.requireNativeComponent)('AddressSheetView');function AddressSheet(_ref){var onSubmit=_ref.onSubmit,onError=_ref.onError,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return(0,_jsxRuntime.jsx)(AddressSheetNative,Object.assign({},props,{onSubmitAction:function onSubmitAction(value){return onSubmit(value.nativeEvent);},onErrorAction:function onErrorAction(value){return onError(value.nativeEvent.error);}}));}
|
|
2
2
|
//# sourceMappingURL=AddressSheet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AddressSheetNative","requireNativeComponent","AddressSheet","onSubmit","onError","props","value","nativeEvent","error"],"sources":["AddressSheet.tsx"],"
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_jsxRuntime","_jsxFileName","_excluded","AddressSheetNative","requireNativeComponent","AddressSheet","_ref","onSubmit","onError","props","_objectWithoutProperties2","default","jsx","Object","assign","onSubmitAction","value","nativeEvent","onErrorAction","error"],"sourceRoot":"../../../src","sources":["components/AddressSheet.tsx"],"mappings":"8RAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBAIsB,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,uFAAAC,SAAA,wBAQtB,GAAM,CAAAC,kBAAkB,CAAG,GAAAC,mCAAsB,EAAM,kBAAkB,CAAC,CA4DnE,QAAS,CAAAC,YAAYA,CAAAC,IAAA,CAAyC,IAAtC,CAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CAAEC,OAAO,CAAAF,IAAA,CAAPE,OAAO,CAAKC,KAAK,IAAAC,yBAAA,CAAAC,OAAA,EAAAL,IAAA,CAAAJ,SAAA,EACxD,MACE,GAAAF,WAAA,CAAAY,GAAA,EAACT,kBAAkB,CAAAU,MAAA,CAAAC,MAAA,IACbL,KAAK,EACTM,cAAc,CAAE,QAAhB,CAAAA,cAAcA,CAAGC,KAAiD,QAChE,CAAAT,QAAQ,CAACS,KAAK,CAACC,WAAW,CAAC,EAC5B,CACDC,aAAa,CAAE,QAAf,CAAAA,aAAaA,CACXF,KAEE,QACC,CAAAR,OAAO,CAACQ,KAAK,CAACC,WAAW,CAACE,KAAK,CAAC,EAAC,EACvC,CAAC,CAEN","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var ApplePayButtonNative=(0,_reactNative.requireNativeComponent)('ApplePayButton');var _default=
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _reactNative=require("react-native");var ApplePayButtonNative=(0,_reactNative.requireNativeComponent)('ApplePayButton');var _default=exports.default=ApplePayButtonNative;
|
|
2
2
|
//# sourceMappingURL=ApplePayButtonNative.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ApplePayButtonNative","requireNativeComponent"],"
|
|
1
|
+
{"version":3,"names":["_reactNative","require","ApplePayButtonNative","requireNativeComponent","_default","exports","default"],"sourceRoot":"../../../src","sources":["components/ApplePayButtonNative.tsx"],"mappings":"gFAAA,IAAAA,YAAA,CAAAC,OAAA,iBAEA,GAAM,CAAAC,oBAAoB,CACxB,GAAAC,mCAAsB,EAAsC,gBAAgB,CAAC,CAAC,IAAAC,QAAA,CAAAC,OAAA,CAAAC,OAAA,CACjEJ,oBAAoB","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AuBECSDebitForm=AuBECSDebitForm;var
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.AuBECSDebitForm=AuBECSDebitForm;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/Users/charliecruzan/stripe/stripe-react-native/src/components/AuBECSDebitForm.tsx";var _excluded=["onComplete","companyName","formStyle"];var AuBECSDebitFormNative=(0,_reactNative.requireNativeComponent)('AuBECSDebitForm');function AuBECSDebitForm(_ref){var onComplete=_ref.onComplete,companyName=_ref.companyName,formStyle=_ref.formStyle,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);return(0,_jsxRuntime.jsx)(AuBECSDebitFormNative,Object.assign({onCompleteAction:function onCompleteAction(value){return onComplete(value.nativeEvent);},companyName:companyName,formStyle:Object.assign({},formStyle)},props));}
|
|
2
2
|
//# sourceMappingURL=AuBECSDebitForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AuBECSDebitFormNative","requireNativeComponent","AuBECSDebitForm","onComplete","companyName","formStyle","props","value","nativeEvent"],"
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_jsxRuntime","_jsxFileName","_excluded","AuBECSDebitFormNative","requireNativeComponent","AuBECSDebitForm","_ref","onComplete","companyName","formStyle","props","_objectWithoutProperties2","default","jsx","Object","assign","onCompleteAction","value","nativeEvent"],"sourceRoot":"../../../src","sources":["components/AuBECSDebitForm.tsx"],"mappings":"oSAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBAKsB,IAAAE,WAAA,CAAAF,OAAA,0BAAAG,YAAA,0FAAAC,SAAA,0CAGtB,GAAM,CAAAC,qBAAqB,CACzB,GAAAC,mCAAsB,EACpB,iBACF,CAAC,CA4BI,QAAS,CAAAC,eAAeA,CAAAC,IAAA,CAKrB,IAJR,CAAAC,UAAU,CAAAD,IAAA,CAAVC,UAAU,CACVC,WAAW,CAAAF,IAAA,CAAXE,WAAW,CACXC,SAAS,CAAAH,IAAA,CAATG,SAAS,CACNC,KAAK,IAAAC,yBAAA,CAAAC,OAAA,EAAAN,IAAA,CAAAJ,SAAA,EAER,MACE,GAAAF,WAAA,CAAAa,GAAA,EAACV,qBAAqB,CAAAW,MAAA,CAAAC,MAAA,EACpBC,gBAAgB,CAAE,QAAlB,CAAAA,gBAAgBA,CAAGC,KAAK,QAAK,CAAAV,UAAU,CAACU,KAAK,CAACC,WAAW,CAAC,EAAC,CAC3DV,WAAW,CAAEA,WAAY,CACzBC,SAAS,CAAAK,MAAA,CAAAC,MAAA,IAAON,SAAS,CAAG,EACxBC,KAAK,CACV,CAAC,CAEN","ignoreList":[]}
|