@stripe/stripe-js 4.0.0 → 4.2.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/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/pure.js +1 -1
- package/dist/pure.mjs +1 -1
- package/dist/stripe-js/custom-checkout.d.mts +34 -0
- package/dist/stripe-js/custom-checkout.d.ts +34 -0
- package/dist/stripe-js/elements/payment.d.mts +21 -1
- package/dist/stripe-js/elements/payment.d.ts +21 -1
- package/dist/stripe-js/elements-group.d.mts +5 -0
- package/dist/stripe-js/elements-group.d.ts +5 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
package/dist/pure.js
CHANGED
package/dist/pure.mjs
CHANGED
|
@@ -100,6 +100,32 @@ export type StripeCustomCheckoutLastPaymentError = {
|
|
|
100
100
|
message: string;
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
+
export type StripeCustomCheckoutRedirectBehavior = 'always' | 'if_required';
|
|
104
|
+
|
|
105
|
+
export type StripeCustomCheckoutSavedPaymentMethod = {
|
|
106
|
+
id: string;
|
|
107
|
+
type: 'card';
|
|
108
|
+
card: {
|
|
109
|
+
brand: string;
|
|
110
|
+
expMonth: number;
|
|
111
|
+
expYear: number;
|
|
112
|
+
last4: string;
|
|
113
|
+
};
|
|
114
|
+
billingDetails: {
|
|
115
|
+
email?: string | null;
|
|
116
|
+
name?: string | null;
|
|
117
|
+
phone?: string | null;
|
|
118
|
+
address?: {
|
|
119
|
+
line1?: string | null;
|
|
120
|
+
line2?: string | null;
|
|
121
|
+
city?: string | null;
|
|
122
|
+
postal_code?: string | null;
|
|
123
|
+
state?: string | null;
|
|
124
|
+
country?: string | null;
|
|
125
|
+
} | null;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
|
|
103
129
|
export type StripeCustomCheckoutTaxAmount = {
|
|
104
130
|
amount: number;
|
|
105
131
|
inclusive: boolean;
|
|
@@ -179,15 +205,19 @@ export type StripeCustomCheckoutTrial = {
|
|
|
179
205
|
/* Custom Checkout session */
|
|
180
206
|
export interface StripeCustomCheckoutSession {
|
|
181
207
|
billingAddress: StripeCustomCheckoutContact | null;
|
|
208
|
+
businessName: string | null;
|
|
182
209
|
canConfirm: boolean;
|
|
183
210
|
confirmationRequirements: StripeCustomCheckoutConfirmationRequirement[];
|
|
184
211
|
currency: string;
|
|
185
212
|
discountAmounts: Array<StripeCustomCheckoutDiscountAmount> | null;
|
|
186
213
|
email: string | null;
|
|
214
|
+
id: string;
|
|
187
215
|
lastPaymentError: StripeCustomCheckoutLastPaymentError | null;
|
|
188
216
|
lineItems: Array<StripeCustomCheckoutLineItem>;
|
|
217
|
+
livemode: boolean;
|
|
189
218
|
phoneNumber: string | null;
|
|
190
219
|
recurring: StripeCustomCheckoutRecurring | null;
|
|
220
|
+
savedPaymentMethods: Array<StripeCustomCheckoutSavedPaymentMethod> | null;
|
|
191
221
|
shipping: StripeCustomCheckoutShipping | null;
|
|
192
222
|
shippingAddress: StripeCustomCheckoutContact | null;
|
|
193
223
|
shippingOptions: Array<StripeCustomCheckoutShippingOption>;
|
|
@@ -374,6 +404,10 @@ export interface StripeCustomCheckout {
|
|
|
374
404
|
) => Promise<StripeCustomCheckoutResult>;
|
|
375
405
|
confirm: (args?: {
|
|
376
406
|
return_url?: string;
|
|
407
|
+
returnUrl?: string;
|
|
408
|
+
redirect?: StripeCustomCheckoutRedirectBehavior;
|
|
409
|
+
paymentMethod?: string;
|
|
410
|
+
savePaymentMethod?: boolean;
|
|
377
411
|
}) => Promise<StripeCustomCheckoutResult>;
|
|
378
412
|
session: () => StripeCustomCheckoutSession;
|
|
379
413
|
on: (event: 'change', handler: StripeCustomCheckoutUpdateHandler) => void;
|
|
@@ -100,6 +100,32 @@ export type StripeCustomCheckoutLastPaymentError = {
|
|
|
100
100
|
message: string;
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
+
export type StripeCustomCheckoutRedirectBehavior = 'always' | 'if_required';
|
|
104
|
+
|
|
105
|
+
export type StripeCustomCheckoutSavedPaymentMethod = {
|
|
106
|
+
id: string;
|
|
107
|
+
type: 'card';
|
|
108
|
+
card: {
|
|
109
|
+
brand: string;
|
|
110
|
+
expMonth: number;
|
|
111
|
+
expYear: number;
|
|
112
|
+
last4: string;
|
|
113
|
+
};
|
|
114
|
+
billingDetails: {
|
|
115
|
+
email?: string | null;
|
|
116
|
+
name?: string | null;
|
|
117
|
+
phone?: string | null;
|
|
118
|
+
address?: {
|
|
119
|
+
line1?: string | null;
|
|
120
|
+
line2?: string | null;
|
|
121
|
+
city?: string | null;
|
|
122
|
+
postal_code?: string | null;
|
|
123
|
+
state?: string | null;
|
|
124
|
+
country?: string | null;
|
|
125
|
+
} | null;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
|
|
103
129
|
export type StripeCustomCheckoutTaxAmount = {
|
|
104
130
|
amount: number;
|
|
105
131
|
inclusive: boolean;
|
|
@@ -179,15 +205,19 @@ export type StripeCustomCheckoutTrial = {
|
|
|
179
205
|
/* Custom Checkout session */
|
|
180
206
|
export interface StripeCustomCheckoutSession {
|
|
181
207
|
billingAddress: StripeCustomCheckoutContact | null;
|
|
208
|
+
businessName: string | null;
|
|
182
209
|
canConfirm: boolean;
|
|
183
210
|
confirmationRequirements: StripeCustomCheckoutConfirmationRequirement[];
|
|
184
211
|
currency: string;
|
|
185
212
|
discountAmounts: Array<StripeCustomCheckoutDiscountAmount> | null;
|
|
186
213
|
email: string | null;
|
|
214
|
+
id: string;
|
|
187
215
|
lastPaymentError: StripeCustomCheckoutLastPaymentError | null;
|
|
188
216
|
lineItems: Array<StripeCustomCheckoutLineItem>;
|
|
217
|
+
livemode: boolean;
|
|
189
218
|
phoneNumber: string | null;
|
|
190
219
|
recurring: StripeCustomCheckoutRecurring | null;
|
|
220
|
+
savedPaymentMethods: Array<StripeCustomCheckoutSavedPaymentMethod> | null;
|
|
191
221
|
shipping: StripeCustomCheckoutShipping | null;
|
|
192
222
|
shippingAddress: StripeCustomCheckoutContact | null;
|
|
193
223
|
shippingOptions: Array<StripeCustomCheckoutShippingOption>;
|
|
@@ -374,6 +404,10 @@ export interface StripeCustomCheckout {
|
|
|
374
404
|
) => Promise<StripeCustomCheckoutResult>;
|
|
375
405
|
confirm: (args?: {
|
|
376
406
|
return_url?: string;
|
|
407
|
+
returnUrl?: string;
|
|
408
|
+
redirect?: StripeCustomCheckoutRedirectBehavior;
|
|
409
|
+
paymentMethod?: string;
|
|
410
|
+
savePaymentMethod?: boolean;
|
|
377
411
|
}) => Promise<StripeCustomCheckoutResult>;
|
|
378
412
|
session: () => StripeCustomCheckoutSession;
|
|
379
413
|
on: (event: 'change', handler: StripeCustomCheckoutUpdateHandler) => void;
|
|
@@ -270,6 +270,26 @@ export interface StripePaymentElementChangeEvent {
|
|
|
270
270
|
|
|
271
271
|
/**
|
|
272
272
|
* An object containing the currently selected PaymentMethod type (in snake_case, for example "afterpay_clearpay").
|
|
273
|
+
* If a payment method is selected, it will be included in the object.
|
|
273
274
|
*/
|
|
274
|
-
value: {
|
|
275
|
+
value: {
|
|
276
|
+
type: string;
|
|
277
|
+
payment_method?: {
|
|
278
|
+
id: string;
|
|
279
|
+
type: string;
|
|
280
|
+
billing_details: {
|
|
281
|
+
address: {
|
|
282
|
+
city: null | string;
|
|
283
|
+
country: null | string;
|
|
284
|
+
line1: null | string;
|
|
285
|
+
line2: null | string;
|
|
286
|
+
postal_code: null | string;
|
|
287
|
+
state: null | string;
|
|
288
|
+
};
|
|
289
|
+
name: null | string;
|
|
290
|
+
email: null | string;
|
|
291
|
+
phone: null | string;
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
};
|
|
275
295
|
}
|
|
@@ -270,6 +270,26 @@ export interface StripePaymentElementChangeEvent {
|
|
|
270
270
|
|
|
271
271
|
/**
|
|
272
272
|
* An object containing the currently selected PaymentMethod type (in snake_case, for example "afterpay_clearpay").
|
|
273
|
+
* If a payment method is selected, it will be included in the object.
|
|
273
274
|
*/
|
|
274
|
-
value: {
|
|
275
|
+
value: {
|
|
276
|
+
type: string;
|
|
277
|
+
payment_method?: {
|
|
278
|
+
id: string;
|
|
279
|
+
type: string;
|
|
280
|
+
billing_details: {
|
|
281
|
+
address: {
|
|
282
|
+
city: null | string;
|
|
283
|
+
country: null | string;
|
|
284
|
+
line1: null | string;
|
|
285
|
+
line2: null | string;
|
|
286
|
+
postal_code: null | string;
|
|
287
|
+
state: null | string;
|
|
288
|
+
};
|
|
289
|
+
name: null | string;
|
|
290
|
+
email: null | string;
|
|
291
|
+
phone: null | string;
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
};
|
|
275
295
|
}
|
|
@@ -661,6 +661,11 @@ interface BaseStripeElementsOptions {
|
|
|
661
661
|
* Supported for the `payment`, `shippingAddress`, and `linkAuthentication` Elements.
|
|
662
662
|
*/
|
|
663
663
|
customerOptions?: CustomerOptions;
|
|
664
|
+
|
|
665
|
+
/**
|
|
666
|
+
* Display saved PaymentMethods and Customer information.
|
|
667
|
+
*/
|
|
668
|
+
customerSessionClientSecret?: string;
|
|
664
669
|
}
|
|
665
670
|
|
|
666
671
|
export interface StripeElementsOptionsClientSecret
|
|
@@ -661,6 +661,11 @@ interface BaseStripeElementsOptions {
|
|
|
661
661
|
* Supported for the `payment`, `shippingAddress`, and `linkAuthentication` Elements.
|
|
662
662
|
*/
|
|
663
663
|
customerOptions?: CustomerOptions;
|
|
664
|
+
|
|
665
|
+
/**
|
|
666
|
+
* Display saved PaymentMethods and Customer information.
|
|
667
|
+
*/
|
|
668
|
+
customerSessionClientSecret?: string;
|
|
664
669
|
}
|
|
665
670
|
|
|
666
671
|
export interface StripeElementsOptionsClientSecret
|