@stripe/stripe-react-native 0.23.2 → 0.24.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 (66) hide show
  1. package/CHANGELOG.md +39 -9
  2. package/android/gradle.properties +2 -2
  3. package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +2 -1
  4. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +72 -16
  5. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +19 -2
  6. package/android/src/main/java/com/reactnativestripesdk/utils/Errors.kt +1 -1
  7. package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +1 -1
  8. package/ios/ApplePayButtonManager.m +1 -0
  9. package/ios/ApplePayButtonView.swift +2 -0
  10. package/ios/ApplePayUtils.swift +116 -15
  11. package/ios/ApplePayViewController.swift +13 -0
  12. package/ios/Errors.swift +1 -0
  13. package/ios/StripeSdk+PaymentSheet.swift +166 -0
  14. package/ios/StripeSdk-Bridging-Header.h +1 -0
  15. package/ios/StripeSdk.m +17 -1
  16. package/ios/StripeSdk.swift +67 -134
  17. package/lib/commonjs/NativeStripeSdk.js.map +1 -1
  18. package/lib/commonjs/components/PlatformPayButton.js +1 -1
  19. package/lib/commonjs/components/PlatformPayButton.js.map +1 -1
  20. package/lib/commonjs/functions.js +1 -1
  21. package/lib/commonjs/functions.js.map +1 -1
  22. package/lib/commonjs/hooks/usePaymentSheet.js +1 -1
  23. package/lib/commonjs/hooks/usePaymentSheet.js.map +1 -1
  24. package/lib/commonjs/hooks/useStripe.js +1 -1
  25. package/lib/commonjs/hooks/useStripe.js.map +1 -1
  26. package/lib/commonjs/types/Errors.js +1 -1
  27. package/lib/commonjs/types/Errors.js.map +1 -1
  28. package/lib/commonjs/types/PaymentSheet.js.map +1 -1
  29. package/lib/commonjs/types/PlatformPay.js +1 -1
  30. package/lib/commonjs/types/PlatformPay.js.map +1 -1
  31. package/lib/commonjs/types/components/ApplePayButtonComponent.js.map +1 -1
  32. package/lib/module/NativeStripeSdk.js.map +1 -1
  33. package/lib/module/components/PlatformPayButton.js +1 -1
  34. package/lib/module/components/PlatformPayButton.js.map +1 -1
  35. package/lib/module/functions.js +1 -1
  36. package/lib/module/functions.js.map +1 -1
  37. package/lib/module/hooks/usePaymentSheet.js +1 -1
  38. package/lib/module/hooks/usePaymentSheet.js.map +1 -1
  39. package/lib/module/hooks/useStripe.js +1 -1
  40. package/lib/module/hooks/useStripe.js.map +1 -1
  41. package/lib/module/types/Errors.js +1 -1
  42. package/lib/module/types/Errors.js.map +1 -1
  43. package/lib/module/types/PaymentSheet.js.map +1 -1
  44. package/lib/module/types/PlatformPay.js +1 -1
  45. package/lib/module/types/PlatformPay.js.map +1 -1
  46. package/lib/module/types/components/ApplePayButtonComponent.js.map +1 -1
  47. package/lib/typescript/src/NativeStripeSdk.d.ts +3 -1
  48. package/lib/typescript/src/components/PlatformPayButton.d.ts +6 -1
  49. package/lib/typescript/src/functions.d.ts +1 -1
  50. package/lib/typescript/src/hooks/usePaymentSheet.d.ts +1 -1
  51. package/lib/typescript/src/hooks/useStripe.d.ts +1 -1
  52. package/lib/typescript/src/types/Errors.d.ts +2 -1
  53. package/lib/typescript/src/types/PaymentSheet.d.ts +17 -1
  54. package/lib/typescript/src/types/PlatformPay.d.ts +64 -1
  55. package/lib/typescript/src/types/components/ApplePayButtonComponent.d.ts +1 -0
  56. package/package.json +2 -2
  57. package/src/NativeStripeSdk.tsx +13 -1
  58. package/src/components/PlatformPayButton.tsx +31 -3
  59. package/src/functions.ts +34 -21
  60. package/src/hooks/usePaymentSheet.tsx +2 -2
  61. package/src/hooks/useStripe.tsx +8 -4
  62. package/src/types/Errors.ts +1 -0
  63. package/src/types/PaymentSheet.ts +33 -3
  64. package/src/types/PlatformPay.ts +72 -1
  65. package/src/types/components/ApplePayButtonComponent.ts +1 -0
  66. package/stripe-react-native.podspec +1 -1
@@ -69,6 +69,77 @@ export type ApplePayBaseParams = {
69
69
  supportedCountries?: Array<string>;
70
70
  };
71
71
 
