@stripe/stripe-react-native 0.61.0 → 0.63.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.
Files changed (111) hide show
  1. package/android/gradle.properties +2 -2
  2. package/android/src/main/java/com/reactnativestripesdk/EventEmitterCompat.kt +4 -0
  3. package/android/src/main/java/com/reactnativestripesdk/FakeOnrampSdkModule.kt +6 -0
  4. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetManager.kt +200 -198
  5. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +3 -1
  6. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.kt +17 -16
  7. package/android/src/oldarch/java/com/reactnativestripesdk/NativeOnrampSdkModuleSpec.java +8 -11
  8. package/android/src/onramp/java/com/reactnativestripesdk/OnrampMappers.kt +4 -0
  9. package/android/src/onramp/java/com/reactnativestripesdk/OnrampSdkModule.kt +16 -1
  10. package/android/src/test/java/com/reactnativestripesdk/mappers/OnrampMappersTest.kt +3 -0
  11. package/ios/Mappers.swift +15 -2
  12. package/ios/StripeOnrampSdk.h +3 -4
  13. package/lib/commonjs/components/AddToWalletButton.js +1 -1
  14. package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
  15. package/lib/commonjs/components/AddressSheet.js +1 -1
  16. package/lib/commonjs/components/AddressSheet.js.map +1 -1
  17. package/lib/commonjs/components/AuBECSDebitForm.js +1 -1
  18. package/lib/commonjs/components/AuBECSDebitForm.js.map +1 -1
  19. package/lib/commonjs/components/CardField.js +1 -1
  20. package/lib/commonjs/components/CardField.js.map +1 -1
  21. package/lib/commonjs/components/CardForm.js +1 -1
  22. package/lib/commonjs/components/CardForm.js.map +1 -1
  23. package/lib/commonjs/components/PlatformPayButton.js +1 -1
  24. package/lib/commonjs/components/PlatformPayButton.js.map +1 -1
  25. package/lib/commonjs/components/StripeContainer.js +1 -1
  26. package/lib/commonjs/components/StripeContainer.js.map +1 -1
  27. package/lib/commonjs/connect/Components.js +1 -1
  28. package/lib/commonjs/connect/Components.js.map +1 -1
  29. package/lib/commonjs/connect/ConnectComponentsProvider.js +1 -1
  30. package/lib/commonjs/connect/ConnectComponentsProvider.js.map +1 -1
  31. package/lib/commonjs/connect/EmbeddedComponent.js +1 -1
  32. package/lib/commonjs/connect/EmbeddedComponent.js.map +1 -1
  33. package/lib/commonjs/connect/ModalCloseButton.js +1 -1
  34. package/lib/commonjs/connect/ModalCloseButton.js.map +1 -1
  35. package/lib/commonjs/connect/NavigationBar.js +1 -1
  36. package/lib/commonjs/connect/NavigationBar.js.map +1 -1
  37. package/lib/commonjs/events.js +1 -1
  38. package/lib/commonjs/events.js.map +1 -1
  39. package/lib/commonjs/helpers.js +1 -1
  40. package/lib/commonjs/specs/NativeAddToWalletButton.js +1 -1
  41. package/lib/commonjs/specs/NativeAddressSheet.js +1 -1
  42. package/lib/commonjs/specs/NativeApplePayButton.js +1 -1
  43. package/lib/commonjs/specs/NativeAuBECSDebitForm.js +1 -1
  44. package/lib/commonjs/specs/NativeCardField.js +1 -1
  45. package/lib/commonjs/specs/NativeCardField.js.map +1 -1
  46. package/lib/commonjs/specs/NativeCardForm.js +1 -1
  47. package/lib/commonjs/specs/NativeCardForm.js.map +1 -1
  48. package/lib/commonjs/specs/NativeConnectAccountOnboardingView.js +1 -1
  49. package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js +1 -1
  50. package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js.map +1 -1
  51. package/lib/commonjs/specs/NativeGooglePayButton.js +1 -1
  52. package/lib/commonjs/specs/NativeNavigationBar.js +1 -1
  53. package/lib/commonjs/specs/NativePaymentMethodMessagingElement.js +1 -1
  54. package/lib/commonjs/specs/NativeStripeContainer.js +1 -1
  55. package/lib/commonjs/types/EmbeddedPaymentElement.js +1 -1
  56. package/lib/commonjs/types/EmbeddedPaymentElement.js.map +1 -1
  57. package/lib/module/components/AddToWalletButton.js +1 -1
  58. package/lib/module/components/AddToWalletButton.js.map +1 -1
  59. package/lib/module/components/AddressSheet.js +1 -1
  60. package/lib/module/components/AddressSheet.js.map +1 -1
  61. package/lib/module/components/AuBECSDebitForm.js +1 -1
  62. package/lib/module/components/AuBECSDebitForm.js.map +1 -1
  63. package/lib/module/components/CardField.js +1 -1
  64. package/lib/module/components/CardField.js.map +1 -1
  65. package/lib/module/components/CardForm.js +1 -1
  66. package/lib/module/components/CardForm.js.map +1 -1
  67. package/lib/module/components/PlatformPayButton.js +1 -1
  68. package/lib/module/components/PlatformPayButton.js.map +1 -1
  69. package/lib/module/components/StripeContainer.js +1 -1
  70. package/lib/module/components/StripeContainer.js.map +1 -1
  71. package/lib/module/connect/Components.js +1 -1
  72. package/lib/module/connect/Components.js.map +1 -1
  73. package/lib/module/connect/ConnectComponentsProvider.js +1 -1
  74. package/lib/module/connect/ConnectComponentsProvider.js.map +1 -1
  75. package/lib/module/connect/EmbeddedComponent.js +1 -1
  76. package/lib/module/connect/EmbeddedComponent.js.map +1 -1
  77. package/lib/module/connect/ModalCloseButton.js +1 -1
  78. package/lib/module/connect/ModalCloseButton.js.map +1 -1
  79. package/lib/module/connect/NavigationBar.js +1 -1
  80. package/lib/module/connect/NavigationBar.js.map +1 -1
  81. package/lib/module/events.js +1 -1
  82. package/lib/module/events.js.map +1 -1
  83. package/lib/module/helpers.js +1 -1
  84. package/lib/module/specs/NativeAddToWalletButton.js +1 -1
  85. package/lib/module/specs/NativeAddressSheet.js +1 -1
  86. package/lib/module/specs/NativeApplePayButton.js +1 -1
  87. package/lib/module/specs/NativeAuBECSDebitForm.js +1 -1
  88. package/lib/module/specs/NativeCardField.js +1 -1
  89. package/lib/module/specs/NativeCardField.js.map +1 -1
  90. package/lib/module/specs/NativeCardForm.js +1 -1
  91. package/lib/module/specs/NativeCardForm.js.map +1 -1
  92. package/lib/module/specs/NativeConnectAccountOnboardingView.js +1 -1
  93. package/lib/module/specs/NativeEmbeddedPaymentElement.js +1 -1
  94. package/lib/module/specs/NativeEmbeddedPaymentElement.js.map +1 -1
  95. package/lib/module/specs/NativeGooglePayButton.js +1 -1
  96. package/lib/module/specs/NativeNavigationBar.js +1 -1
  97. package/lib/module/specs/NativePaymentMethodMessagingElement.js +1 -1
  98. package/lib/module/specs/NativeStripeContainer.js +1 -1
  99. package/lib/module/types/EmbeddedPaymentElement.js +1 -1
  100. package/lib/module/types/EmbeddedPaymentElement.js.map +1 -1
  101. package/lib/typescript/src/connect/connectTypes.d.ts +76 -0
  102. package/lib/typescript/src/connect/connectTypes.d.ts.map +1 -1
  103. package/lib/typescript/src/events.d.ts +5 -3
  104. package/lib/typescript/src/events.d.ts.map +1 -1
  105. package/lib/typescript/src/specs/NativeOnrampSdkModule.d.ts +2 -2
  106. package/lib/typescript/src/specs/NativeOnrampSdkModule.d.ts.map +1 -1
  107. package/package.json +1 -1
  108. package/src/connect/connectTypes.ts +88 -0
  109. package/src/events.ts +10 -13
  110. package/src/specs/NativeOnrampSdkModule.ts +2 -2
  111. package/stripe-react-native.podspec +1 -1
