@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
|
@@ -21,7 +21,7 @@ export { PaymentMethodLayout } from './PaymentSheet';
|
|
|
21
21
|
/**
|
|
22
22
|
* @ignore
|
|
23
23
|
*/
|
|
24
|
-
export
|
|
24
|
+
export type Dictionary<T> = {
|
|
25
25
|
[key: string]: T;
|
|
26
26
|
};
|
|
27
27
|
export interface AppInfo {
|
|
@@ -30,84 +30,84 @@ export interface AppInfo {
|
|
|
30
30
|
url?: string;
|
|
31
31
|
version?: string;
|
|
32
32
|
}
|
|
33
|
-
export
|
|
33
|
+
export type CreatePaymentMethodResult = {
|
|
34
34
|
paymentMethod: PaymentMethod.Result;
|
|
35
35
|
error?: undefined;
|
|
36
36
|
} | {
|
|
37
37
|
paymentMethod?: undefined;
|
|
38
38
|
error: StripeError<CreatePaymentMethodError>;
|
|
39
39
|
};
|
|
40
|
-
export
|
|
40
|
+
export type RetrievePaymentIntentResult = {
|
|
41
41
|
paymentIntent: PaymentIntent.Result;
|
|
42
42
|
error?: undefined;
|
|
43
43
|
} | {
|
|
44
44
|
paymentIntent?: undefined;
|
|
45
45
|
error: StripeError<RetrievePaymentIntentError>;
|
|
46
46
|
};
|
|
47
|
-
export
|
|
47
|
+
export type RetrieveSetupIntentResult = {
|
|
48
48
|
setupIntent: SetupIntent.Result;
|
|
49
49
|
error?: undefined;
|
|
50
50
|
} | {
|
|
51
51
|
setupIntent?: undefined;
|
|
52
52
|
error: StripeError<RetrieveSetupIntentError>;
|
|
53
53
|
};
|
|
54
|
-
export
|
|
54
|
+
export type ConfirmPaymentResult = {
|
|
55
55
|
paymentIntent: PaymentIntent.Result;
|
|
56
56
|
error?: undefined;
|
|
57
57
|
} | {
|
|
58
58
|
paymentIntent?: undefined;
|
|
59
59
|
error: StripeError<ConfirmPaymentError>;
|
|
60
60
|
};
|
|
61
|
-
export
|
|
61
|
+
export type HandleNextActionResult = {
|
|
62
62
|
paymentIntent: PaymentIntent.Result;
|
|
63
63
|
error?: undefined;
|
|
64
64
|
} | {
|
|
65
65
|
paymentIntent?: undefined;
|
|
66
66
|
error: StripeError<CardActionError>;
|
|
67
67
|
};
|
|
68
|
-
export
|
|
68
|
+
export type HandleNextActionForSetupResult = {
|
|
69
69
|
setupIntent: SetupIntent.Result;
|
|
70
70
|
error?: undefined;
|
|
71
71
|
} | {
|
|
72
72
|
setupIntent?: undefined;
|
|
73
73
|
error: StripeError<CardActionError>;
|
|
74
74
|
};
|
|
75
|
-
export
|
|
75
|
+
export type ConfirmSetupIntentResult = {
|
|
76
76
|
setupIntent: SetupIntent.Result;
|
|
77
77
|
error?: undefined;
|
|
78
78
|
} | {
|
|
79
79
|
setupIntent?: undefined;
|
|
80
80
|
error: StripeError<ConfirmSetupIntentError>;
|
|
81
81
|
};
|
|
82
|
-
export
|
|
82
|
+
export type CreateTokenForCVCUpdateResult = {
|
|
83
83
|
tokenId: string;
|
|
84
84
|
error?: undefined;
|
|
85
85
|
} | {
|
|
86
86
|
tokenId?: undefined;
|
|
87
87
|
error: StripeError<ConfirmSetupIntentError>;
|
|
88
88
|
};
|
|
89
|
-
export
|
|
89
|
+
export type InitPaymentSheetResult = {
|
|
90
90
|
paymentOption?: PaymentSheet.PaymentOption;
|
|
91
91
|
error?: undefined;
|
|
92
92
|
} | {
|
|
93
93
|
paymentOption?: undefined;
|
|
94
94
|
error: StripeError<PaymentSheetError>;
|
|
95
95
|
};
|
|
96
|
-
export
|
|
96
|
+
export type PresentPaymentSheetResult = {
|
|
97
97
|
paymentOption?: PaymentSheet.PaymentOption | undefined;
|
|
98
98
|
error?: StripeError<PaymentSheetError> | undefined;
|
|
99
99
|
};
|
|
100
|
-
export
|
|
100
|
+
export type CreateTokenResult = {
|
|
101
101
|
token: Token.Result;
|
|
102
102
|
error?: undefined;
|
|
103
103
|
} | {
|
|
104
104
|
token?: undefined;
|
|
105
105
|
error: StripeError<CreateTokenError>;
|
|
106
106
|
};
|
|
107
|
-
export
|
|
107
|
+
export type ConfirmPaymentSheetPaymentResult = {
|
|
108
108
|
error?: StripeError<PaymentSheetError>;
|
|
109
109
|
};
|
|
110
|
-
export
|
|
110
|
+
export type ApplePayResult = {
|
|
111
111
|
paymentMethod: PaymentMethod.Result;
|
|
112
112
|
error?: undefined;
|
|
113
113
|
} | {
|
|
@@ -125,60 +125,61 @@ export interface InitStripeParams {
|
|
|
125
125
|
export interface InitialiseParams extends InitStripeParams {
|
|
126
126
|
appInfo: AppInfo;
|
|
127
127
|
}
|
|
128
|
-
export
|
|
128
|
+
export type GooglePayInitResult = {
|
|
129
129
|
error?: undefined;
|
|
130
130
|
} | {
|
|
131
131
|
error: StripeError<GooglePayError>;
|
|
132
132
|
};
|
|
133
|
-
export
|
|
133
|
+
export type PayWithGooglePayResult = {
|
|
134
134
|
error?: undefined;
|
|
135
135
|
} | {
|
|
136
136
|
error: StripeError<GooglePayError>;
|
|
137
137
|
};
|
|
138
|
-
export
|
|
138
|
+
export type CreateGooglePayPaymentMethodResult = {
|
|
139
139
|
paymentMethod: PaymentMethod.Result;
|
|
140
140
|
error?: undefined;
|
|
141
141
|
} | {
|
|
142
142
|
paymentMethod?: undefined;
|
|
143
143
|
error: StripeError<GooglePayError>;
|
|
144
144
|
};
|
|
145
|
-
export
|
|
145
|
+
export type OpenApplePaySetupResult = {
|
|
146
146
|
error?: undefined;
|
|
147
147
|
} | {
|
|
148
148
|
error: StripeError<ApplePayError>;
|
|
149
149
|
};
|
|
150
|
-
export
|
|
150
|
+
export type VerifyMicrodepositsParams = {
|
|
151
151
|
amounts: number[];
|
|
152
152
|
descriptorCode?: undefined;
|
|
153
153
|
} | {
|
|
154
154
|
amounts?: undefined;
|
|
155
155
|
descriptorCode: string;
|
|
156
156
|
};
|
|
157
|
-
export
|
|
157
|
+
export type VerifyMicrodepositsForPaymentResult = {
|
|
158
158
|
paymentIntent: PaymentIntent.Result;
|
|
159
159
|
error?: undefined;
|
|
160
160
|
} | {
|
|
161
161
|
paymentIntent?: undefined;
|
|
162
162
|
error: StripeError<VerifyMicrodepositsError>;
|
|
163
163
|
};
|
|
164
|
-
export
|
|
164
|
+
export type VerifyMicrodepositsForSetupResult = {
|
|
165
165
|
setupIntent: SetupIntent.Result;
|
|
166
166
|
error?: undefined;
|
|
167
167
|
} | {
|
|
168
168
|
setupIntent?: undefined;
|
|
169
169
|
error: StripeError<VerifyMicrodepositsError>;
|
|
170
170
|
};
|
|
171
|
-
export
|
|
171
|
+
export type CollectBankAccountForPaymentResult = {
|
|
172
172
|
paymentIntent: PaymentIntent.Result;
|
|
173
173
|
error?: undefined;
|
|
174
174
|
} | {
|
|
175
175
|
paymentIntent?: undefined;
|
|
176
176
|
error: StripeError<CollectBankAccountError>;
|
|
177
177
|
};
|
|
178
|
-
export
|
|
178
|
+
export type CollectBankAccountForSetupResult = {
|
|
179
179
|
setupIntent: SetupIntent.Result;
|
|
180
180
|
error?: undefined;
|
|
181
181
|
} | {
|
|
182
182
|
setupIntent?: undefined;
|
|
183
183
|
error: StripeError<CollectBankAccountError>;
|
|
184
184
|
};
|
|
185
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,eAAe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
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/stripe-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.0",
|
|
4
4
|
"author": "Stripe",
|
|
5
5
|
"description": "Stripe SDK for React Native",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"test": "jest",
|
|
13
13
|
"typescript": "tsc --noEmit",
|
|
14
14
|
"lint": "eslint \"**/*.{js,ts,tsx}\" --ignore-pattern \"docs/api-reference/*\" --ignore-path .gitignore",
|
|
15
|
-
"prepare": "bob build && husky
|
|
15
|
+
"prepare": "bob build && husky",
|
|
16
16
|
"release": "./scripts/publish",
|
|
17
17
|
"example": "yarn --cwd example",
|
|
18
18
|
"pods": "cd example && npx pod-install --quiet",
|
|
@@ -20,14 +20,18 @@
|
|
|
20
20
|
"bootstrap": "yarn example && yarn && yarn pods",
|
|
21
21
|
"bootstrap-no-pods": "yarn example && yarn",
|
|
22
22
|
"docs": "yarn typedoc ./src/index.tsx --out ./docs/api-reference --tsconfig ./tsconfig.json --readme none --sort source-order",
|
|
23
|
-
"run-example-ios": "cd example
|
|
24
|
-
"run-example-
|
|
23
|
+
"run-example-ios": "cd example && yarn ios --simulator \"iPhone 16\"",
|
|
24
|
+
"run-example-ios:release": "cd example && yarn build:ios && yarn ios --mode Release --simulator \"iPhone 16\" --no-packager",
|
|
25
|
+
"run-example-android": "cd example && yarn android",
|
|
26
|
+
"run-example-android:release": "cd example && yarn build:android && yarn android --mode=release --no-packager",
|
|
25
27
|
"test:e2e:ios": "bash ./scripts/run-maestro-tests ios",
|
|
26
28
|
"test:e2e:android": "bash ./scripts/run-maestro-tests android",
|
|
27
|
-
"test:unit:ios": "xcodebuild test -workspace example/ios/
|
|
29
|
+
"test:unit:ios": "xcodebuild test -workspace example/ios/example.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 16' -scheme stripe-react-native-Unit-Tests",
|
|
28
30
|
"test:unit:android": "cd example/android && ./gradlew connectedAndroidTest",
|
|
29
31
|
"test-ios": "maestro test -e APP_ID=com.stripe.react.native",
|
|
30
|
-
"test-android": "maestro test -e APP_ID=com.
|
|
32
|
+
"test-android": "maestro test -e APP_ID=com.stripe.react.native",
|
|
33
|
+
"format:android:check": "cd android && ./gradlew spotlessCheck",
|
|
34
|
+
"format:android:write": "cd android && ./gradlew spotlessApply"
|
|
31
35
|
},
|
|
32
36
|
"keywords": [
|
|
33
37
|
"react-native",
|
|
@@ -42,26 +46,23 @@
|
|
|
42
46
|
"homepage": "https://github.com/stripe/stripe-react-native/#readme",
|
|
43
47
|
"dependencies": {},
|
|
44
48
|
"devDependencies": {
|
|
45
|
-
"@
|
|
46
|
-
"@
|
|
47
|
-
"@react-native-
|
|
48
|
-
"@
|
|
49
|
-
"@types/
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"eslint": "^
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"ts-node": "^9.1.1",
|
|
63
|
-
"typedoc": "^0.22.12",
|
|
64
|
-
"typescript": "~4.4.4"
|
|
49
|
+
"@expo/config-plugins": "^9.0.16",
|
|
50
|
+
"@react-native/babel-preset": "^0.78.0",
|
|
51
|
+
"@react-native/eslint-config": "^0.78.0",
|
|
52
|
+
"@types/jest": "^29.5.14",
|
|
53
|
+
"@types/react": "^19.0.10",
|
|
54
|
+
"eslint": "^8.57.0",
|
|
55
|
+
"eslint-config-prettier": "^9.1.0",
|
|
56
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
57
|
+
"husky": "^9.1.7",
|
|
58
|
+
"jest": "^29.7.0",
|
|
59
|
+
"prettier": "^3.5.2",
|
|
60
|
+
"react": "^19.0.0",
|
|
61
|
+
"react-native": "^0.78.0",
|
|
62
|
+
"react-native-builder-bob": "^0.37.0",
|
|
63
|
+
"ts-node": "^10.9.2",
|
|
64
|
+
"typedoc": "^0.27.9",
|
|
65
|
+
"typescript": "^5.7.3"
|
|
65
66
|
},
|
|
66
67
|
"peerDependencies": {
|
|
67
68
|
"expo": ">=46.0.9",
|
|
@@ -83,24 +84,14 @@
|
|
|
83
84
|
},
|
|
84
85
|
"eslintConfig": {
|
|
85
86
|
"extends": [
|
|
86
|
-
"@react-native
|
|
87
|
-
"prettier"
|
|
87
|
+
"@react-native",
|
|
88
|
+
"plugin:prettier/recommended"
|
|
88
89
|
],
|
|
89
90
|
"rules": {
|
|
90
91
|
"no-shadow": "off",
|
|
91
92
|
"@typescript-eslint/no-shadow": [
|
|
92
93
|
"error"
|
|
93
94
|
],
|
|
94
|
-
"prettier/prettier": [
|
|
95
|
-
"error",
|
|
96
|
-
{
|
|
97
|
-
"quoteProps": "consistent",
|
|
98
|
-
"singleQuote": true,
|
|
99
|
-
"tabWidth": 2,
|
|
100
|
-
"trailingComma": "es5",
|
|
101
|
-
"useTabs": false
|
|
102
|
-
}
|
|
103
|
-
],
|
|
104
95
|
"no-restricted-syntax": [
|
|
105
96
|
"error",
|
|
106
97
|
{
|
|
@@ -113,7 +104,8 @@
|
|
|
113
104
|
"eslintIgnore": [
|
|
114
105
|
"node_modules/",
|
|
115
106
|
"lib/",
|
|
116
|
-
"dist/"
|
|
107
|
+
"dist/",
|
|
108
|
+
"server-dist/"
|
|
117
109
|
],
|
|
118
110
|
"prettier": {
|
|
119
111
|
"quoteProps": "consistent",
|
|
@@ -122,7 +114,7 @@
|
|
|
122
114
|
"trailingComma": "es5",
|
|
123
115
|
"useTabs": false
|
|
124
116
|
},
|
|
125
|
-
"
|
|
117
|
+
"react-native-builder-bob": {
|
|
126
118
|
"source": "src",
|
|
127
119
|
"output": "lib",
|
|
128
120
|
"targets": [
|
package/src/NativeStripeSdk.tsx
CHANGED
|
@@ -94,10 +94,12 @@ type NativeStripeSdkType = {
|
|
|
94
94
|
cardLastFour: string;
|
|
95
95
|
}): Promise<IsCardInWalletResult>;
|
|
96
96
|
collectBankAccountToken(
|
|
97
|
-
clientSecret: string
|
|
97
|
+
clientSecret: string,
|
|
98
|
+
params: PaymentMethod.CollectBankAccountTokenParams
|
|
98
99
|
): Promise<FinancialConnections.TokenResult>;
|
|
99
100
|
collectFinancialConnectionsAccounts(
|
|
100
|
-
clientSecret: string
|
|
101
|
+
clientSecret: string,
|
|
102
|
+
params: FinancialConnections.CollectFinancialConnectionsAccountsParams
|
|
101
103
|
): Promise<FinancialConnections.SessionResult>;
|
|
102
104
|
resetPaymentSheetCustomer(): Promise<null>;
|
|
103
105
|
isPlatformPaySupported(params: {
|
|
@@ -124,7 +124,7 @@ export const CardField = forwardRef<CardFieldInput.Methods, Props>(
|
|
|
124
124
|
);
|
|
125
125
|
|
|
126
126
|
const onFocusHandler = useCallback(
|
|
127
|
-
(event) => {
|
|
127
|
+
(event: CardFieldInput.OnFocusChangeEvent) => {
|
|
128
128
|
const { focusedField } = event.nativeEvent;
|
|
129
129
|
if (focusedField) {
|
|
130
130
|
focusInput(inputRef.current);
|
|
@@ -140,15 +140,18 @@ export const CardForm = forwardRef<CardFormView.Methods, Props>(
|
|
|
140
140
|
blur,
|
|
141
141
|
}));
|
|
142
142
|
|
|
143
|
-
const onFocusHandler = useCallback(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
143
|
+
const onFocusHandler = useCallback(
|
|
144
|
+
(event: CardFormView.OnFocusChangeEvent) => {
|
|
145
|
+
const { focusedField } = event.nativeEvent;
|
|
146
|
+
if (focusedField) {
|
|
147
|
+
focusInput(inputRef.current);
|
|
148
|
+
// onFocus?.(focusedField);
|
|
149
|
+
} else {
|
|
150
|
+
// onBlur?.();
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
[]
|
|
154
|
+
);
|
|
152
155
|
|
|
153
156
|
useLayoutEffect(() => {
|
|
154
157
|
const inputRefValue = inputRef.current;
|
|
@@ -78,9 +78,8 @@ const configureCustomerAdapterEventListeners = (
|
|
|
78
78
|
'onCustomerAdapterAttachPaymentMethodCallback',
|
|
79
79
|
async ({ paymentMethodId }: { paymentMethodId: string }) => {
|
|
80
80
|
if (customerAdapter.attachPaymentMethod) {
|
|
81
|
-
const paymentMethod =
|
|
82
|
-
paymentMethodId
|
|
83
|
-
);
|
|
81
|
+
const paymentMethod =
|
|
82
|
+
await customerAdapter.attachPaymentMethod(paymentMethodId);
|
|
84
83
|
await NativeStripeSdk.customerAdapterAttachPaymentMethodCallback(
|
|
85
84
|
paymentMethod
|
|
86
85
|
);
|
|
@@ -99,9 +98,8 @@ const configureCustomerAdapterEventListeners = (
|
|
|
99
98
|
'onCustomerAdapterDetachPaymentMethodCallback',
|
|
100
99
|
async ({ paymentMethodId }: { paymentMethodId: string }) => {
|
|
101
100
|
if (customerAdapter.detachPaymentMethod) {
|
|
102
|
-
const paymentMethod =
|
|
103
|
-
paymentMethodId
|
|
104
|
-
);
|
|
101
|
+
const paymentMethod =
|
|
102
|
+
await customerAdapter.detachPaymentMethod(paymentMethodId);
|
|
105
103
|
await NativeStripeSdk.customerAdapterDetachPaymentMethodCallback(
|
|
106
104
|
paymentMethod
|
|
107
105
|
);
|
|
@@ -4,6 +4,7 @@ import NativeStripeSdk from '../NativeStripeSdk';
|
|
|
4
4
|
import { isAndroid, shouldAttributeExpo } from '../helpers';
|
|
5
5
|
import type { AppInfo, InitStripeParams, InitialiseParams } from '../types';
|
|
6
6
|
import pjson from '../../package.json';
|
|
7
|
+
import { AppRegistry, Platform } from 'react-native';
|
|
7
8
|
|
|
8
9
|
const EXPO_PARTNER_ID = 'pp_partner_JBN7LkABco2yUu';
|
|
9
10
|
|
|
@@ -27,6 +28,22 @@ const appInfo: AppInfo = {
|
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
export const initStripe = async (params: InitStripeParams): Promise<void> => {
|
|
31
|
+
// On Android when the activity is paused, JS timers are paused,
|
|
32
|
+
// which causes network requests to hang indefinitely on new arch.
|
|
33
|
+
// To work around this, we register a headless task that will keep
|
|
34
|
+
// the JS runtime running while the Stripe UI is opened.
|
|
35
|
+
// This task is started and stopped by the native module.
|
|
36
|
+
if (Platform.OS === 'android') {
|
|
37
|
+
function stripeHeadlessTask() {
|
|
38
|
+
return new Promise<void>(() => {});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
AppRegistry.registerHeadlessTask(
|
|
42
|
+
'StripeKeepJsAwakeTask',
|
|
43
|
+
() => stripeHeadlessTask
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
30
47
|
const extendedParams: InitialiseParams = { ...params, appInfo };
|
|
31
48
|
NativeStripeSdk.initialise(extendedParams);
|
|
32
49
|
};
|
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/helpers.ts
CHANGED
|
@@ -2,7 +2,8 @@ import type React from 'react';
|
|
|
2
2
|
import type { StripeError } from './types';
|
|
3
3
|
|
|
4
4
|
import { Platform, NativeModules } from 'react-native';
|
|
5
|
-
|
|
5
|
+
// @ts-ignore TextInputState has no type definition
|
|
6
|
+
import TextInputState from 'react-native/Libraries/Components/TextInput/TextInputState';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Determines whether or not this library is being used inside of
|
package/src/types/Common.ts
CHANGED
|
@@ -47,6 +47,17 @@ 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
|
+
/** (Private Preview) This parameter is expected to be removed once we GA this feature
|
|
51
|
+
* When using customerSessions, allow users to update their saved cards
|
|
52
|
+
*/
|
|
53
|
+
updatePaymentMethodEnabled?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* By default, CustomerSheet will accept all supported cards by Stripe.
|
|
56
|
+
* You can specify card brands CustomerSheet should block or allow payment for by providing an array of those card brands.
|
|
57
|
+
* Note: This is only a client-side solution.
|
|
58
|
+
* Note: Card brand filtering is not currently supported in Link.
|
|
59
|
+
*/
|
|
60
|
+
cardBrandAcceptance?: PaymentSheet.CardBrandAcceptance;
|
|
50
61
|
};
|
|
51
62
|
|
|
52
63
|
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
|
};
|