@stripe/stripe-react-native 0.63.0 → 0.64.1
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 +2 -2
- package/android/build.gradle +2 -2
- package/android/detekt/detekt-baseline.xml +81 -0
- package/android/detekt/detekt.gradle +45 -0
- package/android/detekt/detekt.yml +722 -0
- package/android/gradle.properties +4 -4
- package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormView.kt +3 -1
- package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormViewManager.kt +2 -1
- package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +5 -1
- package/android/src/main/java/com/reactnativestripesdk/CurrencySelectorElementView.kt +26 -0
- package/android/src/main/java/com/reactnativestripesdk/CurrencySelectorElementViewManager.kt +42 -0
- package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementView.kt +105 -49
- package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementViewManager.kt +72 -12
- package/android/src/main/java/com/reactnativestripesdk/FinancialConnectionsSheetManager.kt +8 -4
- package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonManager.kt +2 -1
- package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonView.kt +26 -11
- package/android/src/main/java/com/reactnativestripesdk/GooglePayLauncherManager.kt +2 -1
- package/android/src/main/java/com/reactnativestripesdk/NavigationBarView.kt +14 -5
- package/android/src/main/java/com/reactnativestripesdk/PaymentElementConfig.kt +6 -2
- package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherManager.kt +2 -2
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +24 -1
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodMessagingElementConfig.kt +7 -4
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodMessagingElementViewManager.kt +2 -1
- package/android/src/main/java/com/reactnativestripesdk/PaymentOptionDisplayDataMapper.kt +8 -4
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetAppearance.kt +9 -3
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetManager.kt +110 -29
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +256 -12
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkPackage.kt +6 -5
- package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressLauncherManager.kt +2 -1
- package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetView.kt +3 -1
- package/android/src/main/java/com/reactnativestripesdk/customersheet/CustomerSheetManager.kt +6 -2
- package/android/src/main/java/com/reactnativestripesdk/customersheet/ReactNativeCustomerAdapter.kt +3 -1
- package/android/src/main/java/com/reactnativestripesdk/customersheet/ReactNativeCustomerSessionProvider.kt +2 -1
- package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonManager.kt +2 -1
- package/android/src/main/java/com/reactnativestripesdk/utils/CheckoutAddressUpdate.kt +45 -0
- package/android/src/main/java/com/reactnativestripesdk/utils/CheckoutMappers.kt +101 -0
- package/android/src/main/java/com/reactnativestripesdk/utils/Errors.kt +4 -2
- package/android/src/main/java/com/reactnativestripesdk/utils/Extensions.kt +5 -1
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +31 -17
- package/android/src/main/java/com/reactnativestripesdk/utils/PostalCodeUtilities.kt +2 -1
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/EmbeddedPaymentElementViewManagerDelegate.java +6 -0
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/EmbeddedPaymentElementViewManagerInterface.java +2 -0
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/StripeCurrencySelectorElementManagerDelegate.java +35 -0
- package/android/src/oldarch/java/com/facebook/react/viewmanagers/StripeCurrencySelectorElementManagerInterface.java +18 -0
- package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +44 -0
- package/android/src/onramp/java/com/reactnativestripesdk/OnrampMappers.kt +43 -0
- package/android/src/onramp/java/com/reactnativestripesdk/OnrampSdkModule.kt +5 -1
- package/android/src/test/java/com/reactnativestripesdk/PaymentMethodMessagingElementConfigTest.kt +3 -3
- package/android/src/test/java/com/reactnativestripesdk/mappers/MappersTest.kt +93 -0
- package/android/src/test/java/com/reactnativestripesdk/mappers/OnrampMappersTest.kt +336 -0
- package/android/src/test/java/com/reactnativestripesdk/mappers/PaymentOptionDisplayDataMapperTest.kt +9 -4
- package/android/src/test/java/com/reactnativestripesdk/utils/CheckoutMappersTest.kt +89 -0
- package/android/src/test/java/com/reactnativestripesdk/utils/CheckoutTestFixtures.java +49 -0
- package/ios/AddressSheet/AddressSheetUtils.swift +23 -0
- package/ios/AddressSheet/AddressSheetView.swift +9 -14
- package/ios/ConnectAccountOnboarding/ConnectAccountOnboardingViewController.swift +6 -8
- package/ios/CurrencySelectorElementManager.m +9 -0
- package/ios/CurrencySelectorElementManager.swift +12 -0
- package/ios/CurrencySelectorElementView.swift +24 -0
- package/ios/Mappers+Checkout.swift +193 -0
- package/ios/Mappers.swift +74 -5
- package/ios/NewArch/EmbeddedPaymentElementViewComponentView.mm +16 -2
- package/ios/NewArch/StripeCurrencySelectorElementComponentView.h +10 -0
- package/ios/NewArch/StripeCurrencySelectorElementComponentView.mm +75 -0
- package/ios/PaymentMethodFactory.swift +19 -0
- package/ios/PaymentMethodMessagingElementConfig.swift +6 -3
- package/ios/PaymentMethodMessagingElementView.swift +19 -0
- package/ios/StripeSdk-Bridging-Header.h +1 -0
- package/ios/StripeSdk.mm +124 -1
- package/ios/StripeSdkImpl+Checkout.swift +308 -0
- package/ios/StripeSdkImpl+Embedded.swift +108 -27
- package/ios/StripeSdkImpl+PaymentSheet.swift +18 -2
- package/ios/StripeSdkImpl.swift +41 -103
- package/ios/StripeSwiftInterop.h +1 -0
- package/jest/mock.js +16 -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/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/CurrencySelectorElement.js +2 -0
- package/lib/commonjs/components/CurrencySelectorElement.js.map +1 -0
- package/lib/commonjs/components/PaymentMethodMessagingElement.js +2 -0
- package/lib/commonjs/components/PaymentMethodMessagingElement.js.map +1 -0
- 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 +1 -1
- package/lib/commonjs/connect/Components.js.map +1 -1
- package/lib/commonjs/connect/ConnectComponentsProvider.js +1 -1
- package/lib/commonjs/connect/ConnectComponentsProvider.js.map +1 -1
- package/lib/commonjs/connect/EmbeddedComponent.js +1 -1
- package/lib/commonjs/connect/EmbeddedComponent.js.map +1 -1
- package/lib/commonjs/connect/ModalCloseButton.js +1 -1
- package/lib/commonjs/connect/ModalCloseButton.js.map +1 -1
- package/lib/commonjs/connect/NavigationBar.js +1 -1
- package/lib/commonjs/connect/NavigationBar.js.map +1 -1
- package/lib/commonjs/connect/testUtils.js +1 -1
- package/lib/commonjs/connect/testUtils.js.map +1 -1
- package/lib/commonjs/events.js +1 -1
- package/lib/commonjs/events.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/hooks/useCheckout.js +2 -0
- package/lib/commonjs/hooks/useCheckout.js.map +1 -0
- package/lib/commonjs/hooks/useOnramp.js +1 -1
- package/lib/commonjs/hooks/useOnramp.js.map +1 -1
- package/lib/commonjs/index.js +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/specs/NativeAddToWalletButton.js +1 -1
- package/lib/commonjs/specs/NativeAddressSheet.js +1 -1
- package/lib/commonjs/specs/NativeApplePayButton.js +1 -1
- package/lib/commonjs/specs/NativeAuBECSDebitForm.js +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 +1 -1
- package/lib/commonjs/specs/NativeCurrencySelectorElement.js +2 -0
- package/lib/commonjs/specs/NativeCurrencySelectorElement.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/NativeNavigationBar.js +1 -1
- package/lib/commonjs/specs/NativeOnrampSdkModule.js +1 -1
- package/lib/commonjs/specs/NativeOnrampSdkModule.js.map +1 -1
- package/lib/commonjs/specs/NativePaymentMethodMessagingElement.js +1 -1
- package/lib/commonjs/specs/NativePaymentMethodMessagingElement.js.map +1 -1
- package/lib/commonjs/specs/NativeStripeContainer.js +1 -1
- package/lib/commonjs/specs/NativeStripeSdkModule.js.map +1 -1
- package/lib/commonjs/types/Checkout.js +2 -0
- package/lib/commonjs/types/Checkout.js.map +1 -0
- package/lib/commonjs/types/EmbeddedPaymentElement.js +1 -1
- package/lib/commonjs/types/EmbeddedPaymentElement.js.map +1 -1
- package/lib/commonjs/types/Onramp.js.map +1 -1
- package/lib/commonjs/types/PaymentIntent.js.map +1 -1
- package/lib/commonjs/types/PaymentSheet.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/CurrencySelectorElement.js +2 -0
- package/lib/module/components/CurrencySelectorElement.js.map +1 -0
- package/lib/module/components/PaymentMethodMessagingElement.js +2 -0
- package/lib/module/components/PaymentMethodMessagingElement.js.map +1 -0
- 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 +1 -1
- package/lib/module/connect/Components.js.map +1 -1
- package/lib/module/connect/ConnectComponentsProvider.js +1 -1
- package/lib/module/connect/ConnectComponentsProvider.js.map +1 -1
- package/lib/module/connect/EmbeddedComponent.js +1 -1
- package/lib/module/connect/EmbeddedComponent.js.map +1 -1
- package/lib/module/connect/ModalCloseButton.js +1 -1
- package/lib/module/connect/ModalCloseButton.js.map +1 -1
- package/lib/module/connect/NavigationBar.js +1 -1
- package/lib/module/connect/NavigationBar.js.map +1 -1
- package/lib/module/connect/testUtils.js +1 -1
- package/lib/module/connect/testUtils.js.map +1 -1
- package/lib/module/events.js +1 -1
- package/lib/module/events.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/hooks/useCheckout.js +2 -0
- package/lib/module/hooks/useCheckout.js.map +1 -0
- package/lib/module/hooks/useOnramp.js +1 -1
- package/lib/module/hooks/useOnramp.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/specs/NativeAddToWalletButton.js +1 -1
- package/lib/module/specs/NativeAddressSheet.js +1 -1
- package/lib/module/specs/NativeApplePayButton.js +1 -1
- package/lib/module/specs/NativeAuBECSDebitForm.js +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 +1 -1
- package/lib/module/specs/NativeCurrencySelectorElement.js +2 -0
- package/lib/module/specs/NativeCurrencySelectorElement.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/NativeNavigationBar.js +1 -1
- package/lib/module/specs/NativeOnrampSdkModule.js +1 -1
- package/lib/module/specs/NativeOnrampSdkModule.js.map +1 -1
- package/lib/module/specs/NativePaymentMethodMessagingElement.js +1 -1
- package/lib/module/specs/NativePaymentMethodMessagingElement.js.map +1 -1
- package/lib/module/specs/NativeStripeContainer.js +1 -1
- package/lib/module/specs/NativeStripeSdkModule.js.map +1 -1
- package/lib/module/types/Checkout.js +2 -0
- package/lib/module/types/Checkout.js.map +1 -0
- package/lib/module/types/EmbeddedPaymentElement.js +1 -1
- package/lib/module/types/EmbeddedPaymentElement.js.map +1 -1
- package/lib/module/types/Onramp.js.map +1 -1
- package/lib/module/types/PaymentIntent.js.map +1 -1
- package/lib/module/types/PaymentSheet.js.map +1 -1
- package/lib/typescript/src/components/CurrencySelectorElement.d.ts +62 -0
- package/lib/typescript/src/components/CurrencySelectorElement.d.ts.map +1 -0
- package/lib/typescript/src/components/PaymentMethodMessagingElement.d.ts +41 -0
- package/lib/typescript/src/components/PaymentMethodMessagingElement.d.ts.map +1 -0
- package/lib/typescript/src/connect/testUtils.d.ts +4 -0
- package/lib/typescript/src/connect/testUtils.d.ts.map +1 -1
- package/lib/typescript/src/events.d.ts +11 -0
- package/lib/typescript/src/events.d.ts.map +1 -1
- package/lib/typescript/src/functions.d.ts +2 -0
- package/lib/typescript/src/functions.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useCheckout.d.ts +21 -0
- package/lib/typescript/src/hooks/useCheckout.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useOnramp.d.ts +9 -3
- package/lib/typescript/src/hooks/useOnramp.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeCurrencySelectorElement.d.ts +25 -0
- package/lib/typescript/src/specs/NativeCurrencySelectorElement.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeEmbeddedPaymentElement.d.ts +5 -1
- package/lib/typescript/src/specs/NativeEmbeddedPaymentElement.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeOnrampSdkModule.d.ts +1 -1
- package/lib/typescript/src/specs/NativeOnrampSdkModule.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativePaymentMethodMessagingElement.d.ts +1 -6
- package/lib/typescript/src/specs/NativePaymentMethodMessagingElement.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts +19 -2
- package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts.map +1 -1
- package/lib/typescript/src/types/Checkout.d.ts +336 -0
- package/lib/typescript/src/types/Checkout.d.ts.map +1 -0
- package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts +36 -1
- package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts.map +1 -1
- package/lib/typescript/src/types/NextAction.d.ts +8 -1
- package/lib/typescript/src/types/NextAction.d.ts.map +1 -1
- package/lib/typescript/src/types/Onramp.d.ts +40 -1
- package/lib/typescript/src/types/Onramp.d.ts.map +1 -1
- package/lib/typescript/src/types/PaymentIntent.d.ts +11 -1
- package/lib/typescript/src/types/PaymentIntent.d.ts.map +1 -1
- package/lib/typescript/src/types/PaymentMethod.d.ts +10 -6
- package/lib/typescript/src/types/PaymentMethod.d.ts.map +1 -1
- package/lib/typescript/src/types/PaymentSheet.d.ts +22 -6
- package/lib/typescript/src/types/PaymentSheet.d.ts.map +1 -1
- package/lib/typescript/src/types/components/PaymentMethodMessagingElementComponent.d.ts +16 -1
- package/lib/typescript/src/types/components/PaymentMethodMessagingElementComponent.d.ts.map +1 -1
- package/package.json +21 -7
- package/src/components/CurrencySelectorElement.tsx +95 -0
- package/src/components/PaymentMethodMessagingElement.tsx +109 -0
- package/src/components/StripeProvider.tsx +1 -1
- package/src/connect/testUtils.ts +2 -0
- package/src/events.ts +20 -3
- package/src/functions.ts +31 -2
- package/src/hooks/useCheckout.tsx +207 -0
- package/src/hooks/useOnramp.tsx +45 -24
- package/src/index.tsx +4 -0
- package/src/specs/NativeCurrencySelectorElement.ts +35 -0
- package/src/specs/NativeEmbeddedPaymentElement.ts +12 -2
- package/src/specs/NativeOnrampSdkModule.ts +1 -1
- package/src/specs/NativePaymentMethodMessagingElement.ts +0 -7
- package/src/specs/NativeStripeSdkModule.ts +61 -2
- package/src/types/Checkout.ts +377 -0
- package/src/types/EmbeddedPaymentElement.tsx +117 -26
- package/src/types/NextAction.ts +9 -0
- package/src/types/Onramp.ts +45 -1
- package/src/types/PaymentIntent.ts +10 -0
- package/src/types/PaymentMethod.ts +9 -6
- package/src/types/PaymentSheet.ts +29 -6
- package/src/types/components/PaymentMethodMessagingElementComponent.tsx +17 -1
- package/stripe-react-native.podspec +8 -8
- package/android/spotless.gradle +0 -19
- package/android/src/main/java/com/reactnativestripesdk/FakeOnrampSdkModule.kt +0 -155
package/src/types/Onramp.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { Address } from './Common';
|
|
2
2
|
import type { OnrampError, StripeError } from './Errors';
|
|
3
|
+
import type {
|
|
4
|
+
ApplePayBaseParams,
|
|
5
|
+
ApplePayPaymentMethodParams,
|
|
6
|
+
} from './PlatformPay';
|
|
3
7
|
|
|
4
8
|
/**
|
|
5
9
|
* Configuration used to initialize and customize the crypto onramp experience.
|
|
@@ -28,7 +32,11 @@ export type GooglePayConfig = {
|
|
|
28
32
|
merchantCountryCode: string;
|
|
29
33
|
/** Merchant name displayed in the Google Pay sheet. */
|
|
30
34
|
merchantName: string;
|
|
31
|
-
/**
|
|
35
|
+
/** Set to true to request an email address. Defaults to false. */
|
|
36
|
+
isEmailRequired?: boolean;
|
|
37
|
+
/** Set to false if you don't support credit cards. Defaults to true. */
|
|
38
|
+
allowCreditCards?: boolean;
|
|
39
|
+
/** Whether an existing payment method is required. Defaults to true. */
|
|
32
40
|
existingPaymentMethodRequired?: boolean;
|
|
33
41
|
/** Billing address collection configuration. */
|
|
34
42
|
billingAddressConfig?: GooglePayBillingAddressConfig;
|
|
@@ -46,6 +54,39 @@ export type GooglePayBillingAddressConfig = {
|
|
|
46
54
|
isPhoneNumberRequired?: boolean;
|
|
47
55
|
};
|
|
48
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Google Pay parameters for the onramp collectPaymentMethod call.
|
|
59
|
+
* Only includes the fields passed to GooglePayPaymentMethodLauncher.present().
|
|
60
|
+
* Google Pay config (merchantCountryCode, testEnv, etc.) belongs in GooglePayConfig
|
|
61
|
+
* provided to configure().
|
|
62
|
+
*/
|
|
63
|
+
export type OnrampGooglePayParams = {
|
|
64
|
+
/** ISO 4217 alphabetic currency code (e.g. "USD"). */
|
|
65
|
+
currencyCode: string;
|
|
66
|
+
/** Amount in the currency's smallest unit. */
|
|
67
|
+
amount: number;
|
|
68
|
+
/** An optional label to display with the amount. */
|
|
69
|
+
label?: string;
|
|
70
|
+
/** A unique ID that identifies a transaction attempt. Required when sending callbacks to the Google Transaction Events API. */
|
|
71
|
+
transactionId?: string;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Platform Pay parameters for the onramp collectPaymentMethod call.
|
|
76
|
+
*/
|
|
77
|
+
export type OnrampPlatformPayParams = {
|
|
78
|
+
/**
|
|
79
|
+
* Google Pay parameters. Android only.
|
|
80
|
+
*/
|
|
81
|
+
googlePay?: OnrampGooglePayParams;
|
|
82
|
+
/**
|
|
83
|
+
* Apple Pay parameters. iOS only.
|
|
84
|
+
* To receive `kycInfo` back from `collectPaymentMethod`, request Apple Pay billing
|
|
85
|
+
* `.name` and/or `.postalAddress` via `requiredBillingContactFields`.
|
|
86
|
+
*/
|
|
87
|
+
applePay?: ApplePayBaseParams & ApplePayPaymentMethodParams;
|
|
88
|
+
};
|
|
89
|
+
|
|
49
90
|
/**
|
|
50
91
|
* Customization options for Link/Stripe-provided UI.
|
|
51
92
|
*/
|
|
@@ -270,10 +311,13 @@ export type CollectPaymentMethodResult =
|
|
|
270
311
|
| {
|
|
271
312
|
/** Display data for the selected payment method. */
|
|
272
313
|
displayData: PaymentMethodDisplayData;
|
|
314
|
+
/** Partial KYC data returned from Platform Pay billing details, when requested. */
|
|
315
|
+
kycInfo?: KycInfo;
|
|
273
316
|
error?: undefined;
|
|
274
317
|
}
|
|
275
318
|
| {
|
|
276
319
|
displayData?: undefined;
|
|
320
|
+
kycInfo?: undefined;
|
|
277
321
|
/** Present if collection/selection failed with an error. */
|
|
278
322
|
error: StripeError<OnrampError>;
|
|
279
323
|
};
|
|
@@ -33,6 +33,7 @@ export type ConfirmParams =
|
|
|
33
33
|
| CardParams
|
|
34
34
|
| IdealParams
|
|
35
35
|
| OxxoParams
|
|
36
|
+
| MultibancoParams
|
|
36
37
|
| P24Params
|
|
37
38
|
| AlipayParams
|
|
38
39
|
| AlmaParams
|
|
@@ -157,6 +158,15 @@ export interface OxxoParams {
|
|
|
157
158
|
};
|
|
158
159
|
}
|
|
159
160
|
|
|
161
|
+
export interface MultibancoParams {
|
|
162
|
+
paymentMethodType: 'Multibanco';
|
|
163
|
+
paymentMethodData: {
|
|
164
|
+
billingDetails: BillingDetails & { email: string };
|
|
165
|
+
mandateData?: MandateData;
|
|
166
|
+
metadata?: MetaData;
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
160
170
|
export interface GrabPayParams {
|
|
161
171
|
paymentMethodType: 'GrabPay';
|
|
162
172
|
paymentMethodData?: {
|
|
@@ -20,7 +20,6 @@ export interface Result {
|
|
|
20
20
|
Fpx: FpxResult;
|
|
21
21
|
Ideal: IdealResult;
|
|
22
22
|
SepaDebit: SepaDebitResult;
|
|
23
|
-
Upi: UpiResult;
|
|
24
23
|
USBankAccount: USBankAccountResult;
|
|
25
24
|
}
|
|
26
25
|
|
|
@@ -28,6 +27,7 @@ export type CreateParams =
|
|
|
28
27
|
| CardParams
|
|
29
28
|
| IdealParams
|
|
30
29
|
| OxxoParams
|
|
30
|
+
| MultibancoParams
|
|
31
31
|
| P24Params
|
|
32
32
|
| AlipayParams
|
|
33
33
|
| SepaParams
|
|
@@ -95,6 +95,13 @@ export interface OxxoParams {
|
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
export interface MultibancoParams {
|
|
99
|
+
paymentMethodType: 'Multibanco';
|
|
100
|
+
paymentMethodData: {
|
|
101
|
+
billingDetails: BillingDetails & { email: string };
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
98
105
|
export interface GrabPayParams {
|
|
99
106
|
paymentMethodType: 'GrabPay';
|
|
100
107
|
paymentMethodData?: {
|
|
@@ -246,10 +253,6 @@ export interface SepaDebitResult {
|
|
|
246
253
|
last4?: string;
|
|
247
254
|
}
|
|
248
255
|
|
|
249
|
-
export interface UpiResult {
|
|
250
|
-
vpa?: string;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
256
|
export type USBankAccountResult = {
|
|
254
257
|
routingNumber?: string;
|
|
255
258
|
accountHolderType?: BankAcccountHolderType;
|
|
@@ -276,8 +279,8 @@ export type Type =
|
|
|
276
279
|
| 'P24'
|
|
277
280
|
| 'Eps'
|
|
278
281
|
| 'Bancontact'
|
|
282
|
+
| 'Multibanco'
|
|
279
283
|
| 'Oxxo'
|
|
280
|
-
| 'Upi'
|
|
281
284
|
| 'USBankAccount'
|
|
282
285
|
| 'PayPal'
|
|
283
286
|
| 'Unknown';
|
|
@@ -15,6 +15,7 @@ import type { FutureUsage } from './PaymentIntent';
|
|
|
15
15
|
import type { Result } from './PaymentMethod';
|
|
16
16
|
import type { StripeError } from './Errors';
|
|
17
17
|
import type { Result as ConfirmationTokenResult } from './ConfirmationToken';
|
|
18
|
+
import type { Checkout } from './Checkout';
|
|
18
19
|
|
|
19
20
|
export type SetupParamsBase = IntentParams & {
|
|
20
21
|
/** Your customer-facing business name. On Android, this is required and cannot be an empty string. */
|
|
@@ -46,7 +47,7 @@ export type SetupParamsBase = IntentParams & {
|
|
|
46
47
|
defaultShippingDetails?: AddressDetails;
|
|
47
48
|
/** If true, allows payment methods that do not move money at the end of the checkout. Defaults to false.
|
|
48
49
|
*
|
|
49
|
-
* Some payment methods can
|
|
50
|
+
* Some payment methods can't guarantee you will receive funds from your customer at the end of the checkout
|
|
50
51
|
* because they take time to settle (eg. most bank debits, like SEPA or ACH) or require customer action to
|
|
51
52
|
* complete (e.g. OXXO, Konbini, Boleto). If this is set to true, make sure your integration listens to webhooks
|
|
52
53
|
* for notifications on whether a payment has succeeded or not.
|
|
@@ -65,7 +66,7 @@ export type SetupParamsBase = IntentParams & {
|
|
|
65
66
|
* You can override the default order in which payment methods are displayed in PaymentSheet with a list of payment method types.
|
|
66
67
|
* See https://stripe.com/docs/api/payment_methods/object#payment_method_object-type for the list of valid types. You may also pass external payment methods.
|
|
67
68
|
* - Example: ["card", "external_paypal", "klarna"]
|
|
68
|
-
* - Note: If you omit payment methods from this list, they
|
|
69
|
+
* - Note: If you omit payment methods from this list, they'll be automatically ordered by Stripe after the ones you provide. Invalid payment methods are ignored.
|
|
69
70
|
*/
|
|
70
71
|
paymentMethodOrder?: Array<String>;
|
|
71
72
|
/** This is an experimental feature that may be removed at any time.
|
|
@@ -112,9 +113,30 @@ export type SetupParamsBase = IntentParams & {
|
|
|
112
113
|
};
|
|
113
114
|
};
|
|
114
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Parameters for initializing PaymentSheet from a Checkout Session.
|
|
118
|
+
* Use when you have called `useCheckout` and the state is `loaded`.
|
|
119
|
+
* @checkoutSessionsPreview
|
|
120
|
+
* @internal
|
|
121
|
+
*/
|
|
122
|
+
export type CheckoutSetupParams = {
|
|
123
|
+
/** A fully loaded Checkout instance whose `state.status` is `'loaded'`. */
|
|
124
|
+
checkout: Checkout;
|
|
125
|
+
paymentIntentClientSecret?: never;
|
|
126
|
+
setupIntentClientSecret?: never;
|
|
127
|
+
intentConfiguration?: never;
|
|
128
|
+
customerEphemeralKeySecret?: never;
|
|
129
|
+
customerSessionClientSecret?: never;
|
|
130
|
+
} & Omit<
|
|
131
|
+
SetupParamsBase,
|
|
132
|
+
| 'paymentIntentClientSecret'
|
|
133
|
+
| 'setupIntentClientSecret'
|
|
134
|
+
| 'intentConfiguration'
|
|
135
|
+
>;
|
|
136
|
+
|
|
115
137
|
export type SetupParams =
|
|
116
138
|
| (SetupParamsBase & {
|
|
117
|
-
/** A short-lived token that allows the SDK to access a Customer
|
|
139
|
+
/** A short-lived token that allows the SDK to access a Customer's payment methods. */
|
|
118
140
|
customerEphemeralKeySecret: string;
|
|
119
141
|
customerSessionClientSecret?: never;
|
|
120
142
|
})
|
|
@@ -123,7 +145,8 @@ export type SetupParams =
|
|
|
123
145
|
/** The client secret of this Customer Session. Used on the client to set up secure access to the given customer. */
|
|
124
146
|
customerSessionClientSecret: string;
|
|
125
147
|
})
|
|
126
|
-
| SetupParamsBase
|
|
148
|
+
| SetupParamsBase
|
|
149
|
+
| CheckoutSetupParams;
|
|
127
150
|
|
|
128
151
|
export type IntentParams =
|
|
129
152
|
| {
|
|
@@ -406,7 +429,7 @@ export type PrimaryButtonColorConfig = {
|
|
|
406
429
|
successTextColor?: ThemedColor;
|
|
407
430
|
};
|
|
408
431
|
|
|
409
|
-
/** A color that
|
|
432
|
+
/** A color that's either a single hex or a light/dark pair */
|
|
410
433
|
export type ThemedColor = string | { light: string; dark: string };
|
|
411
434
|
|
|
412
435
|
/** Represents edge insets */
|
|
@@ -649,7 +672,7 @@ export type Mode = PaymentMode | SetupMode;
|
|
|
649
672
|
export enum CaptureMethod {
|
|
650
673
|
/** (Default) Stripe automatically captures funds when the customer authorizes the payment. */
|
|
651
674
|
Automatic = 'Automatic',
|
|
652
|
-
/** Place a hold on the funds when the customer authorizes the payment, but don
|
|
675
|
+
/** Place a hold on the funds when the customer authorizes the payment, but don't capture the funds until later. (Not all payment methods support this.) */
|
|
653
676
|
Manual = 'Manual',
|
|
654
677
|
/** Asynchronously capture funds when the customer authorizes the payment.
|
|
655
678
|
- Note: Recommended over `CaptureMethod.Automatic` due to improved latency, but may require additional integration changes.
|
|
@@ -25,9 +25,25 @@ export enum PaymentMethodMessagingElementStyle {
|
|
|
25
25
|
Light = 'light',
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
export interface PaymentMethodMessagingElementFont {
|
|
29
|
+
/**
|
|
30
|
+
* The font used for the element text.
|
|
31
|
+
*
|
|
32
|
+
* On iOS, this should be the "PostScript name" found in Font Book after installing the font.
|
|
33
|
+
* On Android, this should be the name of the font file (containing only lowercase alphanumeric characters) in android/app/src/main/res/font
|
|
34
|
+
*
|
|
35
|
+
* @default The OS's system font
|
|
36
|
+
*/
|
|
37
|
+
family?: string;
|
|
38
|
+
/** The font size for text in the element. This value is required to be greater than 0.
|
|
39
|
+
* @default The OS's default text size.
|
|
40
|
+
*/
|
|
41
|
+
size?: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
28
44
|
export interface PaymentMethodMessagingElementAppearance {
|
|
29
45
|
/** Font settings for the element. */
|
|
30
|
-
font?:
|
|
46
|
+
font?: PaymentMethodMessagingElementFont;
|
|
31
47
|
/** The color used for the element text. */
|
|
32
48
|
textColor?: PaymentSheetTypes.ThemedColor;
|
|
33
49
|
/** The color used for the text that links to available BNPL plans. */
|
|
@@ -2,7 +2,7 @@ require 'json'
|
|
|
2
2
|
|
|
3
3
|
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
4
|
# Keep stripe_version in sync with https://github.com/stripe/stripe-identity-react-native/blob/main/stripe-identity-react-native.podspec
|
|
5
|
-
stripe_version = '~> 25.
|
|
5
|
+
stripe_version = '~> 25.12.0'
|
|
6
6
|
|
|
7
7
|
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
8
8
|
|
|
@@ -17,13 +17,6 @@ Pod::Spec.new do |s|
|
|
|
17
17
|
s.platforms = { ios: '13.0' }
|
|
18
18
|
s.source = { git: 'https://github.com/stripe/stripe-react-native.git', tag: s.version.to_s }
|
|
19
19
|
|
|
20
|
-
s.source_files = 'ios/**/*.{h,m,mm,swift}'
|
|
21
|
-
s.exclude_files = [ 'ios/Tests/', 'ios/NewArch/' ]
|
|
22
|
-
# These headers contain c++ code so make sure they are private to avoid
|
|
23
|
-
# being exported to the umbrella header, which is used by swift interop.
|
|
24
|
-
# StripeSwiftInterop.h will cause circular dependency issues.
|
|
25
|
-
s.private_header_files = [ 'ios/StripeSdk.h', 'ios/StripeSwiftInterop.h' ]
|
|
26
|
-
|
|
27
20
|
s.header_dir = 'stripe_react_native'
|
|
28
21
|
s.pod_target_xcconfig = {
|
|
29
22
|
'USE_HEADERMAP' => 'YES',
|
|
@@ -44,6 +37,12 @@ Pod::Spec.new do |s|
|
|
|
44
37
|
end
|
|
45
38
|
|
|
46
39
|
s.subspec 'Core' do |core|
|
|
40
|
+
core.source_files = 'ios/**/*.{h,m,mm,swift}'
|
|
41
|
+
core.exclude_files = [ 'ios/Tests/', 'ios/NewArch/', 'ios/StripeOnrampSdk.h', 'ios/StripeOnrampSdk.mm' ]
|
|
42
|
+
# These headers contain c++ code so make sure they are private to avoid
|
|
43
|
+
# being exported to the umbrella header, which is used by swift interop.
|
|
44
|
+
# StripeSwiftInterop.h will cause circular dependency issues.
|
|
45
|
+
core.private_header_files = [ 'ios/StripeSdk.h', 'ios/StripeSwiftInterop.h' ]
|
|
47
46
|
core.dependency 'React-Core'
|
|
48
47
|
core.dependency 'Stripe', stripe_version
|
|
49
48
|
core.dependency 'StripePaymentSheet', stripe_version
|
|
@@ -54,6 +53,7 @@ Pod::Spec.new do |s|
|
|
|
54
53
|
end
|
|
55
54
|
|
|
56
55
|
s.subspec 'Onramp' do |onramp|
|
|
56
|
+
onramp.source_files = [ 'ios/StripeOnrampSdk.h', 'ios/StripeOnrampSdk.mm' ]
|
|
57
57
|
onramp.dependency 'stripe-react-native/Core'
|
|
58
58
|
onramp.dependency 'StripeCryptoOnramp', stripe_version
|
|
59
59
|
end
|
package/android/spotless.gradle
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
apply plugin: 'com.diffplug.spotless'
|
|
2
|
-
|
|
3
|
-
allprojects {
|
|
4
|
-
repositories {
|
|
5
|
-
google()
|
|
6
|
-
mavenCentral()
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
spotless {
|
|
12
|
-
kotlin {
|
|
13
|
-
target 'src/**/*.kt'
|
|
14
|
-
ktlint("1.5.0").setEditorConfigPath("$projectDir/../.editorconfig")
|
|
15
|
-
trimTrailingWhitespace()
|
|
16
|
-
indentWithSpaces()
|
|
17
|
-
endWithNewline()
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
package com.reactnativestripesdk
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.bridge.Promise
|
|
4
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
5
|
-
import com.facebook.react.bridge.ReactMethod
|
|
6
|
-
import com.facebook.react.bridge.ReadableMap
|
|
7
|
-
import com.facebook.react.module.annotations.ReactModule
|
|
8
|
-
import com.reactnativestripesdk.utils.createFailedError
|
|
9
|
-
|
|
10
|
-
@ReactModule(name = NativeOnrampSdkModuleSpec.NAME)
|
|
11
|
-
class FakeOnrampSdkModule(
|
|
12
|
-
reactContext: ReactApplicationContext,
|
|
13
|
-
) : NativeOnrampSdkModuleSpec(reactContext) {
|
|
14
|
-
@ReactMethod
|
|
15
|
-
override fun initialise(
|
|
16
|
-
params: ReadableMap?,
|
|
17
|
-
promise: Promise?,
|
|
18
|
-
) {
|
|
19
|
-
promise?.resolve(null)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
@ReactMethod
|
|
23
|
-
override fun configureOnramp(
|
|
24
|
-
config: ReadableMap?,
|
|
25
|
-
promise: Promise?,
|
|
26
|
-
) {
|
|
27
|
-
promise?.resolveNotImplemented()
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
@ReactMethod
|
|
31
|
-
override fun hasLinkAccount(
|
|
32
|
-
email: String?,
|
|
33
|
-
promise: Promise?,
|
|
34
|
-
) {
|
|
35
|
-
promise?.resolveNotImplemented()
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
@ReactMethod
|
|
39
|
-
override fun registerLinkUser(
|
|
40
|
-
info: ReadableMap?,
|
|
41
|
-
promise: Promise?,
|
|
42
|
-
) {
|
|
43
|
-
promise?.resolveNotImplemented()
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@ReactMethod
|
|
47
|
-
override fun registerWalletAddress(
|
|
48
|
-
walletAddress: String?,
|
|
49
|
-
network: String?,
|
|
50
|
-
promise: Promise?,
|
|
51
|
-
) {
|
|
52
|
-
promise?.resolveNotImplemented()
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
@ReactMethod
|
|
56
|
-
override fun attachKycInfo(
|
|
57
|
-
kycInfo: ReadableMap?,
|
|
58
|
-
promise: Promise?,
|
|
59
|
-
) {
|
|
60
|
-
promise?.resolveNotImplemented()
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@ReactMethod
|
|
64
|
-
override fun updatePhoneNumber(
|
|
65
|
-
phone: String?,
|
|
66
|
-
promise: Promise?,
|
|
67
|
-
) {
|
|
68
|
-
promise?.resolveNotImplemented()
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
@ReactMethod
|
|
72
|
-
override fun verifyIdentity(promise: Promise?) {
|
|
73
|
-
promise?.resolveNotImplemented()
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
@ReactMethod
|
|
77
|
-
override fun presentKycInfoVerification(
|
|
78
|
-
updatedAddress: ReadableMap?,
|
|
79
|
-
promise: Promise,
|
|
80
|
-
) {
|
|
81
|
-
promise.resolveNotImplemented()
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
@ReactMethod
|
|
85
|
-
override fun collectPaymentMethod(
|
|
86
|
-
paymentMethod: String?,
|
|
87
|
-
platformPayParams: ReadableMap?,
|
|
88
|
-
promise: Promise?,
|
|
89
|
-
) {
|
|
90
|
-
promise?.resolveNotImplemented()
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
@ReactMethod
|
|
94
|
-
override fun provideCheckoutClientSecret(clientSecret: String?) {
|
|
95
|
-
// No-op
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
@ReactMethod
|
|
99
|
-
override fun createCryptoPaymentToken(promise: Promise?) {
|
|
100
|
-
promise?.resolveNotImplemented()
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
@ReactMethod
|
|
104
|
-
override fun performCheckout(
|
|
105
|
-
onrampSessionId: String?,
|
|
106
|
-
promise: Promise?,
|
|
107
|
-
) {
|
|
108
|
-
promise?.resolveNotImplemented()
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
@ReactMethod
|
|
112
|
-
override fun onrampAuthorize(
|
|
113
|
-
linkAuthIntentId: String?,
|
|
114
|
-
promise: Promise?,
|
|
115
|
-
) {
|
|
116
|
-
promise?.resolveNotImplemented()
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
@ReactMethod
|
|
120
|
-
override fun logout(promise: Promise?) {
|
|
121
|
-
promise?.resolveNotImplemented()
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
@ReactMethod
|
|
125
|
-
override fun getCryptoTokenDisplayData(
|
|
126
|
-
token: ReadableMap,
|
|
127
|
-
promise: Promise,
|
|
128
|
-
) {
|
|
129
|
-
promise.resolveNotImplemented()
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
@ReactMethod
|
|
133
|
-
override fun authenticateUserWithToken(
|
|
134
|
-
token: String,
|
|
135
|
-
promise: Promise,
|
|
136
|
-
) {
|
|
137
|
-
promise.resolveNotImplemented()
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
@ReactMethod
|
|
141
|
-
override fun addListener(eventType: String?) {}
|
|
142
|
-
|
|
143
|
-
@ReactMethod
|
|
144
|
-
override fun removeListeners(count: Double) {}
|
|
145
|
-
|
|
146
|
-
private fun Promise.resolveNotImplemented() {
|
|
147
|
-
this.resolve(
|
|
148
|
-
createFailedError(
|
|
149
|
-
NotImplementedError(
|
|
150
|
-
"To enable Onramp, add 'StripeSdk_includeOnramp=true' to gradle.properties.",
|
|
151
|
-
),
|
|
152
|
-
),
|
|
153
|
-
)
|
|
154
|
-
}
|
|
155
|
-
}
|