@stripe/stripe-react-native 0.68.0 → 0.69.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 (172) hide show
  1. package/android/gradle.properties +1 -1
  2. package/android/src/main/java/com/reactnativestripesdk/LinkControllerManager.kt +175 -0
  3. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +31 -24
  4. package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +8 -4
  5. package/android/src/onramp/java/com/reactnativestripesdk/OnrampErrors.kt +9 -28
  6. package/android/src/onramp/java/com/reactnativestripesdk/OnrampSdkModule.kt +3 -2
  7. package/android/src/test/java/com/reactnativestripesdk/OnrampErrorsTest.kt +20 -18
  8. package/ios/CurrencySelectorElementView.swift +1 -1
  9. package/ios/Mappers+Checkout.swift +3 -3
  10. package/ios/OnrampErrors.swift +1 -14
  11. package/ios/StripeSdk.mm +15 -15
  12. package/ios/StripeSdkImpl+Checkout.swift +15 -39
  13. package/ios/StripeSdkImpl+LinkController.swift +108 -0
  14. package/ios/StripeSdkImpl.swift +8 -3
  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/CurrencySelectorElement.js +1 -1
  26. package/lib/commonjs/components/CurrencySelectorElement.js.map +1 -1
  27. package/lib/commonjs/components/PaymentMethodMessagingElement.js +1 -1
  28. package/lib/commonjs/components/PaymentMethodMessagingElement.js.map +1 -1
  29. package/lib/commonjs/components/PlatformPayButton.js +1 -1
  30. package/lib/commonjs/components/PlatformPayButton.js.map +1 -1
  31. package/lib/commonjs/components/StripeContainer.js +1 -1
  32. package/lib/commonjs/components/StripeContainer.js.map +1 -1
  33. package/lib/commonjs/connect/Components.js +1 -1
  34. package/lib/commonjs/connect/Components.js.map +1 -1
  35. package/lib/commonjs/connect/ConnectComponentsProvider.js +1 -1
  36. package/lib/commonjs/connect/ConnectComponentsProvider.js.map +1 -1
  37. package/lib/commonjs/connect/EmbeddedComponent.js +1 -1
  38. package/lib/commonjs/connect/EmbeddedComponent.js.map +1 -1
  39. package/lib/commonjs/connect/ModalCloseButton.js +1 -1
  40. package/lib/commonjs/connect/ModalCloseButton.js.map +1 -1
  41. package/lib/commonjs/connect/NavigationBar.js +1 -1
  42. package/lib/commonjs/connect/NavigationBar.js.map +1 -1
  43. package/lib/commonjs/functions.js +1 -1
  44. package/lib/commonjs/functions.js.map +1 -1
  45. package/lib/commonjs/helpers.js +1 -1
  46. package/lib/commonjs/hooks/useCheckout.js +1 -1
  47. package/lib/commonjs/hooks/useCheckout.js.map +1 -1
  48. package/lib/commonjs/hooks/useLinkController.js +2 -0
  49. package/lib/commonjs/hooks/useLinkController.js.map +1 -0
  50. package/lib/commonjs/index.js +1 -1
  51. package/lib/commonjs/index.js.map +1 -1
  52. package/lib/commonjs/specs/NativeAddToWalletButton.js +1 -1
  53. package/lib/commonjs/specs/NativeAddressSheet.js +1 -1
  54. package/lib/commonjs/specs/NativeApplePayButton.js +1 -1
  55. package/lib/commonjs/specs/NativeAuBECSDebitForm.js +1 -1
  56. package/lib/commonjs/specs/NativeCardField.js +1 -1
  57. package/lib/commonjs/specs/NativeCardField.js.map +1 -1
  58. package/lib/commonjs/specs/NativeCardForm.js +1 -1
  59. package/lib/commonjs/specs/NativeCardForm.js.map +1 -1
  60. package/lib/commonjs/specs/NativeConnectAccountOnboardingView.js +1 -1
  61. package/lib/commonjs/specs/NativeCurrencySelectorElement.js +1 -1
  62. package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js +1 -1
  63. package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js.map +1 -1
  64. package/lib/commonjs/specs/NativeGooglePayButton.js +1 -1
  65. package/lib/commonjs/specs/NativeNavigationBar.js +1 -1
  66. package/lib/commonjs/specs/NativePaymentMethodMessagingElement.js +1 -1
  67. package/lib/commonjs/specs/NativeStripeContainer.js +1 -1
  68. package/lib/commonjs/specs/NativeStripeSdkModule.js.map +1 -1
  69. package/lib/commonjs/types/EmbeddedPaymentElement.js +1 -1
  70. package/lib/commonjs/types/EmbeddedPaymentElement.js.map +1 -1
  71. package/lib/commonjs/types/Errors.js +1 -1
  72. package/lib/commonjs/types/Errors.js.map +1 -1
  73. package/lib/commonjs/types/LinkController.js +2 -0
  74. package/lib/commonjs/types/LinkController.js.map +1 -0
  75. package/lib/commonjs/types/index.js +1 -1
  76. package/lib/commonjs/types/index.js.map +1 -1
  77. package/lib/module/components/AddToWalletButton.js +1 -1
  78. package/lib/module/components/AddToWalletButton.js.map +1 -1
  79. package/lib/module/components/AddressSheet.js +1 -1
  80. package/lib/module/components/AddressSheet.js.map +1 -1
  81. package/lib/module/components/AuBECSDebitForm.js +1 -1
  82. package/lib/module/components/AuBECSDebitForm.js.map +1 -1
  83. package/lib/module/components/CardField.js +1 -1
  84. package/lib/module/components/CardField.js.map +1 -1
  85. package/lib/module/components/CardForm.js +1 -1
  86. package/lib/module/components/CardForm.js.map +1 -1
  87. package/lib/module/components/CurrencySelectorElement.js +1 -1
  88. package/lib/module/components/CurrencySelectorElement.js.map +1 -1
  89. package/lib/module/components/PaymentMethodMessagingElement.js +1 -1
  90. package/lib/module/components/PaymentMethodMessagingElement.js.map +1 -1
  91. package/lib/module/components/PlatformPayButton.js +1 -1
  92. package/lib/module/components/PlatformPayButton.js.map +1 -1
  93. package/lib/module/components/StripeContainer.js +1 -1
  94. package/lib/module/components/StripeContainer.js.map +1 -1
  95. package/lib/module/connect/Components.js +1 -1
  96. package/lib/module/connect/Components.js.map +1 -1
  97. package/lib/module/connect/ConnectComponentsProvider.js +1 -1
  98. package/lib/module/connect/ConnectComponentsProvider.js.map +1 -1
  99. package/lib/module/connect/EmbeddedComponent.js +1 -1
  100. package/lib/module/connect/EmbeddedComponent.js.map +1 -1
  101. package/lib/module/connect/ModalCloseButton.js +1 -1
  102. package/lib/module/connect/ModalCloseButton.js.map +1 -1
  103. package/lib/module/connect/NavigationBar.js +1 -1
  104. package/lib/module/connect/NavigationBar.js.map +1 -1
  105. package/lib/module/functions.js +1 -1
  106. package/lib/module/functions.js.map +1 -1
  107. package/lib/module/helpers.js +1 -1
  108. package/lib/module/hooks/useCheckout.js +1 -1
  109. package/lib/module/hooks/useCheckout.js.map +1 -1
  110. package/lib/module/hooks/useLinkController.js +2 -0
  111. package/lib/module/hooks/useLinkController.js.map +1 -0
  112. package/lib/module/index.js +1 -1
  113. package/lib/module/index.js.map +1 -1
  114. package/lib/module/specs/NativeAddToWalletButton.js +1 -1
  115. package/lib/module/specs/NativeAddressSheet.js +1 -1
  116. package/lib/module/specs/NativeApplePayButton.js +1 -1
  117. package/lib/module/specs/NativeAuBECSDebitForm.js +1 -1
  118. package/lib/module/specs/NativeCardField.js +1 -1
  119. package/lib/module/specs/NativeCardField.js.map +1 -1
  120. package/lib/module/specs/NativeCardForm.js +1 -1
  121. package/lib/module/specs/NativeCardForm.js.map +1 -1
  122. package/lib/module/specs/NativeConnectAccountOnboardingView.js +1 -1
  123. package/lib/module/specs/NativeCurrencySelectorElement.js +1 -1
  124. package/lib/module/specs/NativeEmbeddedPaymentElement.js +1 -1
  125. package/lib/module/specs/NativeEmbeddedPaymentElement.js.map +1 -1
  126. package/lib/module/specs/NativeGooglePayButton.js +1 -1
  127. package/lib/module/specs/NativeNavigationBar.js +1 -1
  128. package/lib/module/specs/NativePaymentMethodMessagingElement.js +1 -1
  129. package/lib/module/specs/NativeStripeContainer.js +1 -1
  130. package/lib/module/specs/NativeStripeSdkModule.js.map +1 -1
  131. package/lib/module/types/EmbeddedPaymentElement.js +1 -1
  132. package/lib/module/types/EmbeddedPaymentElement.js.map +1 -1
  133. package/lib/module/types/Errors.js +1 -1
  134. package/lib/module/types/Errors.js.map +1 -1
  135. package/lib/module/types/LinkController.js +2 -0
  136. package/lib/module/types/LinkController.js.map +1 -0
  137. package/lib/module/types/index.js +1 -1
  138. package/lib/module/types/index.js.map +1 -1
  139. package/lib/typescript/src/connect/Components.d.ts +1 -1
  140. package/lib/typescript/src/connect/Components.d.ts.map +1 -1
  141. package/lib/typescript/src/functions.d.ts +19 -1
  142. package/lib/typescript/src/functions.d.ts.map +1 -1
  143. package/lib/typescript/src/hooks/useCheckout.d.ts.map +1 -1
  144. package/lib/typescript/src/hooks/useLinkController.d.ts +28 -0
  145. package/lib/typescript/src/hooks/useLinkController.d.ts.map +1 -0
  146. package/lib/typescript/src/index.d.ts +1 -0
  147. package/lib/typescript/src/index.d.ts.map +1 -1
  148. package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts +5 -2
  149. package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts.map +1 -1
  150. package/lib/typescript/src/types/Checkout.d.ts +1 -14
  151. package/lib/typescript/src/types/Checkout.d.ts.map +1 -1
  152. package/lib/typescript/src/types/Errors.d.ts +8 -0
  153. package/lib/typescript/src/types/Errors.d.ts.map +1 -1
  154. package/lib/typescript/src/types/LinkController.d.ts +71 -0
  155. package/lib/typescript/src/types/LinkController.d.ts.map +1 -0
  156. package/lib/typescript/src/types/Onramp.d.ts +0 -13
  157. package/lib/typescript/src/types/Onramp.d.ts.map +1 -1
  158. package/lib/typescript/src/types/index.d.ts +2 -1
  159. package/lib/typescript/src/types/index.d.ts.map +1 -1
  160. package/package.json +1 -1
  161. package/src/connect/Components.tsx +10 -0
  162. package/src/functions.ts +48 -0
  163. package/src/hooks/useCheckout.tsx +0 -14
  164. package/src/hooks/useLinkController.tsx +54 -0
  165. package/src/index.tsx +1 -0
  166. package/src/specs/NativeStripeSdkModule.ts +11 -7
  167. package/src/types/Checkout.ts +1 -19
  168. package/src/types/Errors.ts +9 -0
  169. package/src/types/LinkController.ts +75 -0
  170. package/src/types/Onramp.ts +0 -14
  171. package/src/types/index.ts +2 -0
  172. package/stripe-react-native.podspec +1 -1
