@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.
Files changed (58) hide show
  1. package/android/.idea/AndroidProjectSystem.xml +6 -0
  2. package/android/.idea/caches/deviceStreaming.xml +703 -0
  3. package/android/.idea/compiler.xml +6 -0
  4. package/android/.idea/gradle.xml +18 -0
  5. package/android/.idea/migrations.xml +10 -0
  6. package/android/.idea/misc.xml +10 -0
  7. package/android/.idea/runConfigurations.xml +17 -0
  8. package/android/.idea/vcs.xml +6 -0
  9. package/android/local.properties +8 -0
  10. package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +9 -0
  11. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +7 -5
  12. package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +2 -0
  13. package/ios/Mappers.swift +2 -0
  14. package/ios/PaymentMethodFactory.swift +8 -0
  15. package/lib/commonjs/components/AddToWalletButton.js +1 -1
  16. package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
  17. package/lib/commonjs/components/AddressSheet.js +1 -1
  18. package/lib/commonjs/components/AddressSheet.js.map +1 -1
  19. package/lib/commonjs/components/AuBECSDebitForm.js +1 -1
  20. package/lib/commonjs/components/AuBECSDebitForm.js.map +1 -1
  21. package/lib/commonjs/components/CardField.js +1 -1
  22. package/lib/commonjs/components/CardField.js.map +1 -1
  23. package/lib/commonjs/components/CardForm.js +1 -1
  24. package/lib/commonjs/components/CardForm.js.map +1 -1
  25. package/lib/commonjs/components/PlatformPayButton.js +1 -1
  26. package/lib/commonjs/components/PlatformPayButton.js.map +1 -1
  27. package/lib/commonjs/components/StripeContainer.js +1 -1
  28. package/lib/commonjs/components/StripeContainer.js.map +1 -1
  29. package/lib/commonjs/components/StripeProvider.js +1 -1
  30. package/lib/commonjs/components/StripeProvider.js.map +1 -1
  31. package/lib/commonjs/types/EmbeddedPaymentElement.js +1 -1
  32. package/lib/commonjs/types/EmbeddedPaymentElement.js.map +1 -1
  33. package/lib/commonjs/types/PaymentIntent.js.map +1 -1
  34. package/lib/module/components/AddToWalletButton.js +1 -1
  35. package/lib/module/components/AddToWalletButton.js.map +1 -1
  36. package/lib/module/components/AddressSheet.js +1 -1
  37. package/lib/module/components/AddressSheet.js.map +1 -1
  38. package/lib/module/components/AuBECSDebitForm.js +1 -1
  39. package/lib/module/components/AuBECSDebitForm.js.map +1 -1
  40. package/lib/module/components/CardField.js +1 -1
  41. package/lib/module/components/CardField.js.map +1 -1
  42. package/lib/module/components/CardForm.js +1 -1
  43. package/lib/module/components/CardForm.js.map +1 -1
  44. package/lib/module/components/PlatformPayButton.js +1 -1
  45. package/lib/module/components/PlatformPayButton.js.map +1 -1
  46. package/lib/module/components/StripeContainer.js +1 -1
  47. package/lib/module/components/StripeContainer.js.map +1 -1
  48. package/lib/module/components/StripeProvider.js +1 -1
  49. package/lib/module/components/StripeProvider.js.map +1 -1
  50. package/lib/module/types/EmbeddedPaymentElement.js +1 -1
  51. package/lib/module/types/EmbeddedPaymentElement.js.map +1 -1
  52. package/lib/module/types/PaymentIntent.js.map +1 -1
  53. package/lib/typescript/src/components/StripeProvider.d.ts.map +1 -1
  54. package/lib/typescript/src/types/PaymentIntent.d.ts +8 -1
  55. package/lib/typescript/src/types/PaymentIntent.d.ts.map +1 -1
  56. package/package.json +1 -1
  57. package/src/components/StripeProvider.tsx +6 -5
  58. 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 NativeStripeSdk.initialise({
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 NativeStripeSdk.initialise({
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: {