@stripe/stripe-js 4.8.0 → 4.10.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/elements/payment.d.mts +0 -135
- package/dist/stripe-js/elements/payment.d.ts +0 -135
- package/dist/stripe-js/embedded-checkout.d.mts +0 -30
- package/dist/stripe-js/embedded-checkout.d.ts +0 -30
- 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
|
@@ -116,31 +116,6 @@ export type StripePaymentElement = StripeElementBase & {
|
|
|
116
116
|
handler?: (event: {elementType: 'payment'}) => any
|
|
117
117
|
): StripePaymentElement;
|
|
118
118
|
|
|
119
|
-
/**
|
|
120
|
-
* The change event is triggered when the `Element`'s value changes.
|
|
121
|
-
* Represents the details of a selected Card payment method.
|
|
122
|
-
*/
|
|
123
|
-
on(
|
|
124
|
-
eventType: 'carddetailschange',
|
|
125
|
-
handler: (event: StripePaymentElementCardDetailsChangeEvent) => any
|
|
126
|
-
): StripePaymentElement;
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Triggered when a Saved Payment Method is updated.
|
|
130
|
-
*/
|
|
131
|
-
on(
|
|
132
|
-
eventType: 'savedpaymentmethodupdate',
|
|
133
|
-
handler: (event: StripePaymentElementSavedPaymentMethodUpdateEvent) => any
|
|
134
|
-
): StripePaymentElement;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Triggered when a Saved Payment Method is removed.
|
|
138
|
-
*/
|
|
139
|
-
on(
|
|
140
|
-
eventType: 'savedpaymentmethodremove',
|
|
141
|
-
handler: (event: StripePaymentElementSavedPaymentMethodRemoveEvent) => any
|
|
142
|
-
): StripePaymentElement;
|
|
143
|
-
|
|
144
119
|
/**
|
|
145
120
|
* Updates the options the `PaymentElement` was initialized with.
|
|
146
121
|
* Updates are merged into the existing configuration.
|
|
@@ -183,7 +158,6 @@ export interface FieldsOption {
|
|
|
183
158
|
phone?: FieldOption;
|
|
184
159
|
address?:
|
|
185
160
|
| FieldOption
|
|
186
|
-
| 'if_required'
|
|
187
161
|
| {
|
|
188
162
|
country?: FieldOption;
|
|
189
163
|
postalCode?: FieldOption;
|
|
@@ -323,112 +297,3 @@ export interface StripePaymentElementChangeEvent {
|
|
|
323
297
|
};
|
|
324
298
|
};
|
|
325
299
|
}
|
|
326
|
-
|
|
327
|
-
type CardBrand =
|
|
328
|
-
| 'amex'
|
|
329
|
-
| 'diners'
|
|
330
|
-
| 'discover'
|
|
331
|
-
| 'eftpos_au'
|
|
332
|
-
| 'jcb'
|
|
333
|
-
| 'mastercard'
|
|
334
|
-
| 'unionpay'
|
|
335
|
-
| 'visa'
|
|
336
|
-
| 'unknown';
|
|
337
|
-
type CardFunding = 'credit' | 'debit' | 'prepaid' | 'unknown';
|
|
338
|
-
|
|
339
|
-
export interface StripePaymentElementCardDetailsChangeEvent {
|
|
340
|
-
/**
|
|
341
|
-
* The type of element that emitted this event.
|
|
342
|
-
*/
|
|
343
|
-
elementType: 'payment';
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* `true` when the card details are loading.
|
|
347
|
-
*/
|
|
348
|
-
loading: boolean;
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
* The card details for the selected payment method.
|
|
352
|
-
* Undefined while loading and for non card payment methods.
|
|
353
|
-
*/
|
|
354
|
-
details?: {
|
|
355
|
-
brands: CardBrand[] | null;
|
|
356
|
-
funding: CardFunding | null;
|
|
357
|
-
};
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
export interface StripePaymentElementSavedPaymentMethodUpdateEvent {
|
|
361
|
-
/**
|
|
362
|
-
* The type of element that emitted this event.
|
|
363
|
-
*/
|
|
364
|
-
elementType: 'payment';
|
|
365
|
-
|
|
366
|
-
/**
|
|
367
|
-
* `true` when the saved payment method is successfully updated.
|
|
368
|
-
*/
|
|
369
|
-
success: boolean;
|
|
370
|
-
|
|
371
|
-
/**
|
|
372
|
-
* Error message if the saved payment method update fails.
|
|
373
|
-
*/
|
|
374
|
-
error?: string;
|
|
375
|
-
|
|
376
|
-
/**
|
|
377
|
-
* The updated saved payment method.
|
|
378
|
-
*/
|
|
379
|
-
payment_method: {
|
|
380
|
-
id: string;
|
|
381
|
-
type: string;
|
|
382
|
-
billing_details: {
|
|
383
|
-
address: {
|
|
384
|
-
city: null | string;
|
|
385
|
-
country: null | string;
|
|
386
|
-
line1: null | string;
|
|
387
|
-
line2: null | string;
|
|
388
|
-
postal_code: null | string;
|
|
389
|
-
state: null | string;
|
|
390
|
-
};
|
|
391
|
-
name: null | string;
|
|
392
|
-
email: null | string;
|
|
393
|
-
phone: null | string;
|
|
394
|
-
};
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
export interface StripePaymentElementSavedPaymentMethodRemoveEvent {
|
|
399
|
-
/**
|
|
400
|
-
* The type of element that emitted this event.
|
|
401
|
-
*/
|
|
402
|
-
elementType: 'payment';
|
|
403
|
-
|
|
404
|
-
/**
|
|
405
|
-
* `true` when the saved payment method is successfully removed.
|
|
406
|
-
*/
|
|
407
|
-
success: boolean;
|
|
408
|
-
|
|
409
|
-
/**
|
|
410
|
-
* Error message if the saved payment method removal fails.
|
|
411
|
-
*/
|
|
412
|
-
error?: string;
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* The removed saved payment method.
|
|
416
|
-
*/
|
|
417
|
-
payment_method: {
|
|
418
|
-
id: string;
|
|
419
|
-
type: string;
|
|
420
|
-
billing_details: {
|
|
421
|
-
address: {
|
|
422
|
-
city: null | string;
|
|
423
|
-
country: null | string;
|
|
424
|
-
line1: null | string;
|
|
425
|
-
line2: null | string;
|
|
426
|
-
postal_code: null | string;
|
|
427
|
-
state: null | string;
|
|
428
|
-
};
|
|
429
|
-
name: null | string;
|
|
430
|
-
email: null | string;
|
|
431
|
-
phone: null | string;
|
|
432
|
-
};
|
|
433
|
-
};
|
|
434
|
-
}
|
|
@@ -116,31 +116,6 @@ export type StripePaymentElement = StripeElementBase & {
|
|
|
116
116
|
handler?: (event: {elementType: 'payment'}) => any
|
|
117
117
|
): StripePaymentElement;
|
|
118
118
|
|
|
119
|
-
/**
|
|
120
|
-
* The change event is triggered when the `Element`'s value changes.
|
|
121
|
-
* Represents the details of a selected Card payment method.
|
|
122
|
-
*/
|
|
123
|
-
on(
|
|
124
|
-
eventType: 'carddetailschange',
|
|
125
|
-
handler: (event: StripePaymentElementCardDetailsChangeEvent) => any
|
|
126
|
-
): StripePaymentElement;
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Triggered when a Saved Payment Method is updated.
|
|
130
|
-
*/
|
|
131
|
-
on(
|
|
132
|
-
eventType: 'savedpaymentmethodupdate',
|
|
133
|
-
handler: (event: StripePaymentElementSavedPaymentMethodUpdateEvent) => any
|
|
134
|
-
): StripePaymentElement;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Triggered when a Saved Payment Method is removed.
|
|
138
|
-
*/
|
|
139
|
-
on(
|
|
140
|
-
eventType: 'savedpaymentmethodremove',
|
|
141
|
-
handler: (event: StripePaymentElementSavedPaymentMethodRemoveEvent) => any
|
|
142
|
-
): StripePaymentElement;
|
|
143
|
-
|
|
144
119
|
/**
|
|
145
120
|
* Updates the options the `PaymentElement` was initialized with.
|
|
146
121
|
* Updates are merged into the existing configuration.
|
|
@@ -183,7 +158,6 @@ export interface FieldsOption {
|
|
|
183
158
|
phone?: FieldOption;
|
|
184
159
|
address?:
|
|
185
160
|
| FieldOption
|
|
186
|
-
| 'if_required'
|
|
187
161
|
| {
|
|
188
162
|
country?: FieldOption;
|
|
189
163
|
postalCode?: FieldOption;
|
|
@@ -323,112 +297,3 @@ export interface StripePaymentElementChangeEvent {
|
|
|
323
297
|
};
|
|
324
298
|
};
|
|
325
299
|
}
|
|
326
|
-
|
|
327
|
-
type CardBrand =
|
|
328
|
-
| 'amex'
|
|
329
|
-
| 'diners'
|
|
330
|
-
| 'discover'
|
|
331
|
-
| 'eftpos_au'
|
|
332
|
-
| 'jcb'
|
|
333
|
-
| 'mastercard'
|
|
334
|
-
| 'unionpay'
|
|
335
|
-
| 'visa'
|
|
336
|
-
| 'unknown';
|
|
337
|
-
type CardFunding = 'credit' | 'debit' | 'prepaid' | 'unknown';
|
|
338
|
-
|
|
339
|
-
export interface StripePaymentElementCardDetailsChangeEvent {
|
|
340
|
-
/**
|
|
341
|
-
* The type of element that emitted this event.
|
|
342
|
-
*/
|
|
343
|
-
elementType: 'payment';
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* `true` when the card details are loading.
|
|
347
|
-
*/
|
|
348
|
-
loading: boolean;
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
* The card details for the selected payment method.
|
|
352
|
-
* Undefined while loading and for non card payment methods.
|
|
353
|
-
*/
|
|
354
|
-
details?: {
|
|
355
|
-
brands: CardBrand[] | null;
|
|
356
|
-
funding: CardFunding | null;
|
|
357
|
-
};
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
export interface StripePaymentElementSavedPaymentMethodUpdateEvent {
|
|
361
|
-
/**
|
|
362
|
-
* The type of element that emitted this event.
|
|
363
|
-
*/
|
|
364
|
-
elementType: 'payment';
|
|
365
|
-
|
|
366
|
-
/**
|
|
367
|
-
* `true` when the saved payment method is successfully updated.
|
|
368
|
-
*/
|
|
369
|
-
success: boolean;
|
|
370
|
-
|
|
371
|
-
/**
|
|
372
|
-
* Error message if the saved payment method update fails.
|
|
373
|
-
*/
|
|
374
|
-
error?: string;
|
|
375
|
-
|
|
376
|
-
/**
|
|
377
|
-
* The updated saved payment method.
|
|
378
|
-
*/
|
|
379
|
-
payment_method: {
|
|
380
|
-
id: string;
|
|
381
|
-
type: string;
|
|
382
|
-
billing_details: {
|
|
383
|
-
address: {
|
|
384
|
-
city: null | string;
|
|
385
|
-
country: null | string;
|
|
386
|
-
line1: null | string;
|
|
387
|
-
line2: null | string;
|
|
388
|
-
postal_code: null | string;
|
|
389
|
-
state: null | string;
|
|
390
|
-
};
|
|
391
|
-
name: null | string;
|
|
392
|
-
email: null | string;
|
|
393
|
-
phone: null | string;
|
|
394
|
-
};
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
export interface StripePaymentElementSavedPaymentMethodRemoveEvent {
|
|
399
|
-
/**
|
|
400
|
-
* The type of element that emitted this event.
|
|
401
|
-
*/
|
|
402
|
-
elementType: 'payment';
|
|
403
|
-
|
|
404
|
-
/**
|
|
405
|
-
* `true` when the saved payment method is successfully removed.
|
|
406
|
-
*/
|
|
407
|
-
success: boolean;
|
|
408
|
-
|
|
409
|
-
/**
|
|
410
|
-
* Error message if the saved payment method removal fails.
|
|
411
|
-
*/
|
|
412
|
-
error?: string;
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* The removed saved payment method.
|
|
416
|
-
*/
|
|
417
|
-
payment_method: {
|
|
418
|
-
id: string;
|
|
419
|
-
type: string;
|
|
420
|
-
billing_details: {
|
|
421
|
-
address: {
|
|
422
|
-
city: null | string;
|
|
423
|
-
country: null | string;
|
|
424
|
-
line1: null | string;
|
|
425
|
-
line2: null | string;
|
|
426
|
-
postal_code: null | string;
|
|
427
|
-
state: null | string;
|
|
428
|
-
};
|
|
429
|
-
name: null | string;
|
|
430
|
-
email: null | string;
|
|
431
|
-
phone: null | string;
|
|
432
|
-
};
|
|
433
|
-
};
|
|
434
|
-
}
|
|
@@ -17,29 +17,6 @@ export type StripeEmbeddedCheckoutShippingDetailsChangeEvent = {
|
|
|
17
17
|
shippingDetails: StripeEmbeddedCheckoutShippingDetails;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
export type StripeEmbeddedCheckoutLineItem = {
|
|
21
|
-
id?: string;
|
|
22
|
-
quantity?: number;
|
|
23
|
-
price?: string;
|
|
24
|
-
display?: {
|
|
25
|
-
name?: string;
|
|
26
|
-
description?: string;
|
|
27
|
-
images?: string[];
|
|
28
|
-
};
|
|
29
|
-
pricingSpec?: {
|
|
30
|
-
unitAmount?: number;
|
|
31
|
-
unitAmountDecimal?: string;
|
|
32
|
-
currency?: string;
|
|
33
|
-
taxBehavior?: 'inclusive' | 'exclusive' | 'unspecified';
|
|
34
|
-
taxCode?: string;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export type StripeEmbeddedCheckoutLineItemsChangeEvent = {
|
|
39
|
-
checkoutSessionId: string;
|
|
40
|
-
lineItems: StripeEmbeddedCheckoutLineItem[];
|
|
41
|
-
};
|
|
42
|
-
|
|
43
20
|
export type ResultAction =
|
|
44
21
|
| {type: 'accept'}
|
|
45
22
|
| {type: 'reject'; errorMessage?: string};
|
|
@@ -68,13 +45,6 @@ export interface StripeEmbeddedCheckoutOptions {
|
|
|
68
45
|
onShippingDetailsChange?: (
|
|
69
46
|
event: StripeEmbeddedCheckoutShippingDetailsChangeEvent
|
|
70
47
|
) => Promise<ResultAction>;
|
|
71
|
-
/**
|
|
72
|
-
* onLineItemsChange is called when the customer adds, removes, or modifies a line item.
|
|
73
|
-
* The callback is required when [permissions.update.line_items](https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-permissions-update-line_items) is set to `server_only`.
|
|
74
|
-
*/
|
|
75
|
-
onLineItemsChange?: (
|
|
76
|
-
event: StripeEmbeddedCheckoutLineItemsChangeEvent
|
|
77
|
-
) => Promise<ResultAction>;
|
|
78
48
|
}
|
|
79
49
|
|
|
80
50
|
export interface StripeEmbeddedCheckout {
|
|
@@ -17,29 +17,6 @@ export type StripeEmbeddedCheckoutShippingDetailsChangeEvent = {
|
|
|
17
17
|
shippingDetails: StripeEmbeddedCheckoutShippingDetails;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
export type StripeEmbeddedCheckoutLineItem = {
|
|
21
|
-
id?: string;
|
|
22
|
-
quantity?: number;
|
|
23
|
-
price?: string;
|
|
24
|
-
display?: {
|
|
25
|
-
name?: string;
|
|
26
|
-
description?: string;
|
|
27
|
-
images?: string[];
|
|
28
|
-
};
|
|
29
|
-
pricingSpec?: {
|
|
30
|
-
unitAmount?: number;
|
|
31
|
-
unitAmountDecimal?: string;
|
|
32
|
-
currency?: string;
|
|
33
|
-
taxBehavior?: 'inclusive' | 'exclusive' | 'unspecified';
|
|
34
|
-
taxCode?: string;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export type StripeEmbeddedCheckoutLineItemsChangeEvent = {
|
|
39
|
-
checkoutSessionId: string;
|
|
40
|
-
lineItems: StripeEmbeddedCheckoutLineItem[];
|
|
41
|
-
};
|
|
42
|
-
|
|
43
20
|
export type ResultAction =
|
|
44
21
|
| {type: 'accept'}
|
|
45
22
|
| {type: 'reject'; errorMessage?: string};
|
|
@@ -68,13 +45,6 @@ export interface StripeEmbeddedCheckoutOptions {
|
|
|
68
45
|
onShippingDetailsChange?: (
|
|
69
46
|
event: StripeEmbeddedCheckoutShippingDetailsChangeEvent
|
|
70
47
|
) => Promise<ResultAction>;
|
|
71
|
-
/**
|
|
72
|
-
* onLineItemsChange is called when the customer adds, removes, or modifies a line item.
|
|
73
|
-
* The callback is required when [permissions.update.line_items](https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-permissions-update-line_items) is set to `server_only`.
|
|
74
|
-
*/
|
|
75
|
-
onLineItemsChange?: (
|
|
76
|
-
event: StripeEmbeddedCheckoutLineItemsChangeEvent
|
|
77
|
-
) => Promise<ResultAction>;
|
|
78
48
|
}
|
|
79
49
|
|
|
80
50
|
export interface StripeEmbeddedCheckout {
|