@stripe/stripe-js 1.47.0 → 1.48.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 CHANGED
@@ -54,7 +54,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
54
54
 
55
55
  stripe._registerWrapper({
56
56
  name: 'stripe-js',
57
- version: "1.47.0",
57
+ version: "1.48.0",
58
58
  startTime: startTime
59
59
  });
60
60
  };
package/dist/pure.js CHANGED
@@ -58,7 +58,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
58
58
 
59
59
  stripe._registerWrapper({
60
60
  name: 'stripe-js',
61
- version: "1.47.0",
61
+ version: "1.48.0",
62
62
  startTime: startTime
63
63
  });
64
64
  };
@@ -38,7 +38,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
38
38
 
39
39
  stripe._registerWrapper({
40
40
  name: 'stripe-js',
41
- version: "1.47.0",
41
+ version: "1.48.0",
42
42
  startTime: startTime
43
43
  });
44
44
  };
package/dist/stripe.js CHANGED
@@ -42,7 +42,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
42
42
 
43
43
  stripe._registerWrapper({
44
44
  name: 'stripe-js',
45
- version: "1.47.0",
45
+ version: "1.48.0",
46
46
  startTime: startTime
47
47
  });
48
48
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-js",
3
- "version": "1.47.0",
3
+ "version": "1.48.0",
4
4
  "description": "Stripe.js loading utility",
5
5
  "main": "dist/stripe.js",
6
6
  "module": "dist/stripe.esm.js",
@@ -1,184 +1,203 @@
1
1
  import {StripeElementBase} from './base';
2
2
  import {StripeError} from '../stripe';
3
3
 
4
- export type StripePayButtonElement = StripeElementBase & {
4
+ export type StripeExpressCheckoutElement = StripeElementBase & {
5
5
  /**
6
6
  * Triggered when the element is fully rendered and can accept `element.focus` calls.
7
7
  */
8
8
  on(
9
9
  eventType: 'ready',
10
- handler: (event: StripePayButtonElementReadyEvent) => any
11
- ): StripePayButtonElement;
10
+ handler: (event: StripeExpressCheckoutElementReadyEvent) => any
11
+ ): StripeExpressCheckoutElement;
12
12
  once(
13
13
  eventType: 'ready',
14
- handler: (event: StripePayButtonElementReadyEvent) => any
15
- ): StripePayButtonElement;
14
+ handler: (event: StripeExpressCheckoutElementReadyEvent) => any
15
+ ): StripeExpressCheckoutElement;
16
16
  off(
17
17
  eventType: 'ready',
18
- handler?: (event: StripePayButtonElementReadyEvent) => any
19
- ): StripePayButtonElement;
18
+ handler?: (event: StripeExpressCheckoutElementReadyEvent) => any
19
+ ): StripeExpressCheckoutElement;
20
20
 
21
21
  /**
22
22
  * Triggered when a button on the element is clicked.
23
23
  */
24
24
  on(
25
25
  eventType: 'click',
26
- handler: (event: StripePayButtonElementClickEvent) => any
27
- ): StripePayButtonElement;
26
+ handler: (event: StripeExpressCheckoutElementClickEvent) => any
27
+ ): StripeExpressCheckoutElement;
28
28
  once(
29
29
  eventType: 'click',
30
- handler: (event: StripePayButtonElementClickEvent) => any
31
- ): StripePayButtonElement;
30
+ handler: (event: StripeExpressCheckoutElementClickEvent) => any
31
+ ): StripeExpressCheckoutElement;
32
32
  off(
33
33
  eventType: 'click',
34
- handler?: (event: StripePayButtonElementClickEvent) => any
35
- ): StripePayButtonElement;
34
+ handler?: (event: StripeExpressCheckoutElementClickEvent) => any
35
+ ): StripeExpressCheckoutElement;
36
36
 
37
37
  /**
38
38
  * Triggered when the element gains focus.
39
39
  */
40
40
  on(
41
41
  eventType: 'focus',
42
- handler: (event: {elementType: 'payButton'}) => any
43
- ): StripePayButtonElement;
42
+ handler: (event: {elementType: 'expressCheckout'}) => any
43
+ ): StripeExpressCheckoutElement;
44
44
  once(
45
45
  eventType: 'focus',
46
- handler: (event: {elementType: 'payButton'}) => any
47
- ): StripePayButtonElement;
46
+ handler: (event: {elementType: 'expressCheckout'}) => any
47
+ ): StripeExpressCheckoutElement;
48
48
  off(
49
49
  eventType: 'focus',
50
- handler?: (event: {elementType: 'payButton'}) => any
51
- ): StripePayButtonElement;
50
+ handler?: (event: {elementType: 'expressCheckout'}) => any
51
+ ): StripeExpressCheckoutElement;
52
52
 