72
+ export type ApplePayConfirmParams = {
73
+ /** A typical request is for a one-time payment. To support different types of payment requests, include a PaymentRequestType. Only supported on iOS 16 and up. */
74
+ request?:
75
+ | RecurringPaymentRequest
76
+ | AutomaticReloadPaymentRequest
77
+ | MultiMerchantRequest;
78
+ };
79
+
80
+ export enum PaymentRequestType {
81
+ Recurring = 'Recurring',
82
+ AutomaticReload = 'AutomaticReload',
83
+ MultiMerchant = 'MultiMerchant',
84
+ }
85
+
86
+ /** Use this for a recurring payment, typically a subscription. */
87
+ export type RecurringPaymentRequest = {
88
+ type: PaymentRequestType.Recurring;
89
+ /** A description that you provide of the recurring payment and that Apple Pay displays to the user in the sheet. */
90
+ description: string;
91
+ /** A URL to a web page where the user can update or delete the payment method for the recurring payment. */
92
+ managementUrl: string;
93
+ /** The regular billing cycle for the payment, including start and end dates, an interval, and an interval count. */
94
+ billing: RecurringCartSummaryItem;
95
+ /** Same as the billing property, but use this if the purchase has a trial period. */
96
+ trialBilling?: RecurringCartSummaryItem;
97
+ /** A localized billing agreement that the sheet displays to the user before the user authorizes the payment. */
98
+ billingAgreement?: string;
99
+ /** A URL you provide to receive life-cycle notifications from the Apple Pay servers about the Apple Pay merchant token for the recurring payment.
100
+ * For more information about handling merchant token life-cycle notifications, see Receiving and handling merchant token notifications.
101
+ */
102
+ tokenNotificationURL?: string;
103
+ };
104
+
105
+ /** Use this for an automatic reload or refill payment, such as a store card top-up. */
106
+ export type AutomaticReloadPaymentRequest = {
107
+ type: PaymentRequestType.AutomaticReload;
108
+ /** A description that you provide of the recurring payment and that Apple Pay displays to the user in the sheet. */
109
+ description: string;
110
+ /** A URL to a web page where the user can update or delete the payment method for the recurring payment. */
111
+ managementUrl: string;
112
+ /** A short, localized description of the item. */
113
+ label: string;
114
+ /** This is the amount that is automatically applied to the account when the account balance drops below the threshold amount. */
115
+ reloadAmount: string;
116
+ /** The balance an account reaches before you apply the automatic reload amount. */
117
+ thresholdAmount: string;
118
+ /** A localized billing agreement that the sheet displays to the user before the user authorizes the payment. */
119
+ billingAgreement?: string;
120
+ /** A URL you provide to receive life-cycle notifications from the Apple Pay servers about the Apple Pay merchant token for the recurring payment.
121
+ * For more information about handling merchant token life-cycle notifications, see Receiving and handling merchant token notifications.
122
+ */
123
+ tokenNotificationURL?: string;
124
+ };
125
+
126
+ /** Use this to indicate payments for multiple merchants. */
127
+ export type MultiMerchantRequest = {
128
+ type: PaymentRequestType.MultiMerchant;
129
+ merchants: Array<{
130
+ /** The Apple Pay merchant identifier. */
131
+ merchantIdentifier: string;
132
+ /** An external identifier for the merchant. */
133
+ externalIdentifier: string;
134
+ /** The merchant’s display name that the Apple Pay server associates with the payment token. */
135
+ merchantName: string;
136
+ /** The merchant’s top-level domain that the Apple Pay server associates with the payment token. */
137
+ merchantDomain?: string;
138
+ /** The amount to authorize for the payment token. */
139
+ amount: string;
140
+ }>;
141
+ };
142
+
72
143
  export type ApplePayPaymentMethodParams = {
73
144
  /** Set this value to true to display the coupon code field, or pass the 'couponCode' field to autofill with a coupon code. Defaults to false. If true, you must implement the PlatformPayButton component's `onCouponCodeEntered` callback and call `updatePlatformPaySheet` from there. */
74
145
  supportsCouponCode?: boolean;
@@ -158,7 +229,7 @@ export type ConfirmParams = {
158
229
  /** Defines Google Pay behavior. Android only. */
159
230
  googlePay?: GooglePayBaseParams;
160
231
  /** Defines Apple Pay behavior. iOS only. */
161
- applePay?: ApplePayBaseParams;
232
+ applePay?: ApplePayBaseParams & ApplePayConfirmParams;
162
233
  };
163
234
 
164
235
  export enum ButtonType {
@@ -22,6 +22,7 @@ export interface NativeProps {
22
22
  couponCode: string;
23
23
  }>
24
24
  ) => void;
25
+ onOrderTrackingAction?: () => void;
25
26
  }
26
27
 
27
28
  export type Type =
@@ -1,7 +1,7 @@
1
1
  require 'json'
2
2
 
3
3
  package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
- stripe_version = '~> 23.3.0'
4
+ stripe_version = '~> 23.3.3'
5
5
 
6
6
  Pod::Spec.new do |s|
7
7
  s.name = 'stripe-react-native'