@@ -106,3 +106,12 @@ export enum RadarError {
106
106
  Failed = 'Failed',
107
107
  Unknown = 'Unknown',
108
108
  }
109
+
110
+ /**
111
+ * @PrivatePreview
112
+ */
113
+ export enum LinkControllerError {
114
+ Failed = 'Failed',
115
+ Canceled = 'Canceled',
116
+ Unknown = 'Unknown',
117
+ }
@@ -0,0 +1,75 @@
1
+ import type { Result as PaymentMethodResult } from './PaymentMethod';
2
+ import type { LinkControllerError, StripeError } from './Errors';
3
+
4
+ /**
5
+ * @PrivatePreview Payment method types supported by the Link flow.
6
+ */
7
+ export enum LinkPaymentMethodType {
8
+ Card = 'card',
9
+ BankAccount = 'bankAccount',
10
+ }
11
+
12
+ /**
13
+ * @PrivatePreview Configuration for initializing the Link controller.
14
+ */
15
+ export type Configuration = {
16
+ /** The customer's email address used for Link consumer lookup. */
17
+ email?: string;
18
+ /** Your customer-facing business name, displayed in Link UI. */
19
+ merchantDisplayName: string;
20
+ /** Payment method types to support in the Link sheet. If omitted, all available types are shown. */
21
+ supportedPaymentMethodTypes?: LinkPaymentMethodType[];
22
+ /** Customer phone number in E.164 format to prefill during signup. */
23
+ phoneNumber?: string;
24
+ /** Whether to allow the user to log out. Defaults to true. */
25
+ allowLogout?: boolean;
26
+ /**
27
+ * Optional SetupIntent client secret. When provided, the SDK confirms the SetupIntent
28
+ * with the selected payment method automatically before returning.
29
+ */
30
+ setupIntentClientSecret?: string;
31
+ };
32
+
33
+ /**
34
+ * @PrivatePreview A preview of the payment method the user selected in Link.
35
+ * Intended for display in the host app's checkout UI after the flow completes.
36
+ */
37
+ export type PaymentMethodPreview = {
38
+ /**
39
+ * Payment method icon as a data URI PNG string (e.g., "data:image/png;base64,...").
40
+ * Suitable for rendering directly in a React Native `<Image source={{ uri: icon }}>` component.
41
+ */
42
+ icon: string;
43
+ /** The Link label to render in your screen. */
44
+ label: string;
45
+ /** Details about the selected Link payment method. This will typically render the display name of the payment method followed by the last four digits, e.g. `Visa Credit •••• 4242`. */
46
+ sublabel?: string;
47
+ };
48
+
49
+ /**
50
+ * @PrivatePreview Result returned from `initLinkController`.
51
+ */
52
+ export type InitResult =
53
+ | { error?: undefined }
54
+ | { error: StripeError<LinkControllerError> };
55
+
56
+ /**
57
+ * @PrivatePreview Result returned from `presentLinkController`.
58
+ */
59
+ export type PresentResult =
60
+ | {
61
+ /** The payment method created from the user's Link selection. */
62
+ paymentMethod: PaymentMethodResult;
63
+ /** A preview of the selected payment method for display purposes. */
64
+ paymentMethodPreview?: PaymentMethodPreview;
65
+ error?: undefined;
66
+ }
67
+ | {
68
+ paymentMethod?: undefined;
69
+ paymentMethodPreview?: undefined;
70
+ /**
71
+ * Set when the operation failed or was canceled.
72
+ * Cancellation has `error.code === LinkControllerError.Canceled`.
73
+ */
74
+ error: StripeError<LinkControllerError>;
75
+ };
@@ -273,25 +273,11 @@ export type ComplianceIdentifierRequirements = {
273
273
  */
274
274
  export type OnrampErrorType = 'AppAttestationError' | 'UncategorizedApiError';
275
275
 
276
- /**
277
- * A native SDK component and version included in Crypto Onramp diagnostics.
278
- */
279
- export type SDKVersion = {
280
- /** The SDK component name. */
281
- name: string;
282
- /** The SDK component version. */
283
- version: string;
284
- };
285
-
286
276
  export type OnrampApiError = StripeError<OnrampError> & {
287
277
  onrampErrorType: string;
288
278
  developerMessage: string;
289
279
  userMessage: string;
290
280
  reason?: string;
291
- operation: string;
292
- appPackageName: string;
293
- mode?: 'live' | 'test';
294
- sdkVersions?: SDKVersion[];
295
281
  requestId?: string;
296
282
  apiErrorCode?: string;
297
283
  apiErrorType?: string;
@@ -28,6 +28,7 @@ import * as FinancialConnections from './FinancialConnections';
28
28
  import * as PlatformPay from './PlatformPay';
29
29
  import * as Onramp from './Onramp';
30
30
  import * as ConfirmationToken from './ConfirmationToken';
31
+ import * as LinkController from './LinkController';
31
32
 
32
33
  export {
33
34
  ApplePay,
@@ -44,6 +45,7 @@ export {
44
45
  PlatformPay,
45
46
  Onramp,
46
47
  ConfirmationToken,
48
+ LinkController,
47
49
  };
48
50
 
49
51
  export * from './PushProvisioning';
@@ -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 = '26.0.0'
5
+ stripe_version = '26.3.0'
6
6
 
7
7
  fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
8
8