53
53
  /**
54
54
  * Triggered when the element loses focus.
55
55
  */
56
56
  on(
57
57
  eventType: 'blur',
58
- handler: (event: {elementType: 'payButton'}) => any
59
- ): StripePayButtonElement;
58
+ handler: (event: {elementType: 'expressCheckout'}) => any
59
+ ): StripeExpressCheckoutElement;
60
60
  once(
61
61
  eventType: 'blur',
62
- handler: (event: {elementType: 'payButton'}) => any
63
- ): StripePayButtonElement;
62
+ handler: (event: {elementType: 'expressCheckout'}) => any
63
+ ): StripeExpressCheckoutElement;
64
64
  off(
65
65
  eventType: 'blur',
66
- handler?: (event: {elementType: 'payButton'}) => any
67
- ): StripePayButtonElement;
66
+ handler?: (event: {elementType: 'expressCheckout'}) => any
67
+ ): StripeExpressCheckoutElement;
68
68
 
69
69
  /**
70
70
  * Triggered when the escape key is pressed within the element.
71
71
  */
72
72
  on(
73
73
  eventType: 'escape',
74
- handler: (event: {elementType: 'payButton'}) => any
75
- ): StripePayButtonElement;
74
+ handler: (event: {elementType: 'expressCheckout'}) => any
75
+ ): StripeExpressCheckoutElement;
76
76
  once(
77
77
  eventType: 'escape',
78
- handler: (event: {elementType: 'payButton'}) => any
79
- ): StripePayButtonElement;
78
+ handler: (event: {elementType: 'expressCheckout'}) => any
79
+ ): StripeExpressCheckoutElement;
80
80
  off(
81
81
  eventType: 'escape',
82
- handler?: (event: {elementType: 'payButton'}) => any
83
- ): StripePayButtonElement;
82
+ handler?: (event: {elementType: 'expressCheckout'}) => any
83
+ ): StripeExpressCheckoutElement;
84
84
 
85
85
  /**
86
86
  * Triggered when the element fails to load.
87
87
  */
88
88
  on(
89
89
  eventType: 'loaderror',
90
- handler: (event: {elementType: 'payButton'; error: StripeError}) => any
91
- ): StripePayButtonElement;
90
+ handler: (event: {
91
+ elementType: 'expressCheckout';
92
+ error: StripeError;
93
+ }) => any
94
+ ): StripeExpressCheckoutElement;
92
95
  once(
93
96
  eventType: 'loaderror',
94
- handler: (event: {elementType: 'payButton'; error: StripeError}) => any
95
- ): StripePayButtonElement;
97
+ handler: (event: {
98
+ elementType: 'expressCheckout';
99
+ error: StripeError;
100
+ }) => any
101
+ ): StripeExpressCheckoutElement;
96
102
  off(
97
103
  eventType: 'loaderror',
98
- handler?: (event: {elementType: 'payButton'; error: StripeError}) => any
99
- ): StripePayButtonElement;
104
+ handler?: (event: {
105
+ elementType: 'expressCheckout';
106
+ error: StripeError;
107
+ }) => any
108
+ ): StripeExpressCheckoutElement;
100
109
 
101
110
  /**
102
111
  * Triggered when a buyer authorizes a payment within a supported payment method.
103
112
  */
104
113
  on(
105
114
  eventType: 'confirm',
106
- handler: (event: StripePayButtonElementConfirmEvent) => any
107
- ): StripePayButtonElement;
115
+ handler: (event: StripeExpressCheckoutElementConfirmEvent) => any
116
+ ): StripeExpressCheckoutElement;
108
117
  once(
109
118
  eventType: 'confirm',
110
- handler: (event: StripePayButtonElementConfirmEvent) => any
111
- ): StripePayButtonElement;
119
+ handler: (event: StripeExpressCheckoutElementConfirmEvent) => any
120
+ ): StripeExpressCheckoutElement;
112
121
  off(
113
122
  eventType: 'confirm',
114
- handler?: (event: StripePayButtonElementConfirmEvent) => any
115
- ): StripePayButtonElement;
123
+ handler?: (event: StripeExpressCheckoutElementConfirmEvent) => any
124
+ ): StripeExpressCheckoutElement;
116
125
 
117
126
  /**
118
127
  * Triggered when a payment interface is dismissed (e.g., a buyer closes the payment interface)
119
128
  */