@@ -302,6 +302,44 @@ export declare type AppearanceVariables = {
302
302
  */
303
303
  buttonSecondaryColorText?: string;
304
304
 
305
+ // Danger Button
306
+ /**
307
+ * The color used as a background for danger buttons to indicate destructive actions. This accepts hex values or RGB/HSL strings.
308
+ */
309
+ buttonDangerColorBackground?: string;
310
+ /**
311
+ * The color used as a border for danger buttons to indicate destructive actions. This accepts hex values or RGB/HSL strings.
312
+ */
313
+ buttonDangerColorBorder?: string;
314
+ /**
315
+ * The text color used for danger buttons to indicate destructive actions. This accepts hex values or RGB/HSL strings.
316
+ */
317
+ buttonDangerColorText?: string;
318
+
319
+ // Button Padding
320
+ /**
321
+ * The horizontal padding for buttons. This accepts a valid padding value.
322
+ */
323
+ buttonPaddingX?: string;
324
+ /**
325
+ * The vertical padding for buttons. This accepts a valid padding value.
326
+ */
327
+ buttonPaddingY?: string;
328
+
329
+ // Button Typography
330
+ /**
331
+ * The font size for button label typography. Button label typography variables accept a valid font size value ranging from 1px to 200px, 0.1em to 12em, and 0.1rem to 12rem.
332
+ */
333
+ buttonLabelFontSize?: string;
334
+ /**
335
+ * The font weight for button label typography. Button label typography variables accept a valid font weight value.
336
+ */
337
+ buttonLabelFontWeight?: string;
338
+ /**
339
+ * The text transform for button label typography. Button label typography variables accept a valid text transform value.
340
+ */
341
+ buttonLabelTextTransform?: string;
342
+
305
343
  /**
306
344
  * The color used for secondary text. This accepts hex values or RGB/RGBA/HSL strings.
307
345
  */
@@ -326,6 +364,10 @@ export declare type AppearanceVariables = {
326
364
  * The thickness of text decoration of primary actions and links. This accepts a valid text decoration thickness value.
327
365
  */
328
366
  actionPrimaryTextDecorationThickness?: string;
367
+ /**
368
+ * The text transform for primary actions and links. This accepts a valid text transform value.
369
+ */
370
+ actionPrimaryTextTransform?: string;
329
371
  /**
330
372
  * The color used for secondary actions and links. This accepts hex values or RGB/HSL strings.
331
373
  */
@@ -346,6 +388,10 @@ export declare type AppearanceVariables = {
346
388
  * The thickness of text decoration of secondary actions and links. This accepts a valid text decoration thickness value.
347
389
  */
348
390
  actionSecondaryTextDecorationThickness?: string;
391
+ /**
392
+ * The text transform for secondary actions and links. This accepts a valid text transform value.
393
+ */
394
+ actionSecondaryTextTransform?: string;
349
395
 
350
396
  // Neutral Badge Colors
351
397
  /**
@@ -403,6 +449,30 @@ export declare type AppearanceVariables = {
403
449
  */
404
450
  badgeDangerColorBorder?: string;
405
451
 
452
+ // Badge Padding
453
+ /**
454
+ * The horizontal padding used for badges. This supports pixel values only.
455
+ */
456
+ badgePaddingX?: string;
457
+ /**
458
+ * The vertical padding used for badges. This supports pixel values only.
459
+ */
460
+ badgePaddingY?: string;
461
+
462
+ // Badge Typography
463
+ /**
464
+ * The font size for badge label typography. Badge label typography variables accept a valid font size value ranging from 1px to 200px, 0.1em to 12em, and 0.1rem to 12rem.
465
+ */
466
+ badgeLabelFontSize?: string;
467
+ /**
468
+ * The font weight for badge label typography. Badge label typography variables accept a valid font weight value.
469
+ */
470
+ badgeLabelFontWeight?: string;
471
+ /**
472
+ * The text transform for badge label typography. Badge label typography variables accept a valid text transform value.
473
+ */
474
+ badgeLabelTextTransform?: string;
475
+
406
476
  // Background
407
477
  /**
408
478
  * The background color used when highlighting information, like the selected row on a table or particular piece of UI. This accepts hex values or RGB/HSL strings.
@@ -427,6 +497,24 @@ export declare type AppearanceVariables = {
427
497
  * The color used for to fill in form items like checkboxes, radio buttons and switches. This accepts hex values or RGB/HSL strings.
428
498
  */
429
499
  formAccentColor?: string;
500
+ /**
501
+ * The color used for placeholder text in form items. This accepts hex values or RGB/HSL strings.
502
+ */
503
+ formPlaceholderTextColor?: string;
504
+ /**
505
+ * The horizontal padding used for input fields in forms. This supports pixel values only.
506
+ */
507
+ inputFieldPaddingX?: string;
508
+ /**
509
+ * The vertical padding used for input fields in forms. This supports pixel values only.
510
+ */
511
+ inputFieldPaddingY?: string;
512
+
513
+ // Table
514
+ /**
515
+ * The vertical padding used for table rows. This supports pixel values only.
516
+ */
517
+ tableRowPaddingY?: string;
430
518
 
431
519
  // Border Sizing
432
520
  /**
package/src/events.ts CHANGED
@@ -76,22 +76,19 @@ export function addListener<EventT extends keyof Events>(
76
76
  }
77
77
 
78
78
  const compatOnrampEventEmitter =
79
- // On new arch we use native module events. On old arch this doesn't exist
80
- // so use NativeEventEmitter on iOS and DeviceEventEmitter on Android.
81
- NativeOnrampSdkModule.onCheckoutClientSecretRequested == null
82
- ? Platform.OS === 'ios'
83
- ? new NativeEventEmitter(NativeOnrampSdkModule as any)
84
- : DeviceEventEmitter
85
- : null;
79
+ Platform.OS === 'ios'
80
+ ? new NativeEventEmitter(NativeOnrampSdkModule as any)
81
+ : DeviceEventEmitter;
82
+
83
+ type OnrampEventMap = {
84
+ onCheckoutClientSecretRequested: void;
85
+ };
86
86
 
87
- type OnrampEvents = 'onCheckoutClientSecretRequested';
87
+ type OnrampEvents = keyof OnrampEventMap;
88
88
 
89
89
  export function addOnrampListener<EventT extends OnrampEvents>(
90
90
  event: EventT,
91
- handler: Parameters<(typeof NativeOnrampSdkModule)[EventT]>[0]
91
+ handler: (params: OnrampEventMap[EventT]) => void
92
92
  ): EventSubscription {
93
- if (compatOnrampEventEmitter != null) {
94
- return compatOnrampEventEmitter.addListener(event, handler);
95
- }
96
- return NativeOnrampSdkModule[event](handler as any);
93
+ return compatOnrampEventEmitter.addListener(event, handler);
97
94
  }
@@ -1,6 +1,5 @@
1
1
  import { TurboModuleRegistry } from 'react-native';
2
2
  import type { TurboModule } from 'react-native/Libraries/TurboModule/RCTExport';
3
- import type { EventEmitter } from 'react-native/Libraries/Types/CodegenTypes';
4
3
  import type { Address, InitialiseParams, Onramp } from '../types';
5
4
  import type { UnsafeObject } from './utils';
6
5
 
@@ -33,7 +32,6 @@ export interface Spec extends TurboModule {
33
32
  platformPayParams: UnsafeObject<any>
34
33
  ): Promise<Onramp.CollectPaymentMethodResult>;
35
34
  provideCheckoutClientSecret(clientSecret: string | null): void;
36
- onCheckoutClientSecretRequested: EventEmitter<UnsafeObject<any>>;
37
35
  createCryptoPaymentToken(): Promise<Onramp.CreateCryptoPaymentTokenResult>;
38
36
  performCheckout(onrampSessionId: string): Promise<Onramp.VoidResult>;
39
37
  onrampAuthorize(linkAuthIntentId: string): Promise<Onramp.AuthorizeResult>;
@@ -41,6 +39,8 @@ export interface Spec extends TurboModule {
41
39
  token: UnsafeObject<Onramp.CryptoPaymentToken>
42
40
  ): Promise<Onramp.PaymentDisplayDataResult>;
43
41
  logout(): Promise<Onramp.VoidResult>;
42
+ addListener: (eventType: string) => void;
43
+ removeListeners: (count: number) => void;
44
44
  }
45
45
 
46
46
  export default TurboModuleRegistry.getEnforcing<Spec>('OnrampSdk');
@@ -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.9.0'
5
+ stripe_version = '~> 25.10.0'
6
6
 
7
7
  fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
8
8