@stripe/stripe-react-native 0.23.3 → 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.
- package/CHANGELOG.md +34 -10
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +72 -16
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +19 -2
- package/android/src/main/java/com/reactnativestripesdk/utils/Errors.kt +1 -1
- package/ios/ApplePayButtonManager.m +1 -0
- package/ios/ApplePayButtonView.swift +2 -0
- package/ios/ApplePayUtils.swift +116 -15
- package/ios/ApplePayViewController.swift +13 -0
- package/ios/Errors.swift +1 -0
- package/ios/StripeSdk+PaymentSheet.swift +166 -0
- package/ios/StripeSdk-Bridging-Header.h +1 -0
- package/ios/StripeSdk.m +17 -1
- package/ios/StripeSdk.swift +67 -134
- package/lib/commonjs/NativeStripeSdk.js.map +1 -1
- package/lib/commonjs/components/PlatformPayButton.js +1 -1
- package/lib/commonjs/components/PlatformPayButton.js.map +1 -1
- package/lib/commonjs/functions.js +1 -1
- package/lib/commonjs/functions.js.map +1 -1
- package/lib/commonjs/hooks/usePaymentSheet.js +1 -1
- package/lib/commonjs/hooks/usePaymentSheet.js.map +1 -1
- package/lib/commonjs/hooks/useStripe.js +1 -1
- package/lib/commonjs/hooks/useStripe.js.map +1 -1
- package/lib/commonjs/types/Errors.js +1 -1
- package/lib/commonjs/types/Errors.js.map +1 -1
- package/lib/commonjs/types/PaymentSheet.js.map +1 -1
- package/lib/commonjs/types/PlatformPay.js +1 -1
- package/lib/commonjs/types/PlatformPay.js.map +1 -1
- package/lib/commonjs/types/components/ApplePayButtonComponent.js.map +1 -1
- package/lib/module/NativeStripeSdk.js.map +1 -1
- package/lib/module/components/PlatformPayButton.js +1 -1
- package/lib/module/components/PlatformPayButton.js.map +1 -1
- package/lib/module/functions.js +1 -1
- package/lib/module/functions.js.map +1 -1
- package/lib/module/hooks/usePaymentSheet.js +1 -1
- package/lib/module/hooks/usePaymentSheet.js.map +1 -1
- package/lib/module/hooks/useStripe.js +1 -1
- package/lib/module/hooks/useStripe.js.map +1 -1
- package/lib/module/types/Errors.js +1 -1
- package/lib/module/types/Errors.js.map +1 -1
- package/lib/module/types/PaymentSheet.js.map +1 -1
- package/lib/module/types/PlatformPay.js +1 -1
- package/lib/module/types/PlatformPay.js.map +1 -1
- package/lib/module/types/components/ApplePayButtonComponent.js.map +1 -1
- package/lib/typescript/src/NativeStripeSdk.d.ts +3 -1
- package/lib/typescript/src/components/PlatformPayButton.d.ts +6 -1
- package/lib/typescript/src/functions.d.ts +1 -1
- package/lib/typescript/src/hooks/usePaymentSheet.d.ts +1 -1
- package/lib/typescript/src/hooks/useStripe.d.ts +1 -1
- package/lib/typescript/src/types/Errors.d.ts +2 -1
- package/lib/typescript/src/types/PaymentSheet.d.ts +17 -1
- package/lib/typescript/src/types/PlatformPay.d.ts +64 -1
- package/lib/typescript/src/types/components/ApplePayButtonComponent.d.ts +1 -0
- package/package.json +1 -1
- package/src/NativeStripeSdk.tsx +13 -1
- package/src/components/PlatformPayButton.tsx +31 -3
- package/src/functions.ts +34 -21
- package/src/hooks/usePaymentSheet.tsx +2 -2
- package/src/hooks/useStripe.tsx +8 -4
- package/src/types/Errors.ts +1 -0
- package/src/types/PaymentSheet.ts +33 -3
- package/src/types/PlatformPay.ts +72 -1
- package/src/types/components/ApplePayButtonComponent.ts +1 -0
- package/stripe-react-native.podspec +1 -1
package/src/types/PlatformPay.ts
CHANGED
|
@@ -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 {
|