@stripe/stripe-react-native 0.57.0 → 0.57.2
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/README.md +0 -8
- package/android/.idea/AndroidProjectSystem.xml +6 -0
- package/android/.idea/caches/deviceStreaming.xml +1029 -0
- package/android/.idea/compiler.xml +6 -0
- package/android/.idea/gradle.xml +19 -0
- package/android/.idea/migrations.xml +10 -0
- package/android/.idea/misc.xml +10 -0
- package/android/.idea/runConfigurations.xml +17 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/build.gradle +76 -118
- package/android/gradle.properties +1 -1
- package/android/local.properties +8 -0
- package/android/settings.gradle +2 -0
- package/android/spotless.gradle +1 -1
- package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormView.kt +20 -17
- package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +13 -11
- package/android/src/main/java/com/reactnativestripesdk/CardFormView.kt +17 -21
- package/android/src/main/java/com/reactnativestripesdk/CollectBankAccountLauncherManager.kt +2 -0
- package/android/src/main/java/com/reactnativestripesdk/CustomPaymentMethodActivity.kt +2 -0
- package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementView.kt +53 -11
- package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementViewManager.kt +105 -117
- package/android/src/main/java/com/reactnativestripesdk/EventEmitterCompat.kt +4 -8
- package/android/src/main/java/com/reactnativestripesdk/FakeOnrampSdkModule.kt +154 -0
- package/android/src/main/java/com/reactnativestripesdk/FinancialConnectionsSheetManager.kt +13 -15
- package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonView.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/GooglePayLauncherManager.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/GooglePayRequestHelper.kt +7 -5
- package/android/src/main/java/com/reactnativestripesdk/NavigationBarManager.kt +31 -0
- package/android/src/main/java/com/reactnativestripesdk/NavigationBarView.kt +120 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentElementConfig.kt +228 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherManager.kt +1 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +3 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentOptionDisplayDataMapper.kt +4 -6
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetAppearance.kt +73 -30
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetManager.kt +19 -245
- package/android/src/main/java/com/reactnativestripesdk/StripeAbstractComposeView.kt +53 -17
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +52 -14
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkPackage.kt +21 -2
- package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetView.kt +4 -4
- package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetViewManager.kt +2 -2
- package/android/src/main/java/com/reactnativestripesdk/customersheet/CustomerSheetManager.kt +15 -35
- package/android/src/main/java/com/reactnativestripesdk/customersheet/ReactNativeCustomerSessionProvider.kt +2 -1
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonManager.kt +5 -10
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.kt +90 -77
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/TapAndPayProxy.kt +6 -4
- package/android/src/main/java/com/reactnativestripesdk/utils/Errors.kt +13 -3
- package/android/src/main/java/com/reactnativestripesdk/utils/Extensions.kt +41 -0
- package/android/src/main/java/com/reactnativestripesdk/utils/KeepJsAwakeTask.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +92 -44
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/EmbeddedPaymentElementViewManagerDelegate.java +3 -0
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/EmbeddedPaymentElementViewManagerInterface.java +2 -0
- package/android/src/oldarch/java/com/reactnativestripesdk/NativeOnrampSdkModuleSpec.java +118 -0
- package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +4 -0
- package/android/src/onramp/java/com/reactnativestripesdk/OnrampSdkModule.kt +922 -0
- package/android/src/test/java/com/facebook/testutils/shadows/ShadowArguments.kt +29 -0
- package/android/src/test/java/com/reactnativestripesdk/EmbeddedPaymentElementViewManagerTest.kt +163 -0
- package/android/src/test/java/com/reactnativestripesdk/PaymentElementConfigTest.kt +976 -0
- package/android/src/test/java/com/reactnativestripesdk/PaymentSheetAppearanceTest.kt +801 -0
- package/android/src/test/java/com/reactnativestripesdk/PaymentSheetManagerTest.kt +523 -0
- package/android/src/test/java/com/reactnativestripesdk/addresssheet/AddressSheetViewTest.kt +551 -0
- package/android/src/test/java/com/reactnativestripesdk/mappers/MappersTest.kt +567 -0
- package/android/src/test/java/com/reactnativestripesdk/mappers/PaymentOptionDisplayDataMapperTest.kt +456 -0
- package/android/src/test/java/com/reactnativestripesdk/pushprovisioning/PushProvisioningProxyTest.kt +43 -0
- package/android/src/test/resources/robolectric.properties +2 -0
- package/ios/AddressSheet/AddressSheetUtils.swift +3 -3
- package/ios/AddressSheet/AddressSheetView.swift +25 -25
- package/ios/AddressSheet/AddressSheetViewManager.swift +2 -2
- package/ios/ApplePayButtonManager.swift +1 -1
- package/ios/ApplePayButtonView.swift +9 -10
- package/ios/ApplePayUtils.swift +51 -51
- package/ios/ApplePayViewController.swift +25 -29
- package/ios/AuBECSDebitFormManager.swift +1 -1
- package/ios/AuBECSDebitFormView.swift +13 -15
- package/ios/CardFieldManager.swift +4 -4
- package/ios/CardFieldView.swift +9 -9
- package/ios/CardFormManager.swift +3 -3
- package/ios/CardFormView.swift +28 -28
- package/ios/ConnectAccountOnboarding/ConnectAccountOnboardingView.swift +97 -0
- package/ios/ConnectAccountOnboarding/ConnectAccountOnboardingViewController.swift +133 -0
- package/ios/ConnectAccountOnboarding/ConnectAccountOnboardingViewManager.m +16 -0
- package/ios/ConnectAccountOnboarding/ConnectAccountOnboardingViewManager.swift +17 -0
- package/ios/CustomerSheet/CustomerSheetUtils.swift +15 -16
- package/ios/CustomerSheet/ReactNativeCustomerAdapter.swift +19 -19
- package/ios/EmbeddedPaymentElementView.swift +2 -2
- package/ios/Errors.swift +22 -23
- package/ios/FinancialConnections.swift +37 -37
- package/ios/Mappers.swift +210 -71
- package/ios/NavigationBarManager.m +13 -0
- package/ios/NavigationBarManager.swift +17 -0
- package/ios/NavigationBarView.swift +65 -0
- package/ios/NewArch/NavigationBarComponentView.h +10 -0
- package/ios/NewArch/NavigationBarComponentView.mm +86 -0
- package/ios/OldArch/StripeSdkEventEmitterCompat.h +1 -0
- package/ios/OldArch/StripeSdkEventEmitterCompat.m +7 -1
- package/ios/PaymentMethodFactory.swift +24 -24
- package/ios/PaymentOptionDisplayData+ReactNative.swift +4 -4
- package/ios/PaymentPassFinder.swift +9 -10
- package/ios/PaymentSheetAppearance.swift +137 -138
- package/ios/PushProvisioning/AddToWalletButtonManager.swift +2 -2
- package/ios/PushProvisioning/AddToWalletButtonView.swift +15 -17
- package/ios/PushProvisioning/PushProvisioningUtils.swift +11 -11
- package/ios/StripeContainerManager.swift +1 -1
- package/ios/StripeContainerView.swift +3 -3
- package/ios/StripeOnrampSdk.h +17 -0
- package/ios/StripeOnrampSdk.mm +158 -0
- package/ios/StripeSdk.mm +8 -0
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcuserdata/tianzhao.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/StripeSdk.xcodeproj/xcuserdata/tianzhao.xcuserdatad/xcschemes/xcschememanagement.plist +19 -0
- package/ios/StripeSdkEmitter.swift +4 -0
- package/ios/StripeSdkImpl+CustomerSheet.swift +30 -25
- package/ios/StripeSdkImpl+Embedded.swift +11 -9
- package/ios/StripeSdkImpl+PaymentSheet.swift +36 -34
- package/ios/StripeSdkImpl.swift +913 -185
- package/ios/UIColorExtension.swift +72 -0
- 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/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/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/connect/Components.js +2 -0
- package/lib/commonjs/connect/Components.js.map +1 -0
- package/lib/commonjs/connect/ConnectComponentsProvider.js +2 -0
- package/lib/commonjs/connect/ConnectComponentsProvider.js.map +1 -0
- package/lib/commonjs/connect/EmbeddedComponent.js +19 -0
- package/lib/commonjs/connect/EmbeddedComponent.js.map +1 -0
- package/lib/commonjs/connect/ModalCloseButton.js +2 -0
- package/lib/commonjs/connect/ModalCloseButton.js.map +1 -0
- package/lib/commonjs/connect/NavigationBar.js +2 -0
- package/lib/commonjs/connect/NavigationBar.js.map +1 -0
- package/lib/commonjs/connect/connectTypes.js +2 -0
- package/lib/commonjs/connect/connectTypes.js.map +1 -0
- package/lib/commonjs/events.js +1 -1
- package/lib/commonjs/events.js.map +1 -1
- package/lib/commonjs/helpers.js +1 -1
- package/lib/commonjs/helpers.js.map +1 -1
- package/lib/commonjs/hooks/useOnramp.js +2 -0
- package/lib/commonjs/hooks/useOnramp.js.map +1 -0
- 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/specs/NativeAddToWalletButton.js +1 -1
- package/lib/commonjs/specs/NativeAddToWalletButton.js.map +1 -1
- package/lib/commonjs/specs/NativeAddressSheet.js +1 -1
- package/lib/commonjs/specs/NativeAddressSheet.js.map +1 -1
- package/lib/commonjs/specs/NativeApplePayButton.js +1 -1
- package/lib/commonjs/specs/NativeApplePayButton.js.map +1 -1
- package/lib/commonjs/specs/NativeAuBECSDebitForm.js +1 -1
- package/lib/commonjs/specs/NativeAuBECSDebitForm.js.map +1 -1
- package/lib/commonjs/specs/NativeCardField.js +1 -1
- package/lib/commonjs/specs/NativeCardField.js.map +1 -1
- package/lib/commonjs/specs/NativeCardForm.js +1 -1
- package/lib/commonjs/specs/NativeCardForm.js.map +1 -1
- package/lib/commonjs/specs/NativeConnectAccountOnboardingView.js +2 -0
- package/lib/commonjs/specs/NativeConnectAccountOnboardingView.js.map +1 -0
- package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js +1 -1
- package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js.map +1 -1
- package/lib/commonjs/specs/NativeGooglePayButton.js +1 -1
- package/lib/commonjs/specs/NativeGooglePayButton.js.map +1 -1
- package/lib/commonjs/specs/NativeNavigationBar.js +2 -0
- package/lib/commonjs/specs/NativeNavigationBar.js.map +1 -0
- package/lib/commonjs/specs/NativeOnrampSdkModule.js +2 -0
- package/lib/commonjs/specs/NativeOnrampSdkModule.js.map +1 -0
- package/lib/commonjs/specs/NativeStripeContainer.js +1 -1
- package/lib/commonjs/specs/NativeStripeContainer.js.map +1 -1
- package/lib/commonjs/specs/NativeStripeSdkModule.js.map +1 -1
- package/lib/commonjs/types/EmbeddedPaymentElement.js +1 -1
- package/lib/commonjs/types/EmbeddedPaymentElement.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/Onramp.js +2 -0
- package/lib/commonjs/types/Onramp.js.map +1 -0
- package/lib/commonjs/types/PaymentSheet.js.map +1 -1
- package/lib/commonjs/types/index.js +1 -1
- package/lib/commonjs/types/index.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/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/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/connect/Components.js +2 -0
- package/lib/module/connect/Components.js.map +1 -0
- package/lib/module/connect/ConnectComponentsProvider.js +2 -0
- package/lib/module/connect/ConnectComponentsProvider.js.map +1 -0
- package/lib/module/connect/EmbeddedComponent.js +19 -0
- package/lib/module/connect/EmbeddedComponent.js.map +1 -0
- package/lib/module/connect/ModalCloseButton.js +2 -0
- package/lib/module/connect/ModalCloseButton.js.map +1 -0
- package/lib/module/connect/NavigationBar.js +2 -0
- package/lib/module/connect/NavigationBar.js.map +1 -0
- package/lib/module/connect/connectTypes.js +2 -0
- package/lib/module/connect/connectTypes.js.map +1 -0
- package/lib/module/events.js +1 -1
- package/lib/module/events.js.map +1 -1
- package/lib/module/helpers.js +1 -1
- package/lib/module/helpers.js.map +1 -1
- package/lib/module/hooks/useOnramp.js +2 -0
- package/lib/module/hooks/useOnramp.js.map +1 -0
- 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/specs/NativeAddToWalletButton.js +1 -1
- package/lib/module/specs/NativeAddToWalletButton.js.map +1 -1
- package/lib/module/specs/NativeAddressSheet.js +1 -1
- package/lib/module/specs/NativeAddressSheet.js.map +1 -1
- package/lib/module/specs/NativeApplePayButton.js +1 -1
- package/lib/module/specs/NativeApplePayButton.js.map +1 -1
- package/lib/module/specs/NativeAuBECSDebitForm.js +1 -1
- package/lib/module/specs/NativeAuBECSDebitForm.js.map +1 -1
- package/lib/module/specs/NativeCardField.js +1 -1
- package/lib/module/specs/NativeCardField.js.map +1 -1
- package/lib/module/specs/NativeCardForm.js +1 -1
- package/lib/module/specs/NativeCardForm.js.map +1 -1
- package/lib/module/specs/NativeConnectAccountOnboardingView.js +2 -0
- package/lib/module/specs/NativeConnectAccountOnboardingView.js.map +1 -0
- package/lib/module/specs/NativeEmbeddedPaymentElement.js +1 -1
- package/lib/module/specs/NativeEmbeddedPaymentElement.js.map +1 -1
- package/lib/module/specs/NativeGooglePayButton.js +1 -1
- package/lib/module/specs/NativeGooglePayButton.js.map +1 -1
- package/lib/module/specs/NativeNavigationBar.js +2 -0
- package/lib/module/specs/NativeNavigationBar.js.map +1 -0
- package/lib/module/specs/NativeOnrampSdkModule.js +2 -0
- package/lib/module/specs/NativeOnrampSdkModule.js.map +1 -0
- package/lib/module/specs/NativeStripeContainer.js +1 -1
- package/lib/module/specs/NativeStripeContainer.js.map +1 -1
- package/lib/module/specs/NativeStripeSdkModule.js.map +1 -1
- package/lib/module/types/EmbeddedPaymentElement.js +1 -1
- package/lib/module/types/EmbeddedPaymentElement.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/Onramp.js +2 -0
- package/lib/module/types/Onramp.js.map +1 -0
- package/lib/module/types/PaymentSheet.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/components/StripeProvider.d.ts.map +1 -1
- package/lib/typescript/src/connect/Components.d.ts +23 -0
- package/lib/typescript/src/connect/Components.d.ts.map +1 -0
- package/lib/typescript/src/connect/ConnectComponentsProvider.d.ts +22 -0
- package/lib/typescript/src/connect/ConnectComponentsProvider.d.ts.map +1 -0
- package/lib/typescript/src/connect/EmbeddedComponent.d.ts +18 -0
- package/lib/typescript/src/connect/EmbeddedComponent.d.ts.map +1 -0
- package/lib/typescript/src/connect/ModalCloseButton.d.ts +7 -0
- package/lib/typescript/src/connect/ModalCloseButton.d.ts.map +1 -0
- package/lib/typescript/src/connect/NavigationBar.d.ts +8 -0
- package/lib/typescript/src/connect/NavigationBar.d.ts.map +1 -0
- package/lib/typescript/src/connect/connectTypes.d.ts +464 -0
- package/lib/typescript/src/connect/connectTypes.d.ts.map +1 -0
- package/lib/typescript/src/events.d.ts +4 -0
- package/lib/typescript/src/events.d.ts.map +1 -1
- package/lib/typescript/src/functions.d.ts.map +1 -1
- package/lib/typescript/src/helpers.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useOnramp.d.ts +158 -0
- package/lib/typescript/src/hooks/useOnramp.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/plugin/withStripe.d.ts +15 -0
- package/lib/typescript/src/plugin/withStripe.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeConnectAccountOnboardingView.d.ts +14 -0
- package/lib/typescript/src/specs/NativeConnectAccountOnboardingView.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeEmbeddedPaymentElement.d.ts +1 -0
- package/lib/typescript/src/specs/NativeEmbeddedPaymentElement.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeNavigationBar.d.ts +11 -0
- package/lib/typescript/src/specs/NativeNavigationBar.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeOnrampSdkModule.d.ts +28 -0
- package/lib/typescript/src/specs/NativeOnrampSdkModule.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts +3 -0
- package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts.map +1 -1
- package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts.map +1 -1
- package/lib/typescript/src/types/Errors.d.ts +5 -0
- package/lib/typescript/src/types/Errors.d.ts.map +1 -1
- package/lib/typescript/src/types/Onramp.d.ts +275 -0
- package/lib/typescript/src/types/Onramp.d.ts.map +1 -0
- package/lib/typescript/src/types/PaymentSheet.d.ts +7 -0
- package/lib/typescript/src/types/PaymentSheet.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +7 -1
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/package.json +25 -14
- package/src/components/StripeProvider.tsx +5 -0
- package/src/connect/Components.tsx +279 -0
- package/src/connect/ConnectComponentsProvider.tsx +93 -0
- package/src/connect/EmbeddedComponent.tsx +407 -0
- package/src/connect/ModalCloseButton.tsx +44 -0
- package/src/connect/NavigationBar.tsx +29 -0
- package/src/connect/connectTypes.ts +626 -0
- package/src/events.ts +23 -0
- package/src/hooks/useOnramp.tsx +334 -0
- package/src/index.tsx +13 -0
- package/src/plugin/withStripe.ts +104 -7
- package/src/specs/NativeConnectAccountOnboardingView.ts +19 -0
- package/src/specs/NativeEmbeddedPaymentElement.ts +5 -1
- package/src/specs/NativeNavigationBar.ts +16 -0
- package/src/specs/NativeOnrampSdkModule.ts +47 -0
- package/src/specs/NativeStripeSdkModule.ts +5 -0
- package/src/types/EmbeddedPaymentElement.tsx +24 -3
- package/src/types/Errors.ts +6 -0
- package/src/types/Onramp.ts +317 -0
- package/src/types/PaymentSheet.ts +7 -0
- package/src/types/index.ts +8 -0
- package/stripe-react-native.podspec +20 -7
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import type { Address } from './Common';
|
|
2
|
+
import type { OnrampError, StripeError } from './Errors';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Configuration used to initialize and customize the crypto onramp experience.
|
|
6
|
+
*
|
|
7
|
+
* - `merchantDisplayName` is shown in Stripe-provided UI (e.g., Link, Identity).
|
|
8
|
+
* - `appearance` customizes colors and primary button styling for Stripe UI.
|
|
9
|
+
*/
|
|
10
|
+
export type Configuration = {
|
|
11
|
+
/** Merchant name to display in Stripe-provided UI. */
|
|
12
|
+
merchantDisplayName: string;
|
|
13
|
+
/** Appearance overrides for Stripe-provided UI used during onramp. */
|
|
14
|
+
appearance: LinkAppearance;
|
|
15
|
+
/** The identifier of the Stripe crypto customer object. */
|
|
16
|
+
cryptoCustomerId?: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Customization options for Link/Stripe-provided UI.
|
|
21
|
+
*/
|
|
22
|
+
export type LinkAppearance = {
|
|
23
|
+
/** Color overrides used when the device is in light mode. */
|
|
24
|
+
lightColors?: LinkColors;
|
|
25
|
+
/** Color overrides used when the device is in dark mode. */
|
|
26
|
+
darkColors?: LinkColors;
|
|
27
|
+
/** UI style preference for Stripe UI. */
|
|
28
|
+
style?: LinkStyle;
|
|
29
|
+
/** Primary button appearance overrides. */
|
|
30
|
+
primaryButton?: LinkPrimaryButton;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Color tokens used by Link/Stripe-provided UI.
|
|
35
|
+
*/
|
|
36
|
+
export type LinkColors = {
|
|
37
|
+
/** Primary brand color. */
|
|
38
|
+
primary: string;
|
|
39
|
+
/** Foreground content color to render on top of the primary color. */
|
|
40
|
+
contentOnPrimary: string;
|
|
41
|
+
/** Color used for selected borders and outlines. */
|
|
42
|
+
borderSelected: string;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* UI style preference for Stripe UI.
|
|
47
|
+
* - `AUTOMATIC`: Follow the system appearance.
|
|
48
|
+
* - `ALWAYS_LIGHT`: Always render a light appearance.
|
|
49
|
+
* - `ALWAYS_DARK`: Always render a dark appearance.
|
|
50
|
+
*/
|
|
51
|
+
export type LinkStyle = 'AUTOMATIC' | 'ALWAYS_LIGHT' | 'ALWAYS_DARK';
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Primary button appearance overrides.
|
|
55
|
+
*/
|
|
56
|
+
export type LinkPrimaryButton = {
|
|
57
|
+
/** Corner radius in dp/points. */
|
|
58
|
+
cornerRadius?: number;
|
|
59
|
+
/** Button height in dp/points. */
|
|
60
|
+
height?: number;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Information used to register a new Link user for crypto onramp.
|
|
65
|
+
*
|
|
66
|
+
* Notes:
|
|
67
|
+
* - `phone` must be in E.164 format (e.g., +12125551234).
|
|
68
|
+
* - `country` must be a two-letter ISO 3166-1 alpha-2 code.
|
|
69
|
+
* - `fullName` should be collected for users outside the US; otherwise optional.
|
|
70
|
+
*/
|
|
71
|
+
export type LinkUserInfo = {
|
|
72
|
+
/** The user's email address. */
|
|
73
|
+
email: string;
|
|
74
|
+
/** The user's phone in E.164 format (e.g., +12125551234). */
|
|
75
|
+
phone: string;
|
|
76
|
+
/** Two-letter country code (ISO 3166-1 alpha-2). */
|
|
77
|
+
country: string;
|
|
78
|
+
/** Full name of the user. Recommended for non-US users. */
|
|
79
|
+
fullName?: string;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Supported crypto networks for wallet address registration.
|
|
84
|
+
*/
|
|
85
|
+
export enum CryptoNetwork {
|
|
86
|
+
bitcoin = 'bitcoin',
|
|
87
|
+
ethereum = 'ethereum',
|
|
88
|
+
solana = 'solana',
|
|
89
|
+
polygon = 'polygon',
|
|
90
|
+
stellar = 'stellar',
|
|
91
|
+
avalanche = 'avalanche',
|
|
92
|
+
base = 'base',
|
|
93
|
+
aptos = 'aptos',
|
|
94
|
+
optimism = 'optimism',
|
|
95
|
+
worldchain = 'worldchain',
|
|
96
|
+
xrpl = 'xrpl',
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Represents a calendar date using day, month, and year components.
|
|
101
|
+
* Example: March 31st, 1975 -> { day: 31, month: 3, year: 1975 }
|
|
102
|
+
*/
|
|
103
|
+
export type DateOfBirth = {
|
|
104
|
+
/** Day of month. */
|
|
105
|
+
day: number;
|
|
106
|
+
/** Month of year (1-12). */
|
|
107
|
+
month: number;
|
|
108
|
+
/** Full year (e.g., 1975). */
|
|
109
|
+
year: number;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Know Your Customer (KYC) information required for crypto operations.
|
|
114
|
+
*
|
|
115
|
+
* Notes:
|
|
116
|
+
* - `idNumber` may be required depending on region/regulatory requirements (for US, this is SSN).
|
|
117
|
+
* - `address` fields are optional at the field level, but the object is required.
|
|
118
|
+
*/
|
|
119
|
+
export type KycInfo = {
|
|
120
|
+
/** Customer’s first name. */
|
|
121
|
+
firstName: string;
|
|
122
|
+
/** Customer’s last name. */
|
|
123
|
+
lastName: string;
|
|
124
|
+
/** Government ID number (e.g., SSN for US). May be required by region. */
|
|
125
|
+
idNumber?: string;
|
|
126
|
+
/** Customer’s date of birth. */
|
|
127
|
+
dateOfBirth: DateOfBirth;
|
|
128
|
+
/** Customer’s address. */
|
|
129
|
+
address: Address;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Result of KYC verification.
|
|
134
|
+
*/
|
|
135
|
+
export type VerifyKycResult =
|
|
136
|
+
| {
|
|
137
|
+
/** Verification was confirmed by the user. */
|
|
138
|
+
status: 'Confirmed';
|
|
139
|
+
error?: undefined;
|
|
140
|
+
}
|
|
141
|
+
| {
|
|
142
|
+
/** An updated address is required. */
|
|
143
|
+
status: 'UpdateAddress';
|
|
144
|
+
error?: undefined;
|
|
145
|
+
}
|
|
146
|
+
| {
|
|
147
|
+
status?: undefined;
|
|
148
|
+
/** Present if the verification failed with an error. */
|
|
149
|
+
error: StripeError<OnrampError>;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Common result for void-returning operations. Contains an optional error.
|
|
154
|
+
*/
|
|
155
|
+
export type VoidResult = {
|
|
156
|
+
/** Present if the operation failed. */
|
|
157
|
+
error?: StripeError<OnrampError>;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Result of Link authorization.
|
|
162
|
+
*
|
|
163
|
+
* - `Consented`: The user consented; includes `customerId`.
|
|
164
|
+
* - `Denied`: The user denied authorization.
|
|
165
|
+
* - Error variant: Contains a Stripe error.
|
|
166
|
+
*/
|
|
167
|
+
export type AuthorizeResult =
|
|
168
|
+
| {
|
|
169
|
+
/** Authorization was consented by the user. */
|
|
170
|
+
status: 'Consented';
|
|
171
|
+
/** The crypto customer ID associated with the Link user. */
|
|
172
|
+
customerId: string;
|
|
173
|
+
error?: undefined;
|
|
174
|
+
}
|
|
175
|
+
| {
|
|
176
|
+
/** Authorization was denied by the user. */
|
|
177
|
+
status: 'Denied';
|
|
178
|
+
customerId?: undefined;
|
|
179
|
+
error?: undefined;
|
|
180
|
+
}
|
|
181
|
+
| {
|
|
182
|
+
status?: undefined;
|
|
183
|
+
customerId?: undefined;
|
|
184
|
+
/** Present if the authorization failed with an error. */
|
|
185
|
+
error: StripeError<OnrampError>;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Result of checking whether an email corresponds to an existing Link account.
|
|
190
|
+
*/
|
|
191
|
+
export type HasLinkAccountResult =
|
|
192
|
+
| {
|
|
193
|
+
/** True if the email is associated with an existing Link consumer. */
|
|
194
|
+
hasLinkAccount: boolean;
|
|
195
|
+
error?: undefined;
|
|
196
|
+
}
|
|
197
|
+
| {
|
|
198
|
+
hasLinkAccount?: undefined;
|
|
199
|
+
/** Present if the lookup failed with an error. */
|
|
200
|
+
error: StripeError<OnrampError>;
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Result of registering a new Link user.
|
|
205
|
+
*/
|
|
206
|
+
export type RegisterLinkUserResult =
|
|
207
|
+
| {
|
|
208
|
+
/** The crypto customer ID for the newly registered Link user. */
|
|
209
|
+
customerId: string;
|
|
210
|
+
error?: undefined;
|
|
211
|
+
}
|
|
212
|
+
| {
|
|
213
|
+
customerId?: undefined;
|
|
214
|
+
/** Present if registration failed with an error. */
|
|
215
|
+
error: StripeError<OnrampError>;
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Result of authenticating an existing Link user.
|
|
220
|
+
*/
|
|
221
|
+
export type AuthenticateUserResult =
|
|
222
|
+
| {
|
|
223
|
+
/** The crypto customer ID after successful authentication. */
|
|
224
|
+
customerId: string;
|
|
225
|
+
error?: undefined;
|
|
226
|
+
}
|
|
227
|
+
| {
|
|
228
|
+
customerId?: undefined;
|
|
229
|
+
/** Present if authentication failed with an error. */
|
|
230
|
+
error: StripeError<OnrampError>;
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Describes the payment method currently selected by the user.
|
|
235
|
+
*/
|
|
236
|
+
export type PaymentMethodDisplayData = {
|
|
237
|
+
/**
|
|
238
|
+
* Payment method icon as a data URI PNG string (e.g., "data:image/png;base64,<...>").
|
|
239
|
+
* Suitable for rendering directly in an <Image> component.
|
|
240
|
+
*/
|
|
241
|
+
icon: string;
|
|
242
|
+
/** Payment method label, e.g., "Link" or "Apple Pay". */
|
|
243
|
+
label: string;
|
|
244
|
+
/** Details about the underlying payment method, e.g., "Visa Credit •••• 4242". */
|
|
245
|
+
sublabel?: string;
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Result of collecting or selecting a payment method to use for checkout.
|
|
250
|
+
*/
|
|
251
|
+
export type CollectPaymentMethodResult =
|
|
252
|
+
| {
|
|
253
|
+
/** Display data for the selected payment method. */
|
|
254
|
+
displayData: PaymentMethodDisplayData;
|
|
255
|
+
error?: undefined;
|
|
256
|
+
}
|
|
257
|
+
| {
|
|
258
|
+
displayData?: undefined;
|
|
259
|
+
/** Present if collection/selection failed with an error. */
|
|
260
|
+
error: StripeError<OnrampError>;
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Result of creating a crypto payment token for the currently selected payment method.
|
|
265
|
+
*/
|
|
266
|
+
export type CreateCryptoPaymentTokenResult =
|
|
267
|
+
| {
|
|
268
|
+
/** The crypto payment token ID. */
|
|
269
|
+
cryptoPaymentToken: string;
|
|
270
|
+
error?: undefined;
|
|
271
|
+
}
|
|
272
|
+
| {
|
|
273
|
+
cryptoPaymentToken?: undefined;
|
|
274
|
+
/** Present if token creation failed with an error. */
|
|
275
|
+
error: StripeError<OnrampError>;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* A representation of the crypto payment token, which contains details about the payment method used.
|
|
280
|
+
*/
|
|
281
|
+
export type CryptoPaymentToken =
|
|
282
|
+
| {
|
|
283
|
+
card: {
|
|
284
|
+
/** The card brand (e.g., "visa", "mastercard"). Used to determine the visual brand. */
|
|
285
|
+
brand: string;
|
|
286
|
+
|
|
287
|
+
/** The funding source of the card (e.g., "credit", "debit"). */
|
|
288
|
+
funding: string;
|
|
289
|
+
|
|
290
|
+
/** The last four digits of the card number. */
|
|
291
|
+
last4: string;
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
| {
|
|
295
|
+
us_bank_account: {
|
|
296
|
+
/** The name of the bank (e.g., "Chase", "Bank of America"). */
|
|
297
|
+
bank_name?: string | null | undefined;
|
|
298
|
+
|
|
299
|
+
/** The last four digits of the bank account number. */
|
|
300
|
+
last4: string;
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Result of retrieving information about a payment method for display.
|
|
306
|
+
*/
|
|
307
|
+
export type PaymentDisplayDataResult =
|
|
308
|
+
| {
|
|
309
|
+
/** Display data for the selected payment method. */
|
|
310
|
+
displayData: PaymentMethodDisplayData;
|
|
311
|
+
error?: undefined;
|
|
312
|
+
}
|
|
313
|
+
| {
|
|
314
|
+
displayData?: undefined;
|
|
315
|
+
/** Present if collection/selection failed with an error. */
|
|
316
|
+
error: StripeError<OnrampError>;
|
|
317
|
+
};
|
|
@@ -599,6 +599,13 @@ export type IntentConfiguration = {
|
|
|
599
599
|
mode: Mode;
|
|
600
600
|
/* A list of payment method types to display to the customer. If undefined or empty, we dynamically determine the payment methods using your Stripe Dashboard settings. */
|
|
601
601
|
paymentMethodTypes?: Array<string>;
|
|
602
|
+
/** The connected account whose payment method configurations will apply to the PaymentSheet session.
|
|
603
|
+
* Affects the allowed payment methods and whether card brand choice is enabled.
|
|
604
|
+
* If saved, the payment method will be saved to your platform account. See our
|
|
605
|
+
* [PaymentIntent docs](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-on_behalf_of)
|
|
606
|
+
* for more information.
|
|
607
|
+
*/
|
|
608
|
+
onBehalfOf?: string;
|
|
602
609
|
};
|
|
603
610
|
|
|
604
611
|
export type Mode = PaymentMode | SetupMode;
|
package/src/types/index.ts
CHANGED
|
@@ -25,6 +25,7 @@ import * as CardFormView from './components/CardFormView';
|
|
|
25
25
|
import * as Token from './Token';
|
|
26
26
|
import * as FinancialConnections from './FinancialConnections';
|
|
27
27
|
import * as PlatformPay from './PlatformPay';
|
|
28
|
+
import * as Onramp from './Onramp';
|
|
28
29
|
import * as ConfirmationToken from './ConfirmationToken';
|
|
29
30
|
|
|
30
31
|
export {
|
|
@@ -40,6 +41,7 @@ export {
|
|
|
40
41
|
Token,
|
|
41
42
|
FinancialConnections,
|
|
42
43
|
PlatformPay,
|
|
44
|
+
Onramp,
|
|
43
45
|
ConfirmationToken,
|
|
44
46
|
};
|
|
45
47
|
|
|
@@ -280,3 +282,9 @@ export type CollectBankAccountForSetupResult =
|
|
|
280
282
|
setupIntent?: undefined;
|
|
281
283
|
error: StripeError<CollectBankAccountError>;
|
|
282
284
|
};
|
|
285
|
+
|
|
286
|
+
export type PaymentOptionData = {
|
|
287
|
+
icon: string; // base64 string
|
|
288
|
+
label: string;
|
|
289
|
+
sublabel?: string;
|
|
290
|
+
};
|
|
@@ -37,13 +37,26 @@ Pod::Spec.new do |s|
|
|
|
37
37
|
test_spec.source_files = 'ios/Tests/**/*.{m,swift}'
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
s.
|
|
40
|
+
if fabric_enabled
|
|
41
|
+
s.default_subspecs = 'Core', 'NewArch'
|
|
42
|
+
else
|
|
43
|
+
s.default_subspecs = 'Core'
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
s.subspec 'Core' do |core|
|
|
47
|
+
core.dependency 'React-Core'
|
|
48
|
+
core.dependency 'Stripe', stripe_version
|
|
49
|
+
core.dependency 'StripePaymentSheet', stripe_version
|
|
50
|
+
core.dependency 'StripePayments', stripe_version
|
|
51
|
+
core.dependency 'StripePaymentsUI', stripe_version
|
|
52
|
+
core.dependency 'StripeApplePay', stripe_version
|
|
53
|
+
core.dependency 'StripeFinancialConnections', stripe_version
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
s.subspec 'Onramp' do |onramp|
|
|
57
|
+
onramp.dependency 'stripe-react-native/Core'
|
|
58
|
+
onramp.dependency 'StripeCryptoOnramp', stripe_version
|
|
59
|
+
end
|
|
47
60
|
|
|
48
61
|
if fabric_enabled
|
|
49
62
|
install_modules_dependencies(s)
|