@stripe/stripe-react-native 0.38.6 → 0.40.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 (41) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/android/.project +0 -11
  3. package/android/.settings/org.eclipse.buildship.core.prefs +3 -3
  4. package/android/gradle.properties +1 -1
  5. package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +4 -0
  6. package/android/src/main/java/com/reactnativestripesdk/CardFieldViewManager.kt +5 -0
  7. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +43 -8
  8. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +0 -60
  9. package/android/src/main/java/com/reactnativestripesdk/customersheet/CustomerSheetFragment.kt +3 -3
  10. package/android/src/main/java/com/reactnativestripesdk/customersheet/ReactNativeCustomerAdapter.kt +0 -2
  11. package/ios/CardFieldManager.m +1 -0
  12. package/ios/CardFieldView.swift +28 -39
  13. package/ios/CardFormManager.m +1 -0
  14. package/ios/StripeSdk+PaymentSheet.swift +17 -2
  15. package/ios/StripeSdk.swift +29 -66
  16. package/lib/commonjs/components/CardField.js +1 -1
  17. package/lib/commonjs/components/CardField.js.map +1 -1
  18. package/lib/commonjs/components/CustomerSheet.js +1 -1
  19. package/lib/commonjs/components/CustomerSheet.js.map +1 -1
  20. package/lib/commonjs/types/PaymentSheet.js +1 -1
  21. package/lib/commonjs/types/PaymentSheet.js.map +1 -1
  22. package/lib/commonjs/types/index.js +1 -1
  23. package/lib/commonjs/types/index.js.map +1 -1
  24. package/lib/module/components/CardField.js +1 -1
  25. package/lib/module/components/CardField.js.map +1 -1
  26. package/lib/module/components/CustomerSheet.js +1 -1
  27. package/lib/module/components/CustomerSheet.js.map +1 -1
  28. package/lib/module/types/PaymentSheet.js +1 -1
  29. package/lib/module/types/PaymentSheet.js.map +1 -1
  30. package/lib/module/types/index.js +1 -1
  31. package/lib/module/types/index.js.map +1 -1
  32. package/lib/typescript/src/components/CardField.d.ts +2 -0
  33. package/lib/typescript/src/components/CustomerSheet.d.ts +3 -3
  34. package/lib/typescript/src/types/PaymentSheet.d.ts +33 -3
  35. package/lib/typescript/src/types/index.d.ts +1 -0
  36. package/package.json +1 -1
  37. package/src/components/CardField.tsx +2 -0
  38. package/src/components/CustomerSheet.tsx +3 -3
  39. package/src/types/PaymentSheet.ts +40 -3
  40. package/src/types/index.ts +1 -0
  41. package/stripe-react-native.podspec +1 -1
@@ -46,6 +46,8 @@ export interface Props extends AccessibilityProps {
46
46
  /** The list of preferred networks that should be used to process payments made with a co-branded card.
47
47
  * This value will only be used if your user hasn't selected a network themselves. */
48
48
  preferredNetworks?: Array<CardBrand>;
49
+ /** The account (if any) for which the funds of the intent are intended. */
50
+ onBehalfOf?: string;
49
51
  /**
50
52
  * WARNING: If set to `true` the full card number will be returned in the `onCardChange` handler.
51
53
  * Only do this if you're certain that you fulfill the necessary PCI compliance requirements.
@@ -257,7 +257,7 @@ export type Props = {
257
257
  * @returns JSX.Element
258
258
  * @category ReactComponents
259
259
  */
260
- function CustomerSheet({
260
+ function Component({
261
261
  visible,
262
262
  presentationStyle,
263
263
  animationStyle,
@@ -319,8 +319,8 @@ function CustomerSheet({
319
319
  /**
320
320
  * The Customer Sheet is a prebuilt UI component that lets your customers manage their saved payment methods.
321
321
  */
322
- export const CustomerSheetBeta = {
323
- CustomerSheet,
322
+ export const CustomerSheet = {
323
+ Component,
324
324
  initialize,
325
325
  present,
326
326
  retrievePaymentOptionSelection,
@@ -10,13 +10,11 @@ import type { FutureUsage } from './PaymentIntent';
10
10
  import type { Result } from './PaymentMethod';
11
11
  import type { StripeError } from './Errors';
12
12
 
13
- export type SetupParams = IntentParams & {
13
+ type SetupParamsBase = IntentParams & {
14
14
  /** Your customer-facing business name. On Android, this is required and cannot be an empty string. */
15
15
  merchantDisplayName: string;
16
16
  /** The identifier of the Stripe Customer object. See https://stripe.com/docs/api/customers/object#customer_object-id */
17
17
  customerId?: string;
18
- /** A short-lived token that allows the SDK to access a Customer’s payment methods. */
19
- customerEphemeralKeySecret?: string;
20
18
  /** When set to true, separates out the payment method selection & confirmation steps.
21
19
  * If true, you must call `confirmPaymentSheetPayment` on your own. Defaults to false. */
22
20
  customFlow?: boolean;
@@ -67,8 +65,28 @@ export type SetupParams = IntentParams & {
67
65
  * If false, the customer can't delete if they only have one saved payment method remaining.
68
66
  */
69
67
  allowsRemovalOfLastSavedPaymentMethod?: boolean;
68
+ /**
69
+ * Defines the layout orientations available for displaying payment methods in PaymentSheet.
70
+ * - Note: Defaults to `Automatic` if not set
71
+ */
72
+ paymentMethodLayout?: PaymentMethodLayout;
70
73
  };
71
74
 
75
+ export type SetupParams =
76
+ | (SetupParamsBase & {
77
+ /** A short-lived token that allows the SDK to access a Customer’s payment methods. */
78
+ customerEphemeralKeySecret: string;
79
+ customerSessionClientSecret?: never;
80
+ })
81
+ | (SetupParamsBase & {
82
+ customerEphemeralKeySecret?: never;
83
+ /** (Experimental) This parameter can be changed or removed at any time (use at your own risk).
84
+ * The client secret of this Customer Session. Used on the client to set up secure access to the given customer.
85
+ */
86
+ customerSessionClientSecret: string;
87
+ })
88
+ | SetupParamsBase;
89
+
72
90
  export type IntentParams =
73
91
  | {
74
92
  paymentIntentClientSecret: string;
@@ -404,3 +422,22 @@ export type SetupMode = {
404
422
  Seealso: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage */
405
423
  setupFutureUsage: FutureUsage;
406
424
  };
425
+
426
+ export enum PaymentMethodLayout {
427
+ /**
428
+ * Payment methods are arranged horizontally.
429
+ * Users can swipe left or right to navigate through different payment methods.
430
+ */
431
+ Horizontal = 'Horizontal',
432
+
433
+ /**
434
+ * Payment methods are arranged vertically.
435
+ * Users can scroll up or down to navigate through different payment methods.
436
+ */
437
+ Vertical = 'Vertical',
438
+
439
+ /**
440
+ * This lets Stripe choose the best layout for payment methods in the sheet.
441
+ */
442
+ Automatic = 'Automatic',
443
+ }
@@ -46,6 +46,7 @@ export * from './Errors';
46
46
  export * from './CustomerSheet';
47
47
  export type { Address, BillingDetails, AddressDetails } from './Common';
48
48
  export { CardBrand } from './Common';
49
+ export { PaymentMethodLayout } from './PaymentSheet';
49
50
 
50
51
  /**
51
52
  * @ignore
@@ -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 = '~> 23.28.0'
5
+ stripe_version = '~> 23.32.0'
6
6
 
7
7
  Pod::Spec.new do |s|
8
8
  s.name = 'stripe-react-native'