@stripe/stripe-js 1.39.0 → 1.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.
- package/dist/pure.esm.js +1 -1
- package/dist/pure.js +1 -1
- package/dist/stripe.esm.js +1 -1
- package/dist/stripe.js +1 -1
- package/package.json +1 -1
- package/types/stripe-js/elements/address.d.ts +2 -3
- package/types/stripe-js/elements/cart.d.ts +157 -0
- package/types/stripe-js/elements/index.d.ts +1 -0
- package/types/stripe-js/elements/link-authentication.d.ts +2 -3
- package/types/stripe-js/elements/shipping-address.d.ts +2 -3
- package/types/stripe-js/elements-group.d.ts +31 -1
package/dist/pure.esm.js
CHANGED
package/dist/pure.js
CHANGED
package/dist/stripe.esm.js
CHANGED
package/dist/stripe.js
CHANGED
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {StripeElementBase
|
|
1
|
+
import {StripeElementBase} from './base';
|
|
2
2
|
import {StripeError} from '../stripe';
|
|
3
3
|
|
|
4
4
|
export type StripeAddressElement = StripeElementBase & {
|
|
@@ -208,8 +208,7 @@ export interface StripeAddressElementOptions {
|
|
|
208
208
|
};
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
export interface StripeAddressElementChangeEvent
|
|
212
|
-
extends StripeElementChangeEvent {
|
|
211
|
+
export interface StripeAddressElementChangeEvent {
|
|
213
212
|
/**
|
|
214
213
|
* The type of element that emitted this event.
|
|
215
214
|
*/
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import {StripeElementBase} from './base';
|
|
2
|
+
import {StripeError} from '../stripe';
|
|
3
|
+
|
|
4
|
+
export type StripeCartElement = StripeElementBase & {
|
|
5
|
+
/**
|
|
6
|
+
* The change event is triggered when the `Element`'s value changes.
|
|
7
|
+
*/
|
|
8
|
+
on(
|
|
9
|
+
eventType: 'change',
|
|
10
|
+
handler: (event: StripeCartElementPayloadEvent) => any
|
|
11
|
+
): StripeCartElement;
|
|
12
|
+
once(
|
|
13
|
+
eventType: 'change',
|
|
14
|
+
handler: (event: StripeCartElementPayloadEvent) => any
|
|
15
|
+
): StripeCartElement;
|
|
16
|
+
off(
|
|
17
|
+
eventType: 'change',
|
|
18
|
+
handler?: (event: StripeCartElementPayloadEvent) => any
|
|
19
|
+
): StripeCartElement;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Triggered when the element is fully rendered and can accept `element.focus` calls.
|
|
23
|
+
*/
|
|
24
|
+
on(
|
|
25
|
+
eventType: 'ready',
|
|
26
|
+
handler: (event: StripeCartElementPayloadEvent) => any
|
|
27
|
+
): StripeCartElement;
|
|
28
|
+
once(
|
|
29
|
+
eventType: 'ready',
|
|
30
|
+
handler: (event: StripeCartElementPayloadEvent) => any
|
|
31
|
+
): StripeCartElement;
|
|
32
|
+
off(
|
|
33
|
+
eventType: 'ready',
|
|
34
|
+
handler?: (event: StripeCartElementPayloadEvent) => any
|
|
35
|
+
): StripeCartElement;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Triggered when the element fails to load.
|
|
39
|
+
*/
|
|
40
|
+
on(
|
|
41
|
+
eventType: 'loaderror',
|
|
42
|
+
handler: (event: {elementType: 'cart'; error: StripeError}) => any
|
|
43
|
+
): StripeCartElement;
|
|
44
|
+
once(
|
|
45
|
+
eventType: 'loaderror',
|
|
46
|
+
handler: (event: {elementType: 'cart'; error: StripeError}) => any
|
|
47
|
+
): StripeCartElement;
|
|
48
|
+
off(
|
|
49
|
+
eventType: 'loaderror',
|
|
50
|
+
handler?: (event: {elementType: 'cart'; error: StripeError}) => any
|
|
51
|
+
): StripeCartElement;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Triggered when the 'checkout' button in the element is clicked
|
|
55
|
+
*/
|
|
56
|
+
on(
|
|
57
|
+
eventType: 'checkout',
|
|
58
|
+
handler: (event: StripeCartElementPayloadEvent) => any
|
|
59
|
+
): StripeCartElement;
|
|
60
|
+
once(
|
|
61
|
+
eventType: 'checkout',
|
|
62
|
+
handler: (event: StripeCartElementPayloadEvent) => any
|
|
63
|
+
): StripeCartElement;
|
|
64
|
+
off(
|
|
65
|
+
eventType: 'checkout',
|
|
66
|
+
handler?: (event: StripeCartElementPayloadEvent) => any
|
|
67
|
+
): StripeCartElement;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Triggered when a line item in the element is clicked
|
|
71
|
+
*/
|
|
72
|
+
on(
|
|
73
|
+
eventType: 'lineitemclick',
|
|
74
|
+
handler: (event: StripeCartElementLineItemClickEvent) => any
|
|
75
|
+
): StripeCartElement;
|
|
76
|
+
once(
|
|
77
|
+
eventType: 'lineitemclick',
|
|
78
|
+
handler: (event: StripeCartElementLineItemClickEvent) => any
|
|
79
|
+
): StripeCartElement;
|
|
80
|
+
off(
|
|
81
|
+
eventType: 'lineitemclick',
|
|
82
|
+
handler?: (event: StripeCartElementLineItemClickEvent) => any
|
|
83
|
+
): StripeCartElement;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Updates the options the `CartElement` was initialized with.
|
|
87
|
+
* Updates are merged into the existing configuration.
|
|
88
|
+
*/
|
|
89
|
+
update(options: Partial<StripeCartElementOptions>): StripeCartElement;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export type CartDescriptor = 'cart' | 'bag' | 'basket';
|
|
93
|
+
|
|
94
|
+
export type CartShowOnAdd = 'never' | 'auto';
|
|
95
|
+
|
|
96
|
+
export interface StripeCartElementOptions {
|
|
97
|
+
/**
|
|
98
|
+
* Identifies the CartSession the Element will display and modify.
|
|
99
|
+
*/
|
|
100
|
+
clientSecret: string;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Override the verbiage used within the Element to refer to itself.
|
|
104
|
+
* By default the Cart Element will use the term 'cart'.
|
|
105
|
+
*/
|
|
106
|
+
descriptor?: CartDescriptor | null;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Override the text used in the title of the Element.
|
|
110
|
+
* By default the Cart Element will use the title 'Your [descriptor]'.
|
|
111
|
+
*/
|
|
112
|
+
header?: {
|
|
113
|
+
text?: string;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Control whether the Element automatically appears when items are added to the cart.
|
|
118
|
+
* By default, the Cart Element will use 'auto'.
|
|
119
|
+
*/
|
|
120
|
+
showOnAdd?: CartShowOnAdd | null;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface StripeCartElementPayloadEvent {
|
|
124
|
+
/**
|
|
125
|
+
* The type of element that emitted this event.
|
|
126
|
+
*/
|
|
127
|
+
elementType: 'cart';
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* The ID of the CartSession associated with the Element.
|
|
131
|
+
*/
|
|
132
|
+
id: string;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* The number of line items currently in the cart.
|
|
136
|
+
*/
|
|
137
|
+
lineItems: {
|
|
138
|
+
count: number;
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export interface StripeCartElementLineItemClickEvent {
|
|
143
|
+
/**
|
|
144
|
+
* The type of element that emitted this event.
|
|
145
|
+
*/
|
|
146
|
+
elementType: 'cart';
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The ID of the CartSession associated with the Element.
|
|
150
|
+
*/
|
|
151
|
+
preventDefault: () => void;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* The type of element that emitted this event.
|
|
155
|
+
*/
|
|
156
|
+
url: string;
|
|
157
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {StripeElementBase
|
|
1
|
+
import {StripeElementBase} from './base';
|
|
2
2
|
import {StripeError} from '../stripe';
|
|
3
3
|
|
|
4
4
|
export type StripeLinkAuthenticationElement = StripeElementBase & {
|
|
@@ -133,8 +133,7 @@ export interface StripeLinkAuthenticationElementOptions {
|
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
export interface StripeLinkAuthenticationElementChangeEvent
|
|
137
|
-
extends StripeElementChangeEvent {
|
|
136
|
+
export interface StripeLinkAuthenticationElementChangeEvent {
|
|
138
137
|
/**
|
|
139
138
|
* The type of element that emitted this event.
|
|
140
139
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {StripeElementBase
|
|
1
|
+
import {StripeElementBase} from './base';
|
|
2
2
|
import {StripeError} from '../stripe';
|
|
3
3
|
|
|
4
4
|
export type StripeShippingAddressElement = StripeElementBase & {
|
|
@@ -176,8 +176,7 @@ export interface StripeShippingAddressElementOptions {
|
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
export interface StripeShippingAddressElementChangeEvent
|
|
180
|
-
extends StripeElementChangeEvent {
|
|
179
|
+
export interface StripeShippingAddressElementChangeEvent {
|
|
181
180
|
/**
|
|
182
181
|
* The type of element that emitted this event.
|
|
183
182
|
*/
|
|
@@ -27,6 +27,8 @@ import {
|
|
|
27
27
|
StripeCardNumberElementOptions,
|
|
28
28
|
StripeCardElement,
|
|
29
29
|
StripeCardElementOptions,
|
|
30
|
+
StripeCartElement,
|
|
31
|
+
StripeCartElementOptions,
|
|
30
32
|
StripeAuBankAccountElement,
|
|
31
33
|
StripeAfterpayClearpayMessageElementOptions,
|
|
32
34
|
StripeAffirmMessageElement,
|
|
@@ -229,6 +231,29 @@ export interface StripeElements {
|
|
|
229
231
|
*/
|
|
230
232
|
getElement(elementType: 'cardCvc'): StripeCardCvcElement | null;
|
|
231
233
|
|
|
234
|
+
/////////////////////////////
|
|
235
|
+
/// cart
|
|
236
|
+
/////////////////////////////
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Requires beta access:
|
|
240
|
+
* Contact [Stripe support](https://support.stripe.com/) for more information.
|
|
241
|
+
*
|
|
242
|
+
* Creates a `CartElement`.
|
|
243
|
+
*/
|
|
244
|
+
create(
|
|
245
|
+
elementType: 'cart',
|
|
246
|
+
options: StripeCartElementOptions
|
|
247
|
+
): StripeCartElement;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Requires beta access:
|
|
251
|
+
* Contact [Stripe support](https://support.stripe.com/) for more information.
|
|
252
|
+
*
|
|
253
|
+
* Looks up a previously created `Element` by its type.
|
|
254
|
+
*/
|
|
255
|
+
getElement(elementType: 'cart'): StripeCartElement | null;
|
|
256
|
+
|
|
232
257
|
/////////////////////////////
|
|
233
258
|
/// fpxBank
|
|
234
259
|
/////////////////////////////
|
|
@@ -474,6 +499,7 @@ export type StripeElementType =
|
|
|
474
499
|
| 'cardNumber'
|
|
475
500
|
| 'cardExpiry'
|
|
476
501
|
| 'cardCvc'
|
|
502
|
+
| 'cart'
|
|
477
503
|
| 'epsBank'
|
|
478
504
|
| 'fpxBank'
|
|
479
505
|
| 'iban'
|
|
@@ -491,6 +517,7 @@ export type StripeElementType =
|
|
|
491
517
|
| 'issuingCardCopyButton';
|
|
492
518
|
|
|
493
519
|
export type StripeElement =
|
|
520
|
+
| StripeAddressElement
|
|
494
521
|
| StripeAffirmMessageElement
|
|
495
522
|
| StripeAfterpayClearpayMessageElement
|
|
496
523
|
| StripeAuBankAccountElement
|
|
@@ -498,6 +525,7 @@ export type StripeElement =
|
|
|
498
525
|
| StripeCardNumberElement
|
|
499
526
|
| StripeCardExpiryElement
|
|
500
527
|
| StripeCardCvcElement
|
|
528
|
+
| StripeCartElement
|
|
501
529
|
| StripeEpsBankElement
|
|
502
530
|
| StripeFpxBankElement
|
|
503
531
|
| StripeIbanElement
|
|
@@ -510,7 +538,9 @@ export type StripeElement =
|
|
|
510
538
|
| StripeIssuingCardCvcDisplayElement
|
|
511
539
|
| StripeIssuingCardExpiryDisplayElement
|
|
512
540
|
| StripeIssuingCardPinDisplayElement
|
|
513
|
-
| StripeIssuingCardCopyButtonElement
|
|
541
|
+
| StripeIssuingCardCopyButtonElement
|
|
542
|
+
| StripeLinkAuthenticationElement
|
|
543
|
+
| StripeShippingAddressElement;
|
|
514
544
|
|
|
515
545
|
export type StripeElementLocale =
|
|
516
546
|
| 'auto'
|