@stripe/stripe-react-native 0.14.0 → 0.17.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/.editorconfig +15 -0
- package/.husky/pre-commit +4 -0
- package/CHANGELOG.md +55 -0
- package/android/build.gradle +1 -6
- package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormView.kt +2 -0
- package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +27 -6
- package/android/src/main/java/com/reactnativestripesdk/CardFormView.kt +34 -3
- package/android/src/main/java/com/reactnativestripesdk/CollectBankAccountLauncherFragment.kt +10 -1
- package/android/src/main/java/com/reactnativestripesdk/FinancialConnectionsSheetFragment.kt +284 -0
- package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonView.kt +17 -7
- package/android/src/main/java/com/reactnativestripesdk/GooglePayFragment.kt +8 -0
- package/android/src/main/java/com/reactnativestripesdk/GooglePayPaymentMethodLauncherFragment.kt +6 -2
- package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +12 -11
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +213 -367
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetAppearance.kt +1 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +45 -28
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +85 -46
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/PushProvisioningProxy.kt +2 -2
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/TapAndPayProxy.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/{Errors.kt → utils/Errors.kt} +5 -1
- package/android/src/main/java/com/reactnativestripesdk/{Extensions.kt → utils/Extensions.kt} +12 -1
- package/android/src/main/java/com/reactnativestripesdk/{Mappers.kt → utils/Mappers.kt} +8 -5
- package/android/src/main/java/com/reactnativestripesdk/utils/PostalCodeUtilities.kt +18 -0
- package/android/src/main/res/{drawable-night/googlepay_button_background.xml → drawable/googlepay_button_background_dark.xml} +1 -1
- package/android/src/main/res/{drawable-night/googlepay_button_content.xml → drawable/googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-night/googlepay_button_overlay.xml → drawable/googlepay_button_overlay_dark.xml} +0 -0
- package/android/src/main/res/{drawable-night/pay_with_googlepay_button_content.xml → drawable/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-ar-night/pay_with_googlepay_button_content.xml → drawable-ar/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-bg-night/pay_with_googlepay_button_content.xml → drawable-bg/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-ca-night/pay_with_googlepay_button_content.xml → drawable-ca/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-cs-night/pay_with_googlepay_button_content.xml → drawable-cs/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-da-night/pay_with_googlepay_button_content.xml → drawable-da/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-de-night/pay_with_googlepay_button_content.xml → drawable-de/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-el-night/pay_with_googlepay_button_content.xml → drawable-el/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-es-night/pay_with_googlepay_button_content.xml → drawable-es/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-et-night/pay_with_googlepay_button_content.xml → drawable-et/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-fi-night/pay_with_googlepay_button_content.xml → drawable-fi/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-fr-night/pay_with_googlepay_button_content.xml → drawable-fr/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-night-hdpi/googlepay_button_background_image.9.png → drawable-hdpi/googlepay_button_background_image_dark.9.png} +0 -0
- package/android/src/main/res/{drawable-hr-night/pay_with_googlepay_button_content.xml → drawable-hr/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-id-night/pay_with_googlepay_button_content.xml → drawable-id/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-it-night/pay_with_googlepay_button_content.xml → drawable-it/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-ja-night/pay_with_googlepay_button_content.xml → drawable-ja/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-ko-night/pay_with_googlepay_button_content.xml → drawable-ko/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-night-mdpi/googlepay_button_background_image.9.png → drawable-mdpi/googlepay_button_background_image_dark.9.png} +0 -0
- package/android/src/main/res/{drawable-ms-night/pay_with_googlepay_button_content.xml → drawable-ms/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-nl-night/pay_with_googlepay_button_content.xml → drawable-nl/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-no-night/pay_with_googlepay_button_content.xml → drawable-no/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-pl-night/pay_with_googlepay_button_content.xml → drawable-pl/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-pt-night/pay_with_googlepay_button_content.xml → drawable-pt/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-ru-night/pay_with_googlepay_button_content.xml → drawable-ru/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-sk-night/pay_with_googlepay_button_content.xml → drawable-sk/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-sl-night/pay_with_googlepay_button_content.xml → drawable-sl/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-sr-night/pay_with_googlepay_button_content.xml → drawable-sr/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-sv-night/pay_with_googlepay_button_content.xml → drawable-sv/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-th-night/pay_with_googlepay_button_content.xml → drawable-th/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-tr-night/pay_with_googlepay_button_content.xml → drawable-tr/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-uk-night/pay_with_googlepay_button_content.xml → drawable-uk/pay_with_googlepay_button_content_dark.xml} +0 -0
- package/android/src/main/res/{drawable-night-v21/googlepay_button_background.xml → drawable-v21/googlepay_button_background_dark.xml} +1 -1
- package/android/src/main/res/{drawable-night-xhdpi/googlepay_button_background_image.9.png → drawable-xhdpi/googlepay_button_background_image_dark.9.png} +0 -0
- package/android/src/main/res/{drawable-night-xxhdpi/googlepay_button_background_image.9.png → drawable-xxhdpi/googlepay_button_background_image_dark.9.png} +0 -0
- package/android/src/main/res/{drawable-night-xxxhdpi/googlepay_button_background_image.9.png → drawable-xxxhdpi/googlepay_button_background_image_dark.9.png} +0 -0
- package/android/src/main/res/{layout-night/googlepay_button.xml → layout/googlepay_button_dark.xml} +4 -4
- package/android/src/main/res/{layout-night/pay_with_googlepay_button.xml → layout/pay_with_googlepay_button_dark.xml} +4 -4
- package/ios/ApplePayUtils.swift +159 -0
- package/ios/CardFormView.swift +20 -0
- package/ios/Errors.swift +11 -0
- package/ios/FinancialConnections.swift +258 -0
- package/ios/Mappers.swift +20 -22
- package/ios/PaymentMethodFactory.swift +9 -0
- package/ios/StripeSdk.m +10 -1
- package/ios/StripeSdk.swift +67 -44
- package/ios/Tests/ApplePayUtilsTests.swift +214 -0
- 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/ApplePayButton.js +1 -1
- package/lib/commonjs/components/ApplePayButton.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/GooglePayButton.js +1 -1
- package/lib/commonjs/components/GooglePayButton.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/hooks/useApplePay.js +1 -1
- package/lib/commonjs/hooks/useApplePay.js.map +1 -1
- package/lib/commonjs/hooks/useConfirmPayment.js +1 -1
- package/lib/commonjs/hooks/useConfirmPayment.js.map +1 -1
- package/lib/commonjs/hooks/useConfirmSetupIntent.js +1 -1
- package/lib/commonjs/hooks/useConfirmSetupIntent.js.map +1 -1
- package/lib/commonjs/hooks/useFinancialConnectionsSheet.js +2 -0
- package/lib/commonjs/hooks/useFinancialConnectionsSheet.js.map +1 -0
- package/lib/commonjs/hooks/useGooglePay.js +1 -1
- package/lib/commonjs/hooks/useGooglePay.js.map +1 -1
- package/lib/commonjs/hooks/usePaymentSheet.js +1 -1
- package/lib/commonjs/hooks/usePaymentSheet.js.map +1 -1
- package/lib/commonjs/hooks/useStripe.js +1 -1
- package/lib/commonjs/hooks/useStripe.js.map +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/plugin/withStripe.js +1 -1
- package/lib/commonjs/plugin/withStripe.js.map +1 -1
- package/lib/commonjs/types/FinancialConnections.js +2 -0
- package/lib/commonjs/types/FinancialConnections.js.map +1 -0
- package/lib/commonjs/types/PaymentIntent.js.map +1 -1
- package/lib/commonjs/types/SetupIntent.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.map +1 -1
- package/lib/module/components/AddToWalletButton.js +1 -1
- package/lib/module/components/AddToWalletButton.js.map +1 -1
- package/lib/module/components/ApplePayButton.js +1 -1
- package/lib/module/components/ApplePayButton.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/GooglePayButton.js +1 -1
- package/lib/module/components/GooglePayButton.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/hooks/useApplePay.js +1 -1
- package/lib/module/hooks/useApplePay.js.map +1 -1
- package/lib/module/hooks/useConfirmPayment.js +1 -1
- package/lib/module/hooks/useConfirmPayment.js.map +1 -1
- package/lib/module/hooks/useConfirmSetupIntent.js +1 -1
- package/lib/module/hooks/useConfirmSetupIntent.js.map +1 -1
- package/lib/module/hooks/useFinancialConnectionsSheet.js +2 -0
- package/lib/module/hooks/useFinancialConnectionsSheet.js.map +1 -0
- package/lib/module/hooks/useGooglePay.js +1 -1
- package/lib/module/hooks/useGooglePay.js.map +1 -1
- package/lib/module/hooks/usePaymentSheet.js +1 -1
- package/lib/module/hooks/usePaymentSheet.js.map +1 -1
- package/lib/module/hooks/useStripe.js +1 -1
- package/lib/module/hooks/useStripe.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/plugin/withStripe.js +1 -1
- package/lib/module/plugin/withStripe.js.map +1 -1
- package/lib/module/types/FinancialConnections.js +2 -0
- package/lib/module/types/FinancialConnections.js.map +1 -0
- package/lib/module/types/PaymentIntent.js.map +1 -1
- package/lib/module/types/SetupIntent.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 +3 -1
- package/lib/typescript/src/components/CardForm.d.ts +1 -1
- package/lib/typescript/src/components/GooglePayButton.d.ts +2 -2
- package/lib/typescript/src/functions.d.ts +15 -1
- package/lib/typescript/src/hooks/useFinancialConnectionsSheet.d.ts +11 -0
- package/lib/typescript/src/hooks/useStripe.d.ts +3 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/types/ApplePay.d.ts +31 -5
- package/lib/typescript/src/types/FinancialConnections.d.ts +100 -0
- package/lib/typescript/src/types/PaymentIntent.d.ts +1 -0
- package/lib/typescript/src/types/PaymentMethod.d.ts +9 -1
- package/lib/typescript/src/types/PaymentSheet.d.ts +17 -15
- package/lib/typescript/src/types/SetupIntent.d.ts +1 -0
- package/lib/typescript/src/types/Token.d.ts +18 -7
- package/lib/typescript/src/types/index.d.ts +2 -1
- package/package.json +11 -23
- package/src/NativeStripeSdk.tsx +7 -0
- package/src/components/CardForm.tsx +2 -2
- package/src/components/GooglePayButton.tsx +8 -2
- package/src/functions.ts +58 -0
- package/src/hooks/useFinancialConnectionsSheet.tsx +34 -0
- package/src/hooks/useStripe.tsx +21 -0
- package/src/index.tsx +1 -0
- package/src/types/ApplePay.ts +39 -6
- package/src/types/FinancialConnections.ts +126 -0
- package/src/types/PaymentIntent.ts +1 -0
- package/src/types/PaymentMethod.ts +11 -1
- package/src/types/PaymentSheet.ts +34 -36
- package/src/types/SetupIntent.ts +1 -0
- package/src/types/Token.ts +24 -7
- package/src/types/index.ts +2 -0
- package/android/.DS_Store +0 -0
- package/android/.gradle/7.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.1/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/.gitignore +0 -3
- package/android/.idea/gradle.xml +0 -13
- package/android/.idea/misc.xml +0 -9
- package/android/.idea/modules/android.iml +0 -18
- package/android/.idea/modules.xml +0 -8
- package/android/.idea/vcs.xml +0 -6
- package/android/.idea/workspace.xml +0 -52
- package/android/local.properties +0 -8
- package/android/src/.DS_Store +0 -0
- package/android/src/androidTest/.DS_Store +0 -0
- package/android/src/androidTest/java/com/reactnativestripesdk/pushprovisioning/PushProvisioningProxyTest.kt +0 -35
- package/android/src/main/res/drawable-night/googlepay_button_no_shadow_background.xml +0 -6
- package/android/src/main/res/drawable-night-hdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
- package/android/src/main/res/drawable-night-mdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
- package/android/src/main/res/drawable-night-v21/googlepay_button_no_shadow_background.xml +0 -7
- package/android/src/main/res/drawable-night-xhdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
- package/android/src/main/res/drawable-night-xxhdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
- package/android/src/main/res/drawable-night-xxxhdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
- package/android/src/main/res/values-night/googlepay_strings.xml +0 -12
- package/ios/.DS_Store +0 -0
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcuserdata/charliecruzan.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/StripeSdk.xcodeproj/xcuserdata/charliecruzan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -22
- package/ios/StripeSdk.xcodeproj/xcuserdata/charliecruzan.xcuserdatad/xcschemes/xcschememanagement.plist +0 -27
- package/lib/typescript/e2e/buyNowPayLater.test.d.ts +0 -1
- package/lib/typescript/e2e/helpers.d.ts +0 -5
- package/lib/typescript/e2e/payments.test.d.ts +0 -1
- package/lib/typescript/e2e/paymentsWithRedirects.test.d.ts +0 -1
- package/lib/typescript/e2e/screenObject/BasicPaymentScreen.d.ts +0 -16
- package/lib/typescript/e2e/screenObject/HomeScreen.d.ts +0 -6
- package/lib/typescript/e2e/screenObject/components/BECSForm.d.ts +0 -8
- package/lib/typescript/e2e/screenObject/components/CardField.d.ts +0 -10
- package/lib/typescript/example/server/index.d.ts +0 -1
- package/lib/typescript/example/server/utils.d.ts +0 -11
- package/lib/typescript/example/src/App.d.ts +0 -45
- package/lib/typescript/example/src/Config.d.ts +0 -2
- package/lib/typescript/example/src/colors.d.ts +0 -8
- package/lib/typescript/example/src/components/Button.d.ts +0 -11
- package/lib/typescript/example/src/components/Collapse.d.ts +0 -6
- package/lib/typescript/example/src/components/PaymentScreen.d.ts +0 -7
- package/lib/typescript/example/src/helpers.d.ts +0 -1
- package/lib/typescript/example/src/screens/ACHPaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/ACHSetupScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/AfterpayClearpayPaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/AlipayPaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/ApplePayScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/AuBECSDebitPaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/AuBECSDebitSetupPaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/BancontactPaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/BancontactSetupFuturePaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/CVCReCollectionScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/CreateTokenScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/EPSPaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/FPXPaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/GiropayPaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/GooglePayScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/GrabPayPaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/HomeScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/IdealPaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/IdealSetupFuturePaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/KlarnaPaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/MultilineWebhookPaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/NoWebhookPaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/OxxoPaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/P24PaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/PayPalScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/PaymentResultScreen.d.ts +0 -8
- package/lib/typescript/example/src/screens/PaymentSheetAppearance.d.ts +0 -3
- package/lib/typescript/example/src/screens/PaymentsUICompleteScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/PaymentsUICustomScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/SepaPaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/SepaSetupFuturePaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/SetupFuturePaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/SofortPaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/SofortSetupFuturePaymentScreen.d.ts +0 -1
- package/lib/typescript/example/src/screens/WebhookPaymentScreen.d.ts +0 -1
- package/lib/typescript/src/plugin/__tests__/withStripe-test.d.ts +0 -1
- package/src/plugin/__tests__/fixtures/sample-AndroidManifest.xml +0 -24
- package/src/plugin/__tests__/withStripe-test.ts +0 -111
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export declare type CartSummaryItemType = 'final' | 'pending';
|
|
2
1
|
export declare type ContactFieldsType = 'emailAddress' | 'name' | 'phoneNumber' | 'phoneticName' | 'postalAddress';
|
|
3
2
|
export declare type AddressFields = 'street' | 'city' | 'subAdministrativeArea' | 'state' | 'postalCode' | 'country' | 'countryCode' | 'subLocality';
|
|
4
3
|
export interface ShippingMethod {
|
|
5
4
|
label: string;
|
|
6
5
|
amount: string;
|
|
7
|
-
|
|
6
|
+
isPending?: boolean;
|
|
8
7
|
identifier: string;
|
|
9
8
|
detail?: string;
|
|
10
9
|
}
|
|
@@ -32,11 +31,38 @@ export interface ShippingContact {
|
|
|
32
31
|
phoneNumber?: number;
|
|
33
32
|
postalAddress: PostalAddress;
|
|
34
33
|
}
|
|
35
|
-
export
|
|
34
|
+
export declare type CartSummaryItem = DeferredCartSummaryItem | ImmediateCartSummaryItem | RecurringCartSummaryItem;
|
|
35
|
+
export declare type CartSummaryItemType = 'Deferred' | 'Immediate' | 'Recurring';
|
|
36
|
+
/** Use this type for a payment that occurs in the future, such as a pre-order. Only available on iOS 15 and up, otherwise falls back to ImmediateCartSummaryItem. */
|
|
37
|
+
export declare type DeferredCartSummaryItem = {
|
|
38
|
+
paymentType: 'Deferred';
|
|
39
|
+
/** The unix timestamp of the date, in the future, of the payment. Measured in seconds. */
|
|
40
|
+
deferredDate: number;
|
|
36
41
|
label: string;
|
|
37
42
|
amount: string;
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
};
|
|
44
|
+
/** Use this type for payments that will occur immediately. */
|
|
45
|
+
export declare type ImmediateCartSummaryItem = {
|
|
46
|
+
paymentType: 'Immediate';
|
|
47
|
+
/** When creating items for estimates or charges whose final value is not yet known, set this to true. */
|
|
48
|
+
isPending?: boolean;
|
|
49
|
+
label: string;
|
|
50
|
+
amount: string;
|
|
51
|
+
};
|
|
52
|
+
/** Use this type for payments that occur more than once, such as a subscription. Only available on iOS 15 and up, otherwise falls back to ImmediateCartSummaryItem.*/
|
|
53
|
+
export declare type RecurringCartSummaryItem = {
|
|
54
|
+
paymentType: 'Recurring';
|
|
55
|
+
/** The amount of time – in calendar units such as day, month, or year – that represents a fraction of the total payment interval. For example, if you set the intervalUnit to 'month' and intervalCount to 3, then the payment interval is three months.*/
|
|
56
|
+
intervalUnit: 'minute' | 'hour' | 'day' | 'month' | 'year';
|
|
57
|
+
/** The number of interval units that make up the total payment interval. For example, if you set the intervalUnit to 'month' and intervalCount to 3, then the payment interval is three months.*/
|
|
58
|
+
intervalCount: number;
|
|
59
|
+
/** The unix timestamp of the start date. Measured in seconds. */
|
|
60
|
+
startDate?: number;
|
|
61
|
+
/** The unix timestamp of the end date. Measured in seconds. */
|
|
62
|
+
endDate?: number;
|
|
63
|
+
label: string;
|
|
64
|
+
amount: string;
|
|
65
|
+
};
|
|
40
66
|
export interface PresentParams {
|
|
41
67
|
cartItems: CartSummaryItem[];
|
|
42
68
|
country: string;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { BankAccount } from './Token';
|
|
2
|
+
import type { StripeError } from './Errors';
|
|
3
|
+
export declare type SessionResult = {
|
|
4
|
+
/** The updated Financial Connections Session object. */
|
|
5
|
+
session: Session;
|
|
6
|
+
error?: undefined;
|
|
7
|
+
} | {
|
|
8
|
+
session?: undefined;
|
|
9
|
+
error: StripeError<FinancialConnectionsSheetError>;
|
|
10
|
+
};
|
|
11
|
+
export declare type TokenResult = {
|
|
12
|
+
/** The updated Financial Connections Session object. */
|
|
13
|
+
session: Session;
|
|
14
|
+
/** The Stripe token object associated with the bank account. */
|
|
15
|
+
token: BankAccountToken;
|
|
16
|
+
error?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
session?: undefined;
|
|
19
|
+
token?: undefined;
|
|
20
|
+
error: StripeError<FinancialConnectionsSheetError>;
|
|
21
|
+
};
|
|
22
|
+
export declare type Session = {
|
|
23
|
+
/** A unique ID for this session. */
|
|
24
|
+
id: string;
|
|
25
|
+
/** The client secret for this session. */
|
|
26
|
+
clientSecret: string;
|
|
27
|
+
/** Has the value true if the object exists in live mode or the value false if the object exists in test mode. */
|
|
28
|
+
livemode: boolean;
|
|
29
|
+
/** The accounts that were collected as part of this Session. */
|
|
30
|
+
accounts: Array<Account>;
|
|
31
|
+
};
|
|
32
|
+
export declare type BankAccountToken = {
|
|
33
|
+
/** Bank account details. */
|
|
34
|
+
bankAccount: BankAccount | null;
|
|
35
|
+
/** Has the value true if the object exists in live mode or the value false if the object exists in test mode. */
|
|
36
|
+
livemode: boolean;
|
|
37
|
+
/** A unique ID for this token. */
|
|
38
|
+
id: string | null;
|
|
39
|
+
used: boolean;
|
|
40
|
+
type: 'BankAccount';
|
|
41
|
+
/** The UNIX timestamp (in milliseconds) of the date this token was created. */
|
|
42
|
+
created: number | null;
|
|
43
|
+
};
|
|
44
|
+
export declare type Account = {
|
|
45
|
+
/** A unique ID for this Financial Connections Account. */
|
|
46
|
+
id: string;
|
|
47
|
+
/** Has the value true if the object exists in live mode or the value false if the object exists in test mode. */
|
|
48
|
+
livemode: boolean;
|
|
49
|
+
displayName: string | null;
|
|
50
|
+
/** The current status of the account. Either active, inactive, or disconnected. */
|
|
51
|
+
status: AccountStatus;
|
|
52
|
+
institutionName: string;
|
|
53
|
+
last4: string | null;
|
|
54
|
+
/** The UNIX timestamp (in milliseconds) of the date this account was created. */
|
|
55
|
+
created: number;
|
|
56
|
+
/** The balance of this account. */
|
|
57
|
+
balance: Balance | null;
|
|
58
|
+
/** The last balance refresh. Includes the timestamp and the status. */
|
|
59
|
+
balanceRefresh: BalanceRefresh | null;
|
|
60
|
+
/** The category of this account, either cash, credit, investment, or other. */
|
|
61
|
+
category: Category;
|
|
62
|
+
/** The subcategory of this account, either checking, credit_card, line_of_credit, mortgage, savings, or other. */
|
|
63
|
+
subcategory: Subcategory;
|
|
64
|
+
/** Permissions requested for accounts collected during this session. */
|
|
65
|
+
permissions: Array<Permission> | null;
|
|
66
|
+
/** The supported payment method types for this account. */
|
|
67
|
+
supportedPaymentMethodTypes: Array<PaymentMethodType>;
|
|
68
|
+
};
|
|
69
|
+
export declare type AccountStatus = 'active' | 'inactive' | 'disconnected';
|
|
70
|
+
export declare type Category = 'cash' | 'credit' | 'investment' | 'other';
|
|
71
|
+
export declare type PaymentMethodType = 'us_bank_account' | 'link';
|
|
72
|
+
export declare type Subcategory = 'checking' | 'credit_card' | 'line_of_credit' | 'mortgage' | 'other' | 'savings';
|
|
73
|
+
export declare type Permission = 'balances' | 'ownership' | 'payment_method' | 'transactions' | 'account_numbers';
|
|
74
|
+
export declare type Balance = {
|
|
75
|
+
/** The UNIX timestamp (in milliseconds) of time that the external institution calculated this balance. */
|
|
76
|
+
asOf: number;
|
|
77
|
+
/** The type of this balance, either cash or credit. */
|
|
78
|
+
type: BalanceType;
|
|
79
|
+
/** The funds available to the account holder. Typically this is the current balance less any holds. Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Each value is an integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. */
|
|
80
|
+
cash: {
|
|
81
|
+
available: Map<String, number> | null;
|
|
82
|
+
};
|
|
83
|
+
/** The credit that has been used by the account holder. Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. */
|
|
84
|
+
credit: {
|
|
85
|
+
used: Map<String, number> | null;
|
|
86
|
+
};
|
|
87
|
+
/** The balances owed to (or by) the account holder. Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. */
|
|
88
|
+
current: Map<String, number>;
|
|
89
|
+
};
|
|
90
|
+
export declare type BalanceRefresh = {
|
|
91
|
+
status: BalanceRefreshStatus;
|
|
92
|
+
/** The UNIX timestamp (in milliseconds) of the time at which the last refresh attempt was initiated. */
|
|
93
|
+
lastAttemptedAt: number;
|
|
94
|
+
};
|
|
95
|
+
export declare type BalanceType = 'cash' | 'credit';
|
|
96
|
+
export declare type BalanceRefreshStatus = 'failed' | 'pending' | 'succeeded';
|
|
97
|
+
export declare enum FinancialConnectionsSheetError {
|
|
98
|
+
Failed = "Failed",
|
|
99
|
+
Canceled = "Canceled"
|
|
100
|
+
}
|
|
@@ -18,7 +18,7 @@ export interface Result {
|
|
|
18
18
|
Upi: UpiResult;
|
|
19
19
|
USBankAccount: USBankAccountResult;
|
|
20
20
|
}
|
|
21
|
-
export declare type CreateParams = CardParams | IdealParams | OxxoParams | P24Params | AlipayParams | GiropayParams | SepaParams | EpsParams | AuBecsDebitParams | SofortParams | GrabPayParams | FPXParams | AfterpayClearpayParams | KlarnaParams | BancontactParams | USBankAccountParams | PayPalParams;
|
|
21
|
+
export declare type CreateParams = CardParams | IdealParams | OxxoParams | P24Params | AlipayParams | GiropayParams | SepaParams | EpsParams | AuBecsDebitParams | SofortParams | GrabPayParams | FPXParams | AfterpayClearpayParams | KlarnaParams | BancontactParams | USBankAccountParams | PayPalParams | AffirmParams;
|
|
22
22
|
export declare type ConfirmParams = CreateParams;
|
|
23
23
|
export declare type CreateOptions = {
|
|
24
24
|
setupFutureUsage?: FutureUsage;
|
|
@@ -133,6 +133,14 @@ export interface AuBecsDebitParams {
|
|
|
133
133
|
formDetails: FormDetails;
|
|
134
134
|
};
|
|
135
135
|
}
|
|
136
|
+
export declare type AffirmParams = {
|
|
137
|
+
paymentMethodType: 'Affirm';
|
|
138
|
+
paymentMethodData?: {
|
|
139
|
+
/** Affirm requires that shipping is present for the payment to succeed because it significantly helps with loan approval rates. Shipping details can either be provided here or via the Payment Intent- https://stripe.com/docs/api/payment_intents/create#create_payment_intent-shipping. */
|
|
140
|
+
shippingDetails?: ShippingDetails;
|
|
141
|
+
billingDetails?: BillingDetails;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
136
144
|
/**
|
|
137
145
|
* If paymentMethodData is null, it is assumed that the bank account details have already been attached
|
|
138
146
|
* via `collectBankAccountForPayment` or `collectBankAccountForSetup`.
|
|
@@ -1,40 +1,42 @@
|
|
|
1
1
|
import type { BillingDetails } from './Common';
|
|
2
|
-
|
|
2
|
+
import type { CartSummaryItem } from './ApplePay';
|
|
3
|
+
export declare type SetupParams = ClientSecretParams & {
|
|
3
4
|
/** Your customer-facing business name. On Android, this is required and cannot be an empty string. */
|
|
4
5
|
merchantDisplayName: string;
|
|
5
6
|
customerId?: string;
|
|
6
7
|
customerEphemeralKeySecret?: string;
|
|
7
8
|
customFlow?: boolean;
|
|
9
|
+
/** iOS only. Enable Apple Pay in the Payment Sheet by passing an ApplePayParams object. */
|
|
10
|
+
applePay?: ApplePayParams;
|
|
11
|
+
/** Android only. Enable Google Pay in the Payment Sheet by passing a GooglePayParams object. */
|
|
12
|
+
googlePay?: GooglePayParams;
|
|
8
13
|
style?: 'alwaysLight' | 'alwaysDark' | 'automatic';
|
|
9
14
|
returnURL?: string;
|
|
10
15
|
defaultBillingDetails?: BillingDetails;
|
|
11
16
|
allowsDelayedPaymentMethods?: boolean;
|
|
12
|
-
} & {
|
|
13
17
|
appearance?: AppearanceParams;
|
|
14
18
|
};
|
|
15
|
-
declare type ClientSecretParams = {
|
|
19
|
+
export declare type ClientSecretParams = {
|
|
16
20
|
paymentIntentClientSecret: string;
|
|
17
21
|
setupIntentClientSecret?: undefined;
|
|
18
22
|
} | {
|
|
19
23
|
setupIntentClientSecret: string;
|
|
20
24
|
paymentIntentClientSecret?: undefined;
|
|
21
25
|
};
|
|
22
|
-
declare type ApplePayParams = {
|
|
23
|
-
|
|
26
|
+
export declare type ApplePayParams = {
|
|
27
|
+
/** The two-letter ISO 3166 code of the country of your business, e.g. "US" */
|
|
24
28
|
merchantCountryCode: string;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
/**
|
|
30
|
+
* An array of CartSummaryItem item objects that summarize the amount of the payment. If you're using a SetupIntent
|
|
31
|
+
* for a recurring payment, you should set this to display the amount you intend to charge. */
|
|
32
|
+
paymentSummaryItems?: CartSummaryItem[];
|
|
28
33
|
};
|
|
29
|
-
declare type GooglePayParams = {
|
|
30
|
-
|
|
34
|
+
export declare type GooglePayParams = {
|
|
35
|
+
/** The two-letter ISO 3166 code of the country of your business, e.g. "US" */
|
|
31
36
|
merchantCountryCode: string;
|
|
37
|
+
/** The three-letter ISO 4217 alphabetic currency code, e.g. "USD" or "EUR". Required in order to support Google Pay when processing a Setup Intent. */
|
|
32
38
|
currencyCode?: string;
|
|
33
|
-
|
|
34
|
-
} | {
|
|
35
|
-
googlePay?: false;
|
|
36
|
-
merchantCountryCode?: string;
|
|
37
|
-
currencyCode?: string;
|
|
39
|
+
/** Whether or not to use the Google Pay test environment. Set to `true` until you have applied for and been granted access to the Production environment. */
|
|
38
40
|
testEnv?: boolean;
|
|
39
41
|
};
|
|
40
42
|
/**
|
|
@@ -6,6 +6,7 @@ export interface Result {
|
|
|
6
6
|
id: string;
|
|
7
7
|
clientSecret: string;
|
|
8
8
|
lastSetupError: LastPaymentError | null;
|
|
9
|
+
/** The UNIX timestamp (in milliseconds) of the date this Setup Intent was created. */
|
|
9
10
|
created: string | null;
|
|
10
11
|
livemode: boolean;
|
|
11
12
|
paymentMethodId: string | null;
|
|
@@ -3,6 +3,7 @@ export declare type CardBrand = 'AmericanExpress' | 'DinersClub' | 'Discover' |
|
|
|
3
3
|
export declare type Type = 'Account' | 'BankAccount' | 'Card' | 'CvcUpdate' | 'Person' | 'Pii';
|
|
4
4
|
export interface Result {
|
|
5
5
|
id: string;
|
|
6
|
+
/** The UNIX timestamp (in milliseconds) of the date this token was created. */
|
|
6
7
|
created: string;
|
|
7
8
|
type: Type;
|
|
8
9
|
used: boolean;
|
|
@@ -11,14 +12,24 @@ export interface Result {
|
|
|
11
12
|
bankAccount?: BankAccount;
|
|
12
13
|
}
|
|
13
14
|
export interface BankAccount {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
/** A unique ID for this bank account. */
|
|
16
|
+
id: string;
|
|
17
|
+
/** The name of the associated bank. */
|
|
18
|
+
bankName: string | null;
|
|
19
|
+
/** The name of the person or business that owns the bank account. This field is required when attaching the bank account to a Customer object. */
|
|
20
|
+
accountHolderName: string | null;
|
|
21
|
+
/** The type of entity that holds the account. */
|
|
22
|
+
accountHolderType: BankAcccountHolderType | null;
|
|
23
|
+
/** The currency the bank account is in. This must be a country/currency pairing that Stripe supports. */
|
|
24
|
+
currency: string | null;
|
|
25
|
+
/** The country in which the bank account is located. */
|
|
26
|
+
country: string | null;
|
|
27
|
+
routingNumber: string | null;
|
|
28
|
+
status: BankAccountStatus | null;
|
|
29
|
+
fingerprint: string | null;
|
|
30
|
+
last4: string | null;
|
|
21
31
|
}
|
|
32
|
+
export declare type BankAccountStatus = 'Errored' | 'New' | 'Validated' | 'VerificationFailed' | 'Verified';
|
|
22
33
|
export interface Card {
|
|
23
34
|
country: string;
|
|
24
35
|
brand: CardBrand;
|
|
@@ -11,7 +11,8 @@ import * as AuBECSDebitFormComponent from './components/AuBECSDebitFormComponent
|
|
|
11
11
|
import * as CardFieldInput from './components/CardFieldInput';
|
|
12
12
|
import * as CardFormView from './components/CardFormView';
|
|
13
13
|
import * as Token from './Token';
|
|
14
|
-
|
|
14
|
+
import * as FinancialConnections from './FinancialConnections';
|
|
15
|
+
export { ApplePay, PaymentIntent, PaymentMethod, PaymentSheet, SetupIntent, ThreeDSecure, GooglePay, ApplePayButtonComponent, AuBECSDebitFormComponent, CardFieldInput, CardFormView, Token, FinancialConnections, };
|
|
15
16
|
export * from './Errors';
|
|
16
17
|
export { Address, BillingDetails } from './Common';
|
|
17
18
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stripe/stripe-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"author": "Stripe",
|
|
5
5
|
"description": "Stripe SDK for React Native",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
@@ -8,16 +8,6 @@
|
|
|
8
8
|
"types": "lib/typescript/src/index.d.ts",
|
|
9
9
|
"react-native": "src/index",
|
|
10
10
|
"source": "src/index",
|
|
11
|
-
"files": [
|
|
12
|
-
"src",
|
|
13
|
-
"lib",
|
|
14
|
-
"android",
|
|
15
|
-
"ios",
|
|
16
|
-
"cpp",
|
|
17
|
-
"app.plugin.js",
|
|
18
|
-
"stripe-react-native.podspec",
|
|
19
|
-
"jest"
|
|
20
|
-
],
|
|
21
11
|
"scripts": {
|
|
22
12
|
"test": "jest",
|
|
23
13
|
"typescript": "tsc --noEmit",
|
|
@@ -28,7 +18,7 @@
|
|
|
28
18
|
"pods": "cd example && npx pod-install --quiet",
|
|
29
19
|
"bootstrap": "yarn example && yarn && yarn pods",
|
|
30
20
|
"bootstrap-no-pods": "yarn example && yarn",
|
|
31
|
-
"docs": "yarn typedoc ./src/index.tsx --out ./docs/api-reference --tsconfig ./tsconfig.json --readme none",
|
|
21
|
+
"docs": "yarn typedoc ./src/index.tsx --out ./docs/api-reference --tsconfig ./tsconfig.json --readme none --sort source-order",
|
|
32
22
|
"run-example-ios": "cd example;ENVFILE=.env.ci react-native run-ios --configuration Release --simulator \"iPhone 13 (15.2)\"",
|
|
33
23
|
"run-example-android": "cd example;ENVFILE=.env.ci react-native run-android --variant=release",
|
|
34
24
|
"test:e2e:ios": "mkdir -p .tmp/screenshots && node ./run-appium-tests.js ios",
|
|
@@ -60,19 +50,19 @@
|
|
|
60
50
|
"@wdio/mocha-framework": "^7.16.15",
|
|
61
51
|
"@wdio/spec-reporter": "^7.16.14",
|
|
62
52
|
"@wdio/sync": "^7.16.15",
|
|
63
|
-
"appium": "^1.22.
|
|
53
|
+
"appium": "^1.22.3",
|
|
64
54
|
"appium-chromedriver": "4.26.2",
|
|
65
55
|
"eslint": "^7.32.0",
|
|
66
56
|
"eslint-config-prettier": "^6.11.0",
|
|
67
57
|
"eslint-plugin-prettier": "^3.1.3",
|
|
68
58
|
"expect-webdriverio": "^2.0.1",
|
|
69
|
-
"husky": "^
|
|
59
|
+
"husky": "^8.0.0",
|
|
70
60
|
"jest": "^26.6.3",
|
|
71
|
-
"metro-react-native-babel-preset": "^0.
|
|
61
|
+
"metro-react-native-babel-preset": "^0.70.3",
|
|
72
62
|
"mocha": "^8.3.2",
|
|
73
63
|
"prettier": "^2.0.5",
|
|
74
|
-
"react": "
|
|
75
|
-
"react-native": "0.
|
|
64
|
+
"react": "18.0.0",
|
|
65
|
+
"react-native": "0.69.2",
|
|
76
66
|
"ts-node": "^9.1.1",
|
|
77
67
|
"typedoc": "^0.22.12",
|
|
78
68
|
"typescript": "~4.4.4",
|
|
@@ -91,11 +81,6 @@
|
|
|
91
81
|
"<rootDir>/e2e"
|
|
92
82
|
]
|
|
93
83
|
},
|
|
94
|
-
"husky": {
|
|
95
|
-
"hooks": {
|
|
96
|
-
"pre-commit": "yarn lint && yarn typescript"
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
84
|
"eslintConfig": {
|
|
100
85
|
"extends": [
|
|
101
86
|
"@react-native-community",
|
|
@@ -155,6 +140,9 @@
|
|
|
155
140
|
]
|
|
156
141
|
},
|
|
157
142
|
"dependencies": {
|
|
158
|
-
"@expo/config-plugins": "^4.1.
|
|
143
|
+
"@expo/config-plugins": "^4.1.5"
|
|
144
|
+
},
|
|
145
|
+
"resolutions": {
|
|
146
|
+
"simple-plist": "1.3.1"
|
|
159
147
|
}
|
|
160
148
|
}
|
package/src/NativeStripeSdk.tsx
CHANGED
|
@@ -27,6 +27,7 @@ import type {
|
|
|
27
27
|
IsCardInWalletResult,
|
|
28
28
|
CanAddCardToWalletParams,
|
|
29
29
|
CanAddCardToWalletResult,
|
|
30
|
+
FinancialConnections,
|
|
30
31
|
} from './types';
|
|
31
32
|
|
|
32
33
|
type NativeStripeSdkType = {
|
|
@@ -96,6 +97,12 @@ type NativeStripeSdkType = {
|
|
|
96
97
|
isCardInWallet(params: {
|
|
97
98
|
cardLastFour: string;
|
|
98
99
|
}): Promise<IsCardInWalletResult>;
|
|
100
|
+
collectBankAccountToken(
|
|
101
|
+
clientSecret: string
|
|
102
|
+
): Promise<FinancialConnections.TokenResult>;
|
|
103
|
+
collectFinancialConnectionsAccounts(
|
|
104
|
+
clientSecret: string
|
|
105
|
+
): Promise<FinancialConnections.SessionResult>;
|
|
99
106
|
};
|
|
100
107
|
|
|
101
108
|
const { StripeSdk } = NativeModules;
|
|
@@ -33,11 +33,11 @@ export interface Props extends AccessibilityProps {
|
|
|
33
33
|
autofocus?: boolean;
|
|
34
34
|
testID?: string;
|
|
35
35
|
|
|
36
|
-
/** All styles except backgroundColor are Android only */
|
|
36
|
+
/** All styles except backgroundColor, cursorColor, borderColor, and borderRadius are Android only */
|
|
37
37
|
cardStyle?: CardFormView.Styles;
|
|
38
38
|
// isUserInteractionEnabled?: boolean;
|
|
39
39
|
|
|
40
|
-
// TODO: will make it public when
|
|
40
|
+
// TODO: will make it public when iOS SDK allows for this
|
|
41
41
|
// postalCodeEnabled?: boolean;
|
|
42
42
|
|
|
43
43
|
/** Android only */
|
|
@@ -11,11 +11,17 @@ import {
|
|
|
11
11
|
const GooglePayButtonNative = requireNativeComponent<any>('GooglePayButton');
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Google Pay Button Component Props
|
|
15
15
|
*/
|
|
16
16
|
export interface Props extends AccessibilityProps {
|
|
17
17
|
style?: StyleProp<ViewStyle>;
|
|
18
|
-
type?:
|
|
18
|
+
type?:
|
|
19
|
+
| 'pay'
|
|
20
|
+
| 'pay_shadow'
|
|
21
|
+
| 'standard'
|
|
22
|
+
| 'standard_shadow'
|
|
23
|
+
| 'pay_dark'
|
|
24
|
+
| 'standard_dark';
|
|
19
25
|
onPress(): void;
|
|
20
26
|
disabled?: boolean;
|
|
21
27
|
testID?: string;
|
package/src/functions.ts
CHANGED
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
IsCardInWalletResult,
|
|
36
36
|
CanAddCardToWalletParams,
|
|
37
37
|
CanAddCardToWalletResult,
|
|
38
|
+
FinancialConnections,
|
|
38
39
|
} from './types';
|
|
39
40
|
|
|
40
41
|
const APPLE_PAY_NOT_SUPPORTED_MESSAGE =
|
|
@@ -567,6 +568,63 @@ export const collectBankAccountForSetup = async (
|
|
|
567
568
|
}
|
|
568
569
|
};
|
|
569
570
|
|
|
571
|
+
/**
|
|
572
|
+
* Use collectBankAccountToken in the [Add a Financial Connections Account to a US Custom Connect](https://stripe.com/docs/financial-connections/connect-payouts) account flow.
|
|
573
|
+
* When called, it will load the Authentication Flow, an on-page modal UI which allows your user to securely link their external financial account for payouts.
|
|
574
|
+
* @param clientSecret The client_secret of the [Financial Connections Session](https://stripe.com/docs/api/financial_connections/session).
|
|
575
|
+
* @returns A promise that resolves to an object containing either `session` and `token` fields, or an error field.
|
|
576
|
+
*/
|
|
577
|
+
export const collectBankAccountToken = async (
|
|
578
|
+
clientSecret: string
|
|
579
|
+
): Promise<FinancialConnections.TokenResult> => {
|
|
580
|
+
try {
|
|
581
|
+
const { session, token, error } =
|
|
582
|
+
await NativeStripeSdk.collectBankAccountToken(clientSecret);
|
|
583
|
+
|
|
584
|
+
if (error) {
|
|
585
|
+
return {
|
|
586
|
+
error,
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
return {
|
|
590
|
+
session: session!,
|
|
591
|
+
token: token!,
|
|
592
|
+
};
|
|
593
|
+
} catch (error: any) {
|
|
594
|
+
return {
|
|
595
|
+
error: createError(error),
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* Use collectFinancialConnectionsAccounts in the [Collect an account to build data-powered products](https://stripe.com/docs/financial-connections/other-data-powered-products) flow.
|
|
602
|
+
* When called, it will load the Authentication Flow, an on-page modal UI which allows your user to securely link their external financial account.
|
|
603
|
+
* @param clientSecret The client_secret of the [Financial Connections Session](https://stripe.com/docs/api/financial_connections/session).
|
|
604
|
+
* @returns A promise that resolves to an object containing either a `session` field, or an error field.
|
|
605
|
+
*/
|
|
606
|
+
export const collectFinancialConnectionsAccounts = async (
|
|
607
|
+
clientSecret: string
|
|
608
|
+
): Promise<FinancialConnections.SessionResult> => {
|
|
609
|
+
try {
|
|
610
|
+
const { session, error } =
|
|
611
|
+
await NativeStripeSdk.collectFinancialConnectionsAccounts(clientSecret);
|
|
612
|
+
|
|
613
|
+
if (error) {
|
|
614
|
+
return {
|
|
615
|
+
error,
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
return {
|
|
619
|
+
session: session!,
|
|
620
|
+
};
|
|
621
|
+
} catch (error: any) {
|
|
622
|
+
return {
|
|
623
|
+
error: createError(error),
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
};
|
|
627
|
+
|
|
570
628
|
export const canAddCardToWallet = async (
|
|
571
629
|
params: CanAddCardToWalletParams
|
|
572
630
|
): Promise<CanAddCardToWalletResult> => {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { useStripe } from './useStripe';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* React hook for accessing functions on the Financial Connections sheet.
|
|
6
|
+
*
|
|
7
|
+
* Retuns the `collectBankAccountToken` and `collectFinancialConnectionsAccounts` functions, and a `loading` boolean that you can use
|
|
8
|
+
* to display loading state (like showing a spinner).
|
|
9
|
+
*/
|
|
10
|
+
export function useFinancialConnectionsSheet() {
|
|
11
|
+
const [loading, setLoading] = useState(false);
|
|
12
|
+
const { collectBankAccountToken, collectFinancialConnectionsAccounts } =
|
|
13
|
+
useStripe();
|
|
14
|
+
|
|
15
|
+
const _collectBankAccountToken = async (clientSecret: string) => {
|
|
16
|
+
setLoading(true);
|
|
17
|
+
const result = await collectBankAccountToken(clientSecret);
|
|
18
|
+
setLoading(false);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const _collectFinancialConnectionsAccounts = async (clientSecret: string) => {
|
|
23
|
+
setLoading(true);
|
|
24
|
+
const result = await collectFinancialConnectionsAccounts(clientSecret);
|
|
25
|
+
setLoading(false);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
collectBankAccountToken: _collectBankAccountToken,
|
|
31
|
+
collectFinancialConnectionsAccounts: _collectFinancialConnectionsAccounts,
|
|
32
|
+
loading,
|
|
33
|
+
};
|
|
34
|
+
}
|
package/src/hooks/useStripe.tsx
CHANGED
|
@@ -30,6 +30,7 @@ import type {
|
|
|
30
30
|
CollectBankAccountForPaymentResult,
|
|
31
31
|
CanAddCardToWalletParams,
|
|
32
32
|
CanAddCardToWalletResult,
|
|
33
|
+
FinancialConnections,
|
|
33
34
|
} from '../types';
|
|
34
35
|
import { useCallback, useEffect, useState } from 'react';
|
|
35
36
|
import { isiOS } from '../helpers';
|
|
@@ -60,6 +61,8 @@ import {
|
|
|
60
61
|
verifyMicrodepositsForPayment,
|
|
61
62
|
verifyMicrodepositsForSetup,
|
|
62
63
|
canAddCardToWallet,
|
|
64
|
+
collectBankAccountToken,
|
|
65
|
+
collectFinancialConnectionsAccounts,
|
|
63
66
|
} from '../functions';
|
|
64
67
|
|
|
65
68
|
/**
|
|
@@ -290,6 +293,22 @@ export function useStripe() {
|
|
|
290
293
|
[]
|
|
291
294
|
);
|
|
292
295
|
|
|
296
|
+
const _collectBankAccountToken = useCallback(
|
|
297
|
+
async (clientSecret: string): Promise<FinancialConnections.TokenResult> => {
|
|
298
|
+
return collectBankAccountToken(clientSecret);
|
|
299
|
+
},
|
|
300
|
+
[]
|
|
301
|
+
);
|
|
302
|
+
|
|
303
|
+
const _collectFinancialConnectionsAccounts = useCallback(
|
|
304
|
+
async (
|
|
305
|
+
clientSecret: string
|
|
306
|
+
): Promise<FinancialConnections.SessionResult> => {
|
|
307
|
+
return collectFinancialConnectionsAccounts(clientSecret);
|
|
308
|
+
},
|
|
309
|
+
[]
|
|
310
|
+
);
|
|
311
|
+
|
|
293
312
|
return {
|
|
294
313
|
retrievePaymentIntent: _retrievePaymentIntent,
|
|
295
314
|
retrieveSetupIntent: _retrieveSetupIntent,
|
|
@@ -317,5 +336,7 @@ export function useStripe() {
|
|
|
317
336
|
verifyMicrodepositsForPayment: _verifyMicrodepositsForPayment,
|
|
318
337
|
verifyMicrodepositsForSetup: _verifyMicrodepositsForSetup,
|
|
319
338
|
canAddCardToWallet: _canAddCardToWallet,
|
|
339
|
+
collectBankAccountToken: _collectBankAccountToken,
|
|
340
|
+
collectFinancialConnectionsAccounts: _collectFinancialConnectionsAccounts,
|
|
320
341
|
};
|
|
321
342
|
}
|
package/src/index.tsx
CHANGED
|
@@ -5,6 +5,7 @@ export { useStripe } from './hooks/useStripe';
|
|
|
5
5
|
export { useApplePay, Props as UseApplePayProps } from './hooks/useApplePay';
|
|
6
6
|
export { usePaymentSheet } from './hooks/usePaymentSheet';
|
|
7
7
|
export { useGooglePay } from './hooks/useGooglePay';
|
|
8
|
+
export { useFinancialConnectionsSheet } from './hooks/useFinancialConnectionsSheet';
|
|
8
9
|
|
|
9
10
|
//components
|
|
10
11
|
export {
|