@stripe/stripe-react-native 0.57.3 → 0.59.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 (233) hide show
  1. package/android/build.gradle +2 -0
  2. package/android/gradle.properties +1 -1
  3. package/android/src/main/AndroidManifest.xml +27 -1
  4. package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementView.kt +0 -3
  5. package/android/src/main/java/com/reactnativestripesdk/EmbeddedPaymentElementViewManager.kt +7 -3
  6. package/android/src/main/java/com/reactnativestripesdk/EventEmitterCompat.kt +8 -0
  7. package/android/src/main/java/com/reactnativestripesdk/NavigationBarView.kt +12 -1
  8. package/android/src/main/java/com/reactnativestripesdk/PaymentElementConfig.kt +26 -0
  9. package/android/src/main/java/com/reactnativestripesdk/PaymentMethodMessagingElementConfig.kt +147 -0
  10. package/android/src/main/java/com/reactnativestripesdk/PaymentMethodMessagingElementView.kt +164 -0
  11. package/android/src/main/java/com/reactnativestripesdk/PaymentMethodMessagingElementViewManager.kt +65 -0
  12. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetAppearance.kt +1 -1
  13. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetManager.kt +60 -31
  14. package/android/src/main/java/com/reactnativestripesdk/StripeAbstractComposeView.kt +17 -5
  15. package/android/src/main/java/com/reactnativestripesdk/StripeConnectDeepLinkInterceptorActivity.kt +77 -0
  16. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +334 -24
  17. package/android/src/main/java/com/reactnativestripesdk/StripeSdkPackage.kt +1 -0
  18. package/android/src/main/java/com/reactnativestripesdk/customersheet/CustomerSheetManager.kt +3 -0
  19. package/android/src/main/java/com/reactnativestripesdk/utils/Errors.kt +8 -0
  20. package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +0 -2
  21. package/android/src/main/res/xml/file_paths.xml +4 -0
  22. package/android/src/oldarch/java/com/facebook/react/viewmanagers/PaymentMethodMessagingElementViewManagerDelegate.java +36 -0
  23. package/android/src/oldarch/java/com/facebook/react/viewmanagers/PaymentMethodMessagingElementViewManagerInterface.java +18 -0
  24. package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +20 -0
  25. package/android/src/test/java/com/reactnativestripesdk/PaymentElementConfigTest.kt +175 -1
  26. package/android/src/test/java/com/reactnativestripesdk/PaymentMethodMessagingElementConfigTest.kt +543 -0
  27. package/android/src/test/java/com/reactnativestripesdk/PaymentSheetManagerTest.kt +70 -0
  28. package/ios/ConnectAccountOnboarding/ConnectAccountOnboardingView.swift +13 -19
  29. package/ios/CustomerSheet/CustomerSheetUtils.swift +4 -0
  30. package/ios/OldArch/StripeSdkEventEmitterCompat.h +2 -0
  31. package/ios/OldArch/StripeSdkEventEmitterCompat.m +13 -1
  32. package/ios/PaymentMethodMessagingElementConfig.swift +116 -0
  33. package/ios/PaymentMethodMessagingElementHandler.m +9 -0
  34. package/ios/PaymentMethodMessagingElementView.swift +139 -0
  35. package/ios/StripeSdk.mm +40 -0
  36. package/ios/StripeSdkEmitter.swift +2 -0
  37. package/ios/StripeSdkImpl+CustomerSheet.swift +1 -0
  38. package/ios/StripeSdkImpl+Embedded.swift +8 -1
  39. package/ios/StripeSdkImpl+PaymentSheet.swift +44 -1
  40. package/ios/StripeSdkImpl.swift +158 -2
  41. package/jest/mock.js +26 -0
  42. package/jest/setup.js +30 -0
  43. package/lib/commonjs/components/AddToWalletButton.js +1 -1
  44. package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
  45. package/lib/commonjs/components/AddressSheet.js +1 -1
  46. package/lib/commonjs/components/AddressSheet.js.map +1 -1
  47. package/lib/commonjs/components/AuBECSDebitForm.js +1 -1
  48. package/lib/commonjs/components/AuBECSDebitForm.js.map +1 -1
  49. package/lib/commonjs/components/CardField.js +1 -1
  50. package/lib/commonjs/components/CardField.js.map +1 -1
  51. package/lib/commonjs/components/CardForm.js +1 -1
  52. package/lib/commonjs/components/CardForm.js.map +1 -1
  53. package/lib/commonjs/components/PlatformPayButton.js +1 -1
  54. package/lib/commonjs/components/PlatformPayButton.js.map +1 -1
  55. package/lib/commonjs/components/StripeContainer.js +1 -1
  56. package/lib/commonjs/components/StripeContainer.js.map +1 -1
  57. package/lib/commonjs/connect/Components.js +1 -1
  58. package/lib/commonjs/connect/Components.js.map +1 -1
  59. package/lib/commonjs/connect/ConnectComponentsProvider.js +1 -1
  60. package/lib/commonjs/connect/ConnectComponentsProvider.js.map +1 -1
  61. package/lib/commonjs/connect/EmbeddedComponent.js +10 -5
  62. package/lib/commonjs/connect/EmbeddedComponent.js.map +1 -1
  63. package/lib/commonjs/connect/ModalCloseButton.js +1 -1
  64. package/lib/commonjs/connect/ModalCloseButton.js.map +1 -1
  65. package/lib/commonjs/connect/NavigationBar.js +1 -1
  66. package/lib/commonjs/connect/NavigationBar.js.map +1 -1
  67. package/lib/commonjs/connect/analytics/AnalyticsClient.js +2 -0
  68. package/lib/commonjs/connect/analytics/AnalyticsClient.js.map +1 -0
  69. package/lib/commonjs/connect/analytics/ComponentAnalyticsClient.js +2 -0
  70. package/lib/commonjs/connect/analytics/ComponentAnalyticsClient.js.map +1 -0
  71. package/lib/commonjs/connect/analytics/events.js +2 -0
  72. package/lib/commonjs/connect/analytics/events.js.map +1 -0
  73. package/lib/commonjs/connect/testUtils.js +2 -0
  74. package/lib/commonjs/connect/testUtils.js.map +1 -0
  75. package/lib/commonjs/events.js.map +1 -1
  76. package/lib/commonjs/functions.js +1 -1
  77. package/lib/commonjs/functions.js.map +1 -1
  78. package/lib/commonjs/helpers.js +1 -1
  79. package/lib/commonjs/hooks/useStripe.js +1 -1
  80. package/lib/commonjs/hooks/useStripe.js.map +1 -1
  81. package/lib/commonjs/specs/NativeAddToWalletButton.js +1 -1
  82. package/lib/commonjs/specs/NativeAddressSheet.js +1 -1
  83. package/lib/commonjs/specs/NativeApplePayButton.js +1 -1
  84. package/lib/commonjs/specs/NativeAuBECSDebitForm.js +1 -1
  85. package/lib/commonjs/specs/NativeCardField.js +1 -1
  86. package/lib/commonjs/specs/NativeCardField.js.map +1 -1
  87. package/lib/commonjs/specs/NativeCardForm.js +1 -1
  88. package/lib/commonjs/specs/NativeCardForm.js.map +1 -1
  89. package/lib/commonjs/specs/NativeConnectAccountOnboardingView.js +1 -1
  90. package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js +1 -1
  91. package/lib/commonjs/specs/NativeEmbeddedPaymentElement.js.map +1 -1
  92. package/lib/commonjs/specs/NativeGooglePayButton.js +1 -1
  93. package/lib/commonjs/specs/NativeNavigationBar.js +1 -1
  94. package/lib/commonjs/specs/NativePaymentMethodMessagingElement.js +2 -0
  95. package/lib/commonjs/specs/NativePaymentMethodMessagingElement.js.map +1 -0
  96. package/lib/commonjs/specs/NativeStripeContainer.js +1 -1
  97. package/lib/commonjs/specs/NativeStripeSdkModule.js.map +1 -1
  98. package/lib/commonjs/types/EmbeddedPaymentElement.js +1 -1
  99. package/lib/commonjs/types/EmbeddedPaymentElement.js.map +1 -1
  100. package/lib/commonjs/types/Errors.js +1 -1
  101. package/lib/commonjs/types/Errors.js.map +1 -1
  102. package/lib/commonjs/types/FinancialConnections.js.map +1 -1
  103. package/lib/commonjs/types/PaymentSheet.js +1 -1
  104. package/lib/commonjs/types/PaymentSheet.js.map +1 -1
  105. package/lib/commonjs/types/components/PaymentMethodMessagingElementComponent.js +2 -0
  106. package/lib/commonjs/types/components/PaymentMethodMessagingElementComponent.js.map +1 -0
  107. package/lib/commonjs/types/index.js.map +1 -1
  108. package/lib/module/components/AddToWalletButton.js +1 -1
  109. package/lib/module/components/AddToWalletButton.js.map +1 -1
  110. package/lib/module/components/AddressSheet.js +1 -1
  111. package/lib/module/components/AddressSheet.js.map +1 -1
  112. package/lib/module/components/AuBECSDebitForm.js +1 -1
  113. package/lib/module/components/AuBECSDebitForm.js.map +1 -1
  114. package/lib/module/components/CardField.js +1 -1
  115. package/lib/module/components/CardField.js.map +1 -1
  116. package/lib/module/components/CardForm.js +1 -1
  117. package/lib/module/components/CardForm.js.map +1 -1
  118. package/lib/module/components/PlatformPayButton.js +1 -1
  119. package/lib/module/components/PlatformPayButton.js.map +1 -1
  120. package/lib/module/components/StripeContainer.js +1 -1
  121. package/lib/module/components/StripeContainer.js.map +1 -1
  122. package/lib/module/connect/Components.js +1 -1
  123. package/lib/module/connect/Components.js.map +1 -1
  124. package/lib/module/connect/ConnectComponentsProvider.js +1 -1
  125. package/lib/module/connect/ConnectComponentsProvider.js.map +1 -1
  126. package/lib/module/connect/EmbeddedComponent.js +10 -5
  127. package/lib/module/connect/EmbeddedComponent.js.map +1 -1
  128. package/lib/module/connect/ModalCloseButton.js +1 -1
  129. package/lib/module/connect/ModalCloseButton.js.map +1 -1
  130. package/lib/module/connect/NavigationBar.js +1 -1
  131. package/lib/module/connect/NavigationBar.js.map +1 -1
  132. package/lib/module/connect/analytics/AnalyticsClient.js +2 -0
  133. package/lib/module/connect/analytics/AnalyticsClient.js.map +1 -0
  134. package/lib/module/connect/analytics/ComponentAnalyticsClient.js +2 -0
  135. package/lib/module/connect/analytics/ComponentAnalyticsClient.js.map +1 -0
  136. package/lib/module/connect/analytics/events.js +2 -0
  137. package/lib/module/connect/analytics/events.js.map +1 -0
  138. package/lib/module/connect/testUtils.js +2 -0
  139. package/lib/module/connect/testUtils.js.map +1 -0
  140. package/lib/module/events.js.map +1 -1
  141. package/lib/module/functions.js +1 -1
  142. package/lib/module/functions.js.map +1 -1
  143. package/lib/module/helpers.js +1 -1
  144. package/lib/module/hooks/useStripe.js +1 -1
  145. package/lib/module/hooks/useStripe.js.map +1 -1
  146. package/lib/module/specs/NativeAddToWalletButton.js +1 -1
  147. package/lib/module/specs/NativeAddressSheet.js +1 -1
  148. package/lib/module/specs/NativeApplePayButton.js +1 -1
  149. package/lib/module/specs/NativeAuBECSDebitForm.js +1 -1
  150. package/lib/module/specs/NativeCardField.js +1 -1
  151. package/lib/module/specs/NativeCardField.js.map +1 -1
  152. package/lib/module/specs/NativeCardForm.js +1 -1
  153. package/lib/module/specs/NativeCardForm.js.map +1 -1
  154. package/lib/module/specs/NativeConnectAccountOnboardingView.js +1 -1
  155. package/lib/module/specs/NativeEmbeddedPaymentElement.js +1 -1
  156. package/lib/module/specs/NativeEmbeddedPaymentElement.js.map +1 -1
  157. package/lib/module/specs/NativeGooglePayButton.js +1 -1
  158. package/lib/module/specs/NativeNavigationBar.js +1 -1
  159. package/lib/module/specs/NativePaymentMethodMessagingElement.js +2 -0
  160. package/lib/module/specs/NativePaymentMethodMessagingElement.js.map +1 -0
  161. package/lib/module/specs/NativeStripeContainer.js +1 -1
  162. package/lib/module/specs/NativeStripeSdkModule.js.map +1 -1
  163. package/lib/module/types/EmbeddedPaymentElement.js +1 -1
  164. package/lib/module/types/EmbeddedPaymentElement.js.map +1 -1
  165. package/lib/module/types/Errors.js +1 -1
  166. package/lib/module/types/Errors.js.map +1 -1
  167. package/lib/module/types/FinancialConnections.js.map +1 -1
  168. package/lib/module/types/PaymentSheet.js +1 -1
  169. package/lib/module/types/PaymentSheet.js.map +1 -1
  170. package/lib/module/types/components/PaymentMethodMessagingElementComponent.js +2 -0
  171. package/lib/module/types/components/PaymentMethodMessagingElementComponent.js.map +1 -0
  172. package/lib/module/types/index.js.map +1 -1
  173. package/lib/typescript/src/connect/Components.d.ts +91 -0
  174. package/lib/typescript/src/connect/Components.d.ts.map +1 -1
  175. package/lib/typescript/src/connect/ConnectComponentsProvider.d.ts +61 -0
  176. package/lib/typescript/src/connect/ConnectComponentsProvider.d.ts.map +1 -1
  177. package/lib/typescript/src/connect/EmbeddedComponent.d.ts.map +1 -1
  178. package/lib/typescript/src/connect/analytics/AnalyticsClient.d.ts +32 -0
  179. package/lib/typescript/src/connect/analytics/AnalyticsClient.d.ts.map +1 -0
  180. package/lib/typescript/src/connect/analytics/ComponentAnalyticsClient.d.ts +94 -0
  181. package/lib/typescript/src/connect/analytics/ComponentAnalyticsClient.d.ts.map +1 -0
  182. package/lib/typescript/src/connect/analytics/events.d.ts +215 -0
  183. package/lib/typescript/src/connect/analytics/events.d.ts.map +1 -0
  184. package/lib/typescript/src/connect/connectTypes.d.ts +5 -1
  185. package/lib/typescript/src/connect/connectTypes.d.ts.map +1 -1
  186. package/lib/typescript/src/connect/testUtils.d.ts +45 -0
  187. package/lib/typescript/src/connect/testUtils.d.ts.map +1 -0
  188. package/lib/typescript/src/events.d.ts +2 -0
  189. package/lib/typescript/src/events.d.ts.map +1 -1
  190. package/lib/typescript/src/functions.d.ts +13 -1
  191. package/lib/typescript/src/functions.d.ts.map +1 -1
  192. package/lib/typescript/src/hooks/useStripe.d.ts +2 -1
  193. package/lib/typescript/src/hooks/useStripe.d.ts.map +1 -1
  194. package/lib/typescript/src/specs/NativePaymentMethodMessagingElement.d.ts +16 -0
  195. package/lib/typescript/src/specs/NativePaymentMethodMessagingElement.d.ts.map +1 -0
  196. package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts +16 -1
  197. package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts.map +1 -1
  198. package/lib/typescript/src/types/CustomerSheet.d.ts +5 -0
  199. package/lib/typescript/src/types/CustomerSheet.d.ts.map +1 -1
  200. package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts +11 -1
  201. package/lib/typescript/src/types/EmbeddedPaymentElement.d.ts.map +1 -1
  202. package/lib/typescript/src/types/Errors.d.ts +4 -0
  203. package/lib/typescript/src/types/Errors.d.ts.map +1 -1
  204. package/lib/typescript/src/types/FinancialConnections.d.ts +2 -0
  205. package/lib/typescript/src/types/FinancialConnections.d.ts.map +1 -1
  206. package/lib/typescript/src/types/PaymentSheet.d.ts +35 -0
  207. package/lib/typescript/src/types/PaymentSheet.d.ts.map +1 -1
  208. package/lib/typescript/src/types/components/PaymentMethodMessagingElementComponent.d.ts +69 -0
  209. package/lib/typescript/src/types/components/PaymentMethodMessagingElementComponent.d.ts.map +1 -0
  210. package/lib/typescript/src/types/index.d.ts +8 -1
  211. package/lib/typescript/src/types/index.d.ts.map +1 -1
  212. package/package.json +4 -1
  213. package/src/connect/Components.tsx +109 -11
  214. package/src/connect/ConnectComponentsProvider.tsx +69 -2
  215. package/src/connect/EmbeddedComponent.tsx +458 -23
  216. package/src/connect/analytics/AnalyticsClient.ts +75 -0
  217. package/src/connect/analytics/ComponentAnalyticsClient.ts +315 -0
  218. package/src/connect/analytics/events.ts +253 -0
  219. package/src/connect/connectTypes.ts +5 -1
  220. package/src/connect/testUtils.ts +37 -0
  221. package/src/events.ts +2 -0
  222. package/src/functions.ts +10 -0
  223. package/src/hooks/useStripe.tsx +8 -0
  224. package/src/specs/NativePaymentMethodMessagingElement.ts +25 -0
  225. package/src/specs/NativeStripeSdkModule.ts +21 -1
  226. package/src/types/CustomerSheet.ts +5 -0
  227. package/src/types/EmbeddedPaymentElement.tsx +11 -1
  228. package/src/types/Errors.ts +5 -0
  229. package/src/types/FinancialConnections.ts +2 -0
  230. package/src/types/PaymentSheet.ts +38 -1
  231. package/src/types/components/PaymentMethodMessagingElementComponent.tsx +74 -0
  232. package/src/types/index.ts +11 -0
  233. package/stripe-react-native.podspec +1 -1