120
129
  on(
121
130
  eventType: 'cancel',
122
- handler: (event: {elementType: 'payButton'}) => any
123
- ): StripePayButtonElement;
131
+ handler: (event: {elementType: 'expressCheckout'}) => any
132
+ ): StripeExpressCheckoutElement;
124
133
  once(
125
134
  eventType: 'cancel',
126
- handler: (event: {elementType: 'payButton'}) => any
127
- ): StripePayButtonElement;
135
+ handler: (event: {elementType: 'expressCheckout'}) => any
136
+ ): StripeExpressCheckoutElement;
128
137
  off(
129
138
  eventType: 'cancel',
130
- handler?: (event: {elementType: 'payButton'}) => any
131
- ): StripePayButtonElement;
139
+ handler?: (event: {elementType: 'expressCheckout'}) => any
140
+ ): StripeExpressCheckoutElement;
132
141
 
133
142
  /**
134
143
  * Triggered when a buyer selects a different shipping address.
135
144
  */
136
145
  on(
137
146
  eventType: 'shippingaddresschange',
138
- handler: (event: StripePayButtonElementShippingAddressChangeEvent) => any
139
- ): StripePayButtonElement;
147
+ handler: (
148
+ event: StripeExpressCheckoutElementShippingAddressChangeEvent
149
+ ) => any
150
+ ): StripeExpressCheckoutElement;
140
151
  once(
141
152
  eventType: 'shippingaddresschange',
142
- handler: (event: StripePayButtonElementShippingAddressChangeEvent) => any
143
- ): StripePayButtonElement;
153
+ handler: (
154
+ event: StripeExpressCheckoutElementShippingAddressChangeEvent
155
+ ) => any
156
+ ): StripeExpressCheckoutElement;
144
157
  off(
145
158
  eventType: 'shippingaddresschange',
146
- handler?: (event: StripePayButtonElementShippingAddressChangeEvent) => any
147
- ): StripePayButtonElement;
159
+ handler?: (
160
+ event: StripeExpressCheckoutElementShippingAddressChangeEvent
161
+ ) => any
162
+ ): StripeExpressCheckoutElement;
148
163
 
149
164
  /**
150
165
  * Triggered when a buyer selects a different shipping rate.
151
166
  */
152
167
  on(
153
168
  eventType: 'shippingratechange',
154
- handler: (event: StripePayButtonElementShippingRateChangeEvent) => any
155
- ): StripePayButtonElement;
169
+ handler: (event: StripeExpressCheckoutElementShippingRateChangeEvent) => any
170
+ ): StripeExpressCheckoutElement;
156
171
  once(
157
172
  eventType: 'shippingratechange',
158
- handler: (event: StripePayButtonElementShippingRateChangeEvent) => any
159
- ): StripePayButtonElement;
173
+ handler: (event: StripeExpressCheckoutElementShippingRateChangeEvent) => any
174
+ ): StripeExpressCheckoutElement;
160
175
  off(
161
176
  eventType: 'shippingratechange',
162
- handler?: (event: StripePayButtonElementShippingRateChangeEvent) => any
163
- ): StripePayButtonElement;
177
+ handler?: (
178
+ event: StripeExpressCheckoutElementShippingRateChangeEvent
179
+ ) => any
180
+ ): StripeExpressCheckoutElement;
164
181
 
165
182
  /**
166
- * Updates the options the `PayButtonElement` was initialized with.
183
+ * Updates the options the `ExpressCheckoutElement` was initialized with.
167
184
  * Updates are merged into the existing configuration.
168
185
  */
169
- update(options: StripePayButtonElementUpdateOptions): StripePayButtonElement;
186
+ update(
187
+ options: StripeExpressCheckoutElementUpdateOptions
188
+ ): StripeExpressCheckoutElement;
170
189
  };
171
190
 
172
- export type PaymentMethodType = 'google_pay' | 'apple_pay';
191
+ export type PaymentMethodType = 'google_pay' | 'apple_pay' | 'link';
173
192
 
