@stripe/stripe-react-native 0.53.1 → 0.54.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/android/.idea/AndroidProjectSystem.xml +6 -0
- package/android/.idea/caches/deviceStreaming.xml +703 -0
- package/android/.idea/compiler.xml +6 -0
- package/android/.idea/gradle.xml +18 -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/local.properties +8 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +9 -0
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +7 -5
- package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +2 -0
- package/ios/Mappers.swift +2 -0
- package/ios/PaymentMethodFactory.swift +8 -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/types/EmbeddedPaymentElement.js +1 -1
- package/lib/commonjs/types/EmbeddedPaymentElement.js.map +1 -1
- package/lib/commonjs/types/PaymentIntent.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/types/EmbeddedPaymentElement.js +1 -1
- package/lib/module/types/EmbeddedPaymentElement.js.map +1 -1
- package/lib/module/types/PaymentIntent.js.map +1 -1
- package/lib/typescript/src/components/StripeProvider.d.ts.map +1 -1
- package/lib/typescript/src/types/PaymentIntent.d.ts +8 -1
- package/lib/typescript/src/types/PaymentIntent.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/StripeProvider.tsx +6 -5
- package/src/types/PaymentIntent.ts +9 -0
|
@@ -27,13 +27,15 @@ const appInfo: AppInfo = {
|
|
|
27
27
|
partnerId: shouldAttributeExpo() ? EXPO_PARTNER_ID : undefined,
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
+
let didRegisterHeadlessTask = false;
|
|
31
|
+
|
|
30
32
|
export const initStripe = async (params: InitStripeParams): Promise<void> => {
|
|
31
33
|
// On Android when the activity is paused, JS timers are paused,
|
|
32
34
|
// which causes network requests to hang indefinitely on new arch.
|
|
33
35
|
// To work around this, we register a headless task that will keep
|
|
34
36
|
// the JS runtime running while the Stripe UI is opened.
|
|
35
37
|
// This task is started and stopped by the native module.
|
|
36
|
-
if (Platform.OS === 'android') {
|
|
38
|
+
if (Platform.OS === 'android' && !didRegisterHeadlessTask) {
|
|
37
39
|
function stripeHeadlessTask() {
|
|
38
40
|
return new Promise<void>(() => {});
|
|
39
41
|
}
|
|
@@ -42,6 +44,7 @@ export const initStripe = async (params: InitStripeParams): Promise<void> => {
|
|
|
42
44
|
'StripeKeepJsAwakeTask',
|
|
43
45
|
() => stripeHeadlessTask
|
|
44
46
|
);
|
|
47
|
+
didRegisterHeadlessTask = true;
|
|
45
48
|
}
|
|
46
49
|
|
|
47
50
|
const extendedParams: InitialiseParams = { ...params, appInfo };
|
|
@@ -83,18 +86,16 @@ export function StripeProvider({
|
|
|
83
86
|
}
|
|
84
87
|
const initializeStripe = async () => {
|
|
85
88
|
if (isAndroid) {
|
|
86
|
-
await
|
|
89
|
+
await initStripe({
|
|
87
90
|
publishableKey,
|
|
88
|
-
appInfo,
|
|
89
91
|
stripeAccountId,
|
|
90
92
|
threeDSecureParams,
|
|
91
93
|
urlScheme,
|
|
92
94
|
setReturnUrlSchemeOnAndroid,
|
|
93
95
|
});
|
|
94
96
|
} else {
|
|
95
|
-
await
|
|
97
|
+
await initStripe({
|
|
96
98
|
publishableKey,
|
|
97
|
-
appInfo,
|
|
98
99
|
stripeAccountId,
|
|
99
100
|
threeDSecureParams,
|
|
100
101
|
merchantIdentifier,
|
|
@@ -35,6 +35,7 @@ export type ConfirmParams =
|
|
|
35
35
|
| OxxoParams
|
|
36
36
|
| P24Params
|
|
37
37
|
| AlipayParams
|
|
38
|
+
| AlmaParams
|
|
38
39
|
| GiropayParams
|
|
39
40
|
| SepaParams
|
|
40
41
|
| EpsParams
|
|
@@ -140,6 +141,14 @@ export interface AlipayParams {
|
|
|
140
141
|
};
|
|
141
142
|
}
|
|
142
143
|
|
|
144
|
+
export type AlmaParams = {
|
|
145
|
+
paymentMethodType: 'Alma';
|
|
146
|
+
paymentMethodData?: {
|
|
147
|
+
billingDetails?: BillingDetails;
|
|
148
|
+
metadata?: MetaData;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
|
|
143
152
|
export interface OxxoParams {
|
|
144
153
|
paymentMethodType: 'Oxxo';
|
|
145
154
|
paymentMethodData: {
|