package/src/functions.ts CHANGED
@@ -31,6 +31,7 @@ import type {
31
31
  CanAddCardToWalletResult,
32
32
  FinancialConnections,
33
33
  PlatformPay,
34
+ CreateRadarSessionResult,
34
35
  } from './types';
35
36
  import { Platform, EventSubscription } from 'react-native';
36
37
  import type { CollectFinancialConnectionsAccountsParams } from './types/FinancialConnections';
@@ -910,6 +911,15 @@ export const openPlatformPaySetup = async (): Promise<void> => {
910
911
  }
911
912
  };
912
913
 
914
+ /**
915
+ * Creates a [Radar session](https://docs.stripe.com/radar/radar-session).
916
+ * @returns A promise that resolves to a Radar session id, or an error.
917
+ */
918
+ export const createRadarSession =
919
+ async (): Promise<CreateRadarSessionResult> => {
920
+ return await NativeStripeSdk.createRadarSession();
921
+ };
922
+
913
923
  export const setFinancialConnectionsForceNativeFlow = async (
914
924
  enabled: boolean
915
925
  ): Promise<void> => {
@@ -27,6 +27,7 @@ import type {
27
27
  FinancialConnections,
28
28
  PlatformPay,
29
29
  PlatformPayError,
30
+ CreateRadarSessionResult,
30
31
  } from '../types';
31
32
  import { useCallback } from 'react';
32
33
  import {
@@ -59,6 +60,7 @@ import {
59
60
  createPlatformPayToken,
60
61
  updatePlatformPaySheet,
61
62
  openPlatformPaySetup,
63
+ createRadarSession,
62
64
  } from '../functions';
63
65
  import type { CollectBankAccountTokenParams } from '../types/PaymentMethod';
64
66
  import type { CollectFinancialConnectionsAccountsParams } from '../types/FinancialConnections';
@@ -320,6 +322,11 @@ export function useStripe() {
320
322
  return openPlatformPaySetup();
321
323
  }, []);
322
324
 
325
+ const _createRadarSession =
326
+ useCallback(async (): Promise<CreateRadarSessionResult> => {
327
+ return createRadarSession();
328
+ }, []);
329
+
323
330
  return {
324
331
  retrievePaymentIntent: _retrievePaymentIntent,
325
332
  retrieveSetupIntent: _retrieveSetupIntent,
@@ -355,5 +362,6 @@ export function useStripe() {
355
362
  createPlatformPayToken: _createPlatformPayToken,
356
363
  updatePlatformPaySheet: _updatePlatformPaySheet,
357
364
  openPlatformPaySetup: _openPlatformPaySetup,
365
+ createRadarSession: _createRadarSession,
358
366
  };
359
367
  }
@@ -0,0 +1,25 @@
1
+ import type { HostComponent, ViewProps } from 'react-native';
2
+ import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
3
+ import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
4
+ import {
5
+ PaymentMethodMessagingElementAppearance,
6
+ PaymentMethodMessagingElementConfiguration,
7
+ PaymentMethodMessagingElementState,
8
+ } from '../types/components/PaymentMethodMessagingElementComponent';
9
+ import { UnsafeMixed } from './utils';
10
+
11
+ interface StateChangeEvent {
12
+ result: UnsafeMixed<PaymentMethodMessagingElementState>;
13
+ }
14
+
15
+ export interface NativeProps extends ViewProps {
16
+ appearance?: UnsafeMixed<PaymentMethodMessagingElementAppearance>;
17
+ configuration: UnsafeMixed<PaymentMethodMessagingElementConfiguration>;
18
+ onStateChange: DirectEventHandler<StateChangeEvent>;
19
+ }
20
+
21
+ type ComponentType = HostComponent<NativeProps>;
22
+
23
+ export default codegenNativeComponent<NativeProps>(
24
+ 'PaymentMethodMessagingElementView'
25
+ ) as ComponentType;
@@ -34,6 +34,7 @@ import type {
34
34
  StripeError,
35
35
  Token,
36
36
  VerifyMicrodepositsParams,
37
+ CreateRadarSessionResult,
37
38
  } from '../types';
38
39
  import type {
39
40
  EmbeddedPaymentElementConfiguration,
@@ -108,7 +109,16 @@ export interface Spec extends TurboModule {
108
109
  Omit<PaymentMethod.CollectBankAccountParams, 'onEvent'>
109
110
  >
110
111
  ): Promise<ConfirmSetupIntentResult | ConfirmPaymentResult>;
111
- getConstants(): { API_VERSIONS: { CORE: string; ISSUING: string } };
112
+ getConstants(): {
113
+ API_VERSIONS: { CORE: string; ISSUING: string };
114
+ SYSTEM_INFO: {
115
+ sdkVersion: string;
116
+ osVersion: string;
117
+ deviceType: string;
118
+ appName: string;
119
+ appVersion: string;
120
+ };
121
+ };
112
122
  canAddCardToWallet(
113
123
  params: UnsafeObject<CanAddCardToWalletParams>
114
124
  ): Promise<CanAddCardToWalletResult>;
@@ -193,6 +203,7 @@ export interface Spec extends TurboModule {
193
203
  intentConfig: UnsafeObject<IntentConfiguration>
194
204
  ): Promise<void>;
195
205
  clearEmbeddedPaymentOption(viewTag: Int32): Promise<void>;
206
+ createRadarSession(): Promise<CreateRadarSessionResult>;
196
207
 
197
208
  setFinancialConnectionsForceNativeFlow(enabled: boolean): Promise<void>;
198
209
 
@@ -201,6 +212,15 @@ export interface Spec extends TurboModule {
201
212
  url: string
202
213
  ): Promise<{ url?: string } | null>;
203
214
 
215
+ downloadAndShareFile(
216
+ url: string,
217
+ filename?: string | null
218
+ ): Promise<{ success: boolean; error?: string }>;
219
+ authWebViewDeepLinkHandled(id: string): Promise<void>;
220
+
221
+ storeStripeConnectDeepLink(url: string): Promise<void>;
222
+ pollAndClearPendingStripeConnectUrls(): Promise<string[]>;
223
+
204
224
  // Events
205
225
  addListener: (eventType: string) => void;
206
226
  removeListeners: (count: number) => void;
@@ -43,6 +43,11 @@ type CustomerSheetOptionalInitParams = {
43
43
  * Note: Card brand filtering is not currently supported in Link.
44
44
  */
45
45
  cardBrandAcceptance?: PaymentSheet.CardBrandAcceptance;
46
+ /** By default, CustomerSheet offers a card scan button within the new card entry form.
47
+ * When opensCardScannerAutomatically is set to true,
48
+ * the card entry form will initialize with the card scanner already open.
49
+ * Defaults to false. */
50
+ opensCardScannerAutomatically?: boolean;
46
51
  };
47
52
 
48
53
  /**
@@ -195,7 +195,12 @@ export interface EmbeddedPaymentElementConfiguration {
195
195
  * Note: Card brand filtering is not currently supported in Link.
196
196
  */
197
197
  cardBrandAcceptance?: PaymentSheetTypes.CardBrandAcceptance;
198
- /** The view can display payment methods like “Card” that, when tapped, open a sheet where customers enter their payment method details.
198
+ /**
199
+ * Configuration for filtering cards by funding type.
200
+ * @note This is a private preview API and will have no effect unless your Stripe account is enrolled in the private preview.
201
+ */
202
+ cardFundingFiltering?: PaymentSheetTypes.CardFundingFiltering;
203
+ /** The view can display payment methods like "Card" that, when tapped, open a sheet where customers enter their payment method details.
199
204
  * The sheet has a button at the bottom. `formSheetAction` controls the action the button performs. Defaults to 'continue'.
200
205
  */
201
206
  formSheetAction?: EmbeddedFormSheetAction;
@@ -210,6 +215,11 @@ export interface EmbeddedPaymentElementConfiguration {
210
215
  * Defaults to `true`.
211
216
  */
212
217
  embeddedViewDisplaysMandateText?: boolean;
218
+ /** By default, EmbeddedPaymentElement offers a card scan button within the new card entry form.
219
+ * When opensCardScannerAutomatically is set to true,
220
+ * the card entry form will initialize with the card scanner already open.
221
+ * Defaults to false. */
222
+ opensCardScannerAutomatically?: boolean;
213
223
  }
214
224
 
215
225
  // -----------------------------------------------------------------------------
@@ -107,3 +107,8 @@ export enum PlatformPayError {
107
107
  Failed = 'Failed',
108
108
  Unknown = 'Unknown',
109
109
  }
110
+
111
+ export enum RadarError {
112
+ Failed = 'Failed',
113
+ Unknown = 'Unknown',
114
+ }
@@ -7,6 +7,8 @@ export type CollectFinancialConnectionsAccountsParams = {
7
7
  style?: UserInterfaceStyle;
8
8
  /** An optional event listener to receive @type {FinancialConnectionEvent} for specific events during the process of a user connecting their financial accounts. */
9
9
  onEvent?: (event: FinancialConnectionsEvent) => void;
10
+ /** Optional connected account ID to use for this Financial Connections session. Used for Stripe Connect embedded components. */
11
+ connectedAccountId?: string;
10
12
  };
11
13
 
12
14
  export type SessionResult =
@@ -85,8 +85,18 @@ export type SetupParamsBase = IntentParams & {
85
85
  * Note: Card brand filtering is not currently supported in Link.
86
86
  */
87
87
  cardBrandAcceptance?: CardBrandAcceptance;
88
+ /**
89
+ * Configuration for filtering cards by funding type.
90
+ * @note This is a private preview API and will have no effect unless your Stripe account is enrolled in the private preview.
91
+ */
92
+ cardFundingFiltering?: CardFundingFiltering;
88
93
  /** Configuration for custom payment methods in PaymentSheet */
89
94
  customPaymentMethodConfiguration?: CustomPaymentMethodConfiguration;
95
+ /** By default, PaymentSheet offers a card scan button within the new card entry form.
96
+ * When opensCardScannerAutomatically is set to true,
97
+ * the card entry form will initialize with the card scanner already open.
98
+ * Defaults to false. */
99
+ opensCardScannerAutomatically?: boolean;
90
100
  };
91
101
 
92
102
  export type SetupParams =
@@ -644,7 +654,7 @@ export type PaymentMode = {
644
654
  };
645
655
 
646
656
  export type PaymentMethodOptions = {
647
- /* This is an experimental feature that may be removed at any time
657
+ /* This feature is in Public Preview. It may not be feature complete and have breaking changes as we develop and update functionality.
648
658
  A map of payment method types to setup_future_usage value. (e.g. card: 'OffSession') */
649
659
  setupFutureUsageValues: {
650
660
  [key: string]: FutureUsage;
@@ -680,6 +690,33 @@ export enum PaymentMethodLayout {
680
690
  Automatic = 'Automatic',
681
691
  }
682
692
 
693
+ /**
694
+ * Card funding types that can be filtered.
695
+ * @note This is a private preview API and will have no effect unless your Stripe account is enrolled in the private preview.
696
+ */
697
+ export enum CardFundingType {
698
+ /** Debit cards */
699
+ Debit = 'debit',
700
+ /** Credit cards */
701
+ Credit = 'credit',
702
+ /** Prepaid cards */
703
+ Prepaid = 'prepaid',
704
+ /**
705
+ * Unknown or undetermined funding type.
706
+ * Include this if you want to accept cards where the funding type cannot be determined from card metadata.
707
+ */
708
+ Unknown = 'unknown',
709
+ }
710
+
711
+ /**
712
+ * Configuration for filtering cards by funding type.
713
+ * @note This is a private preview API and will have no effect unless your Stripe account is enrolled in the private preview.
714
+ */
715
+ export type CardFundingFiltering = {
716
+ /** List of allowed card funding types. If not set, all types are accepted. */
717
+ allowedCardFundingTypes?: CardFundingType[];
718
+ };
719
+
683
720
  /** Card brand categories that can be allowed or disallowed */
684
721
  export enum CardBrandCategory {
685
722
  /** Visa branded cards */
@@ -0,0 +1,74 @@
1
+ import { NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';
2
+
3
+ import * as PaymentSheetTypes from '../PaymentSheet';
4
+
5
+ // -----------------------------------------------------------------------------
6
+ // Types
7
+ // -----------------------------------------------------------------------------
8
+
9
+ /**
10
+ * The current state of the PaymentMethodMessagingElement view. Typically loading, succeeded, no_content, or failed.
11
+ */
12
+ export type PaymentMethodMessagingElementState =
13
+ | { status: 'loading' }
14
+ | { status: 'loaded' }
15
+ | { status: 'no_content' }
16
+ | { status: 'failed'; error: Error };
17
+
18
+ /** Style for the images displayed by the element. */
19
+ export enum PaymentMethodMessagingElementStyle {
20
+ /** A flat style */
21
+ Flat = 'flat',
22
+ /** A dark style */
23
+ Dark = 'dark',
24
+ /** A light style */
25
+ Light = 'light',
26
+ }
27
+
28
+ export interface PaymentMethodMessagingElementAppearance {
29
+ /** Font settings for the element. */
30
+ font?: PaymentSheetTypes.FontConfig;
31
+ /** The color used for the element text. */
32
+ textColor?: PaymentSheetTypes.ThemedColor;
33
+ /** The color used for the text that links to available BNPL plans. */
34
+ linkTextColor?: PaymentSheetTypes.ThemedColor;
35
+ /** The theme of the images displayed by the element. */
36
+ style?: PaymentMethodMessagingElementStyle;
37
+ }
38
+
39
+ /**
40
+ * Configuration object.
41
+ */
42
+ export interface PaymentMethodMessagingElementConfiguration {
43
+ /** Amount intended to be collected in the smallest currency unit (e.g. 100 cents to charge $1.00). */
44
+ amount: number;
45
+ /** Three-letter ISO currency code, in lowercase. Must be a supported currency. */
46
+ currency: string;
47
+ /**
48
+ * Language code used to localize message displayed in the element.
49
+ * See [the Stripe documentation](https://docs.stripe.com/js/appendix/supported_locales) for a list of
50
+ * supported values. Defaults to the current device locale language.
51
+ * **Note**: Not all device locales are supported by Stripe, and English will be used in the case of
52
+ * an unsupported locale. If you want to ensure a specific locale is used, pass it explicitly.
53
+ */
54
+ locale?: string;
55
+ /** Two letter country code of the customer's location. If not provided, country will be determined based on IP Address. */
56
+ country?: string;
57
+ /**
58
+ * The payment methods to request messaging for. Supported values are "affirm", "afterpay_clearpay", and "klarna".
59
+ * If null, uses your preferences from the [Stripe dashboard](https://dashboard.stripe.com/settings/payment_methods) to show the relevant payment methods.
60
+ * See [Dynamic payment methods](https://docs.stripe.com/payments/payment-methods/dynamic-payment-methods) for more details.
61
+ */
62
+ paymentMethodTypes?: Array<string>;
63
+ }
64
+
65
+ export type OnStateChangeEvent = NativeSyntheticEvent<{
66
+ result: PaymentMethodMessagingElementState;
67
+ }>;
68
+
69
+ export interface NativeProps {
70
+ style?: StyleProp<ViewStyle>;
71
+ appearance?: PaymentMethodMessagingElementAppearance;
72
+ configuration: PaymentMethodMessagingElementConfiguration;
73
+ onStateChange(event: OnStateChangeEvent): void;
74
+ }
@@ -12,6 +12,7 @@ import type {
12
12
  StripeError,
13
13
  VerifyMicrodepositsError,
14
14
  CollectBankAccountError,
15
+ RadarError,
15
16
  } from './Errors';
16
17
  import * as ApplePay from './ApplePay';
17
18
  import * as PaymentIntent from './PaymentIntent';
@@ -176,6 +177,16 @@ export type ConfirmPaymentSheetPaymentResult = {
176
177
  error?: StripeError<PaymentSheetError>;
177
178
  };
178
179
 
180
+ export type CreateRadarSessionResult =
181
+ | {
182
+ id: string;
183
+ error?: undefined;
184
+ }
185
+ | {
186
+ id?: undefined;
187
+ error: StripeError<RadarError>;
188
+ };
189
+
179
190
  export type ApplePayResult =
180
191
  | {
181
192
  paymentMethod: PaymentMethod.Result;
@@ -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.0.1'
5
+ stripe_version = '~> 25.6.0'
6
6
 
7
7
  fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
8
8