174
- export type PayButtonPartialAddress = {
193
+ export type ExpressCheckoutPartialAddress = {
175
194
  city: string;
176
195
  state: string;
177
196
  postal_code: string;
178
197
  country: string;
179
198
  };
180
199
 
181
- export type PayButtonAddress = PayButtonPartialAddress & {
200
+ export type ExpressCheckoutAddress = ExpressCheckoutPartialAddress & {
182
201
  line1: string;
183
202
  line2: string | null;
184
203
  };
@@ -187,12 +206,12 @@ export type BillingDetails = {
187
206
  name: string;
188
207
  email?: string;
189
208
  phone?: string;
190
- address: PayButtonAddress;
209
+ address: ExpressCheckoutAddress;
191
210
  };
192
211
 
193
212
  export type ShippingAddress = {
194
213
  name: string;
195
- address: PayButtonAddress;
214
+ address: ExpressCheckoutAddress;
196
215
  };
197
216
 
198
217
  export type LineItem = {
@@ -226,11 +245,11 @@ export type LayoutOption =
226
245
  visibleButtonCount?: number;
227
246
  };
228
247
 
229
- export type PayButtonWalletOption = 'always' | 'auto' | 'never';
248
+ export type ExpressCheckoutWalletOption = 'always' | 'auto' | 'never';
230
249
 
231
- export type PayButtonWalletsOption = {
232
- applePay?: PayButtonWalletOption;
233
- googlePay?: PayButtonWalletOption;
250
+ export type ExpressCheckoutWalletsOption = {
251
+ applePay?: ExpressCheckoutWalletOption;
252
+ googlePay?: ExpressCheckoutWalletOption;
234
253
  };
235
254
 
236
255
  export type ApplePayButtonTheme = 'black' | 'white' | 'white-outline';
@@ -273,7 +292,7 @@ export type ButtonTypeOption = {
273
292
  googlePay?: GooglePayButtonType;
274
293
  };
275
294
 
276
- export interface StripePayButtonElementOptions {
295
+ export interface StripeExpressCheckoutElementOptions {
277
296
  /**
278
297
  * Manually sets the height of the buttons shown.
279
298
  */
@@ -295,21 +314,21 @@ export interface StripePayButtonElementOptions {
295
314
  layout?: LayoutOption;
296
315
 
297
316
  /**
298
- * Override the order in which payment methods are displayed in the Pay Button Element.
299
- * By default, the Pay Button Element will use a dynamic ordering that optimizes payment method display for each user.
317
+ * Override the order in which payment methods are displayed in the Express Checkout Element.
318
+ * By default, the Express Checkout Element will use a dynamic ordering that optimizes payment method display for each user.
300
319
  */
301
320
  paymentMethodOrder?: string[];
302
321
 
303
322
  /**
304
- * Control wallets display in the Pay Button Element.
323
+ * Control wallets display in the Express Checkout Element.
305
324
  */
306
- wallets?: PayButtonWalletsOption;
325
+ wallets?: ExpressCheckoutWalletsOption;
307
326
  }
308
327
 
309
328
  /*
310
329
  * Updatable options for an `Elements` instance
311
330
  */
312
- export interface StripePayButtonElementUpdateOptions {
331
+ export interface StripeExpressCheckoutElementUpdateOptions {
313
332
  /**
314
333
  * Manually sets the height of the buttons shown.
315
334
  */
@@ -322,7 +341,7 @@ export interface StripePayButtonElementUpdateOptions {
322
341
 
323
342
  /**
324
343
  * Override the order in which payment methods are displayed in the Pay Button Element.
325
- * By default, the Pay Button Element will use a dynamic ordering that optimizes payment method display for each user.
344
+ * By default, the Express Checkout Element will use a dynamic ordering that optimizes payment method display for each user.
326
345
  */
327
346
  paymentMethodOrder?: string[];
328
347
  }
@@ -332,11 +351,11 @@ export type AvailablePaymentMethods = {
332
351
  googlePay: boolean;
333
352
  };
334
353
 
335
- export interface StripePayButtonElementReadyEvent {
354
+ export interface StripeExpressCheckoutElementReadyEvent {
336
355
  /**
337
356
  * The type of element that emitted this event.
338
357
  */
339
- elementType: 'payButton';
358
+ elementType: 'expressCheckout';
340
359
 
341
360
  /**
342
361
  * The list of payment methods that could possibly show in the element, or undefined if no payment methods can show.
@@ -395,11 +414,11 @@ export type ClickResolveDetails = {
395
414
  applePay?: ApplePayOption;
396
415
  };
397
416
 
398
- export interface StripePayButtonElementClickEvent {
417
+ export interface StripeExpressCheckoutElementClickEvent {
399
418
  /**
400
419
  * The type of element that emitted this event.
401
420
  */
402
- elementType: 'payButton';
421
+ elementType: 'expressCheckout';
403
422
 
404
423
  /**
405
424
  * The payment method associated with the button that was clicked.
@@ -413,7 +432,7 @@ export interface StripePayButtonElementClickEvent {
413
432
  resolve: (resolveDetails?: ClickResolveDetails) => void;
414
433
  }
415
434
 
416
- export interface StripePayButtonElementConfirmEvent {
435
+ export interface StripeExpressCheckoutElementConfirmEvent {
417
436
  /**
418
437
  * Callback when a payment is unsuccessful. Optionally, specifying a reason will show a more detailed error in the payment interface.
419
438
  */
@@ -435,14 +454,14 @@ export type ChangeResolveDetails = {
435
454
  shippingRates?: Array<ShippingRate>;
436
455
  };
437
456
 
438
- export interface StripePayButtonElementShippingAddressChangeEvent {
457
+ export interface StripeExpressCheckoutElementShippingAddressChangeEvent {
439
458
  name: string;
440
- address: PayButtonPartialAddress;
459
+ address: ExpressCheckoutPartialAddress;
441
460
  resolve: (resolveDetails?: ChangeResolveDetails) => void;
442
461
  reject: () => void;
443
462
  }
444
463
 
445
- export interface StripePayButtonElementShippingRateChangeEvent {
464
+ export interface StripeExpressCheckoutElementShippingRateChangeEvent {
446
465
  shippingRate: ShippingRate;
447
466
  resolve: (resolveDetails?: ChangeResolveDetails) => void;
448
467
  reject: () => void;
@@ -10,12 +10,12 @@ export * from './card-number';
10
10
  export * from './card';
11
11
  export * from './cart';
12
12
  export * from './eps-bank';
13
+ export * from './express-checkout';
13
14
  export * from './fpx-bank';
14
15
  export * from './iban';
15
16
  export * from './ideal-bank';
16
17
  export * from './link-authentication';
17
18
  export * from './p24-bank';
18
- export * from './pay-button';
19
19
  export * from './payment-request-button';
20
20
  export * from './payment';
21
21
  export * from './shipping-address';
@@ -47,8 +47,8 @@ import {
47
47
  StripeIssuingCardPinDisplayElementOptions,
48
48
  StripeIssuingCardCopyButtonElement,
49
49
  StripeIssuingCardCopyButtonElementOptions,
50
- StripePayButtonElement,
51
- StripePayButtonElementOptions,
50
+ StripeExpressCheckoutElement,
51
+ StripeExpressCheckoutElementOptions,
52
52
  } from './elements';
53
53
 
54
54
  export interface StripeElements {
@@ -367,19 +367,19 @@ export interface StripeElements {
367
367
  ): StripeLinkAuthenticationElement | null;
368
368
 
369
369
  /////////////////////////////
370
- /// payButton
370
+ /// expressCheckout
371
371
  /////////////////////////////
372
372
 
373
373
  /**
374
374
  * Requires beta access:
375
375
  * Contact [Stripe support](https://support.stripe.com/) for more information.
376
376
  *
377
- * Creates a `PayButtonElement`.
377
+ * Creates a `ExpressCheckoutElement`.
378
378
  */
379
379
  create(
380
- elementType: 'payButton',
381
- options?: StripePayButtonElementOptions
382
- ): StripePayButtonElement;
380
+ elementType: 'expressCheckout',
381
+ options?: StripeExpressCheckoutElementOptions
382
+ ): StripeExpressCheckoutElement;
383
383
 
384
384
  /**
385
385
  * Requires beta access:
@@ -387,7 +387,9 @@ export interface StripeElements {
387
387
  *
388
388
  * Looks up a previously created `Element` by its type.
389
389
  */
390
- getElement(elementType: 'payButton'): StripePayButtonElement | null;
390
+ getElement(
391
+ elementType: 'expressCheckout'
392
+ ): StripeExpressCheckoutElement | null;
391
393
 
392
394
  /////////////////////////////
393
395
  /// payment
@@ -520,11 +522,11 @@ export type StripeElementType =
520
522
  | 'cardCvc'
521
523
  | 'cart'
522
524
  | 'epsBank'
525
+ | 'expressCheckout'
523
526
  | 'fpxBank'
524
527
  | 'iban'
525
528
  | 'idealBank'
526
529
  | 'p24Bank'
527
- | 'payButton'
528
530
  | 'payment'
529
531
  | 'paymentMethodMessaging'
530
532
  | 'paymentRequestButton'
@@ -551,7 +553,7 @@ export type StripeElement =
551
553
  | StripeIbanElement
552
554
  | StripeIdealBankElement
553
555
  | StripeP24BankElement
554
- | StripePayButtonElement
556
+ | StripeExpressCheckoutElement
555
557
  | StripePaymentElement
556
558
  | StripePaymentMethodMessagingElement
557
559
  | StripePaymentRequestButtonElement