@stripe/stripe-js 7.4.0 → 7.6.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 CHANGED
@@ -55,7 +55,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
55
55
 
56
56
  stripe._registerWrapper({
57
57
  name: 'stripe-js',
58
- version: "7.4.0",
58
+ version: "7.6.0",
59
59
  startTime: startTime
60
60
  });
61
61
  };
@@ -151,7 +151,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
151
151
  var expectedVersion = RELEASE_TRAIN;
152
152
 
153
153
  if (isTestKey && version !== expectedVersion) {
154
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.4.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
154
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.6.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
155
155
  }
156
156
 
157
157
  var stripe = maybeStripe.apply(undefined, args);
package/dist/index.mjs CHANGED
@@ -51,7 +51,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
51
51
 
52
52
  stripe._registerWrapper({
53
53
  name: 'stripe-js',
54
- version: "7.4.0",
54
+ version: "7.6.0",
55
55
  startTime: startTime
56
56
  });
57
57
  };
@@ -147,7 +147,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
147
147
  var expectedVersion = RELEASE_TRAIN;
148
148
 
149
149
  if (isTestKey && version !== expectedVersion) {
150
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.4.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
150
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.6.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
151
151
  }
152
152
 
153
153
  var stripe = maybeStripe.apply(undefined, args);
package/dist/pure.js CHANGED
@@ -71,7 +71,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
71
71
 
72
72
  stripe._registerWrapper({
73
73
  name: 'stripe-js',
74
- version: "7.4.0",
74
+ version: "7.6.0",
75
75
  startTime: startTime
76
76
  });
77
77
  };
@@ -167,7 +167,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
167
167
  var expectedVersion = RELEASE_TRAIN;
168
168
 
169
169
  if (isTestKey && version !== expectedVersion) {
170
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.4.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
170
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.6.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
171
171
  }
172
172
 
173
173
  var stripe = maybeStripe.apply(undefined, args);
package/dist/pure.mjs CHANGED
@@ -67,7 +67,7 @@ var registerWrapper = function registerWrapper(stripe, startTime) {
67
67
 
68
68
  stripe._registerWrapper({
69
69
  name: 'stripe-js',
70
- version: "7.4.0",
70
+ version: "7.6.0",
71
71
  startTime: startTime
72
72
  });
73
73
  };
@@ -163,7 +163,7 @@ var initStripe = function initStripe(maybeStripe, args, startTime) {
163
163
  var expectedVersion = RELEASE_TRAIN;
164
164
 
165
165
  if (isTestKey && version !== expectedVersion) {
166
- console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.4.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
166
+ console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.6.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
167
167
  }
168
168
 
169
169
  var stripe = maybeStripe.apply(undefined, args);
@@ -15,6 +15,8 @@ import {
15
15
  StripeExpressCheckoutElementConfirmEvent,
16
16
  StripeExpressCheckoutElementOptions,
17
17
  StripeExpressCheckoutElementReadyEvent,
18
+ StripeTaxIdElement,
19
+ StripeTaxIdElementOptions,
18
20
  } from './elements';
19
21
 
20
22
  /**
@@ -470,6 +472,22 @@ export type StripeCheckoutExpressCheckoutElement = StripeElementBase & {
470
472
  handler?: (event: StripeExpressCheckoutElementConfirmEvent) => any
471
473
  ): StripeCheckoutExpressCheckoutElement;
472
474
 
475
+ /**
476
+ * Triggered when a payment interface is dismissed (e.g., a buyer closes the payment interface)
477
+ */
478
+ on(
479
+ eventType: 'cancel',
480
+ handler: (event: {elementType: 'expressCheckout'}) => any
481
+ ): StripeCheckoutExpressCheckoutElement;
482
+ once(
483
+ eventType: 'cancel',
484
+ handler: (event: {elementType: 'expressCheckout'}) => any
485
+ ): StripeCheckoutExpressCheckoutElement;
486
+ off(
487
+ eventType: 'cancel',
488
+ handler?: (event: {elementType: 'expressCheckout'}) => any
489
+ ): StripeCheckoutExpressCheckoutElement;
490
+
473
491
  /**
474
492
  * Updates the options the `ExpressCheckoutElement` was initialized with.
475
493
  * Updates are merged into the existing configuration.
@@ -588,6 +606,8 @@ export interface StripeCheckout {
588
606
  getExpressCheckoutElement(): StripeCheckoutExpressCheckoutElement | null;
589
607
  /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
590
608
  getCurrencySelectorElement(): StripeCurrencySelectorElement | null;
609
+ /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
610
+ getTaxIdElement(): StripeTaxIdElement | null;
591
611
  createPaymentElement(
592
612
  options?: StripeCheckoutPaymentElementOptions
593
613
  ): StripePaymentElement;
@@ -602,4 +622,6 @@ export interface StripeCheckout {
602
622
  ): StripeCheckoutExpressCheckoutElement;
603
623
  /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
604
624
  createCurrencySelectorElement(): StripeCurrencySelectorElement;
625
+ /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
626
+ createTaxIdElement(options?: StripeTaxIdElementOptions): StripeTaxIdElement;
605
627
  }
@@ -15,6 +15,8 @@ import {
15
15
  StripeExpressCheckoutElementConfirmEvent,
16
16
  StripeExpressCheckoutElementOptions,
17
17
  StripeExpressCheckoutElementReadyEvent,
18
+ StripeTaxIdElement,
19
+ StripeTaxIdElementOptions,
18
20
  } from './elements';
19
21
 
20
22
  /**
@@ -470,6 +472,22 @@ export type StripeCheckoutExpressCheckoutElement = StripeElementBase & {
470
472
  handler?: (event: StripeExpressCheckoutElementConfirmEvent) => any
471
473
  ): StripeCheckoutExpressCheckoutElement;
472
474
 
475
+ /**
476
+ * Triggered when a payment interface is dismissed (e.g., a buyer closes the payment interface)
477
+ */
478
+ on(
479
+ eventType: 'cancel',
480
+ handler: (event: {elementType: 'expressCheckout'}) => any
481
+ ): StripeCheckoutExpressCheckoutElement;
482
+ once(
483
+ eventType: 'cancel',
484
+ handler: (event: {elementType: 'expressCheckout'}) => any
485
+ ): StripeCheckoutExpressCheckoutElement;
486
+ off(
487
+ eventType: 'cancel',
488
+ handler?: (event: {elementType: 'expressCheckout'}) => any
489
+ ): StripeCheckoutExpressCheckoutElement;
490
+
473
491
  /**
474
492
  * Updates the options the `ExpressCheckoutElement` was initialized with.
475
493
  * Updates are merged into the existing configuration.
@@ -588,6 +606,8 @@ export interface StripeCheckout {
588
606
  getExpressCheckoutElement(): StripeCheckoutExpressCheckoutElement | null;
589
607
  /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
590
608
  getCurrencySelectorElement(): StripeCurrencySelectorElement | null;
609
+ /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
610
+ getTaxIdElement(): StripeTaxIdElement | null;
591
611
  createPaymentElement(
592
612
  options?: StripeCheckoutPaymentElementOptions
593
613
  ): StripePaymentElement;
@@ -602,4 +622,6 @@ export interface StripeCheckout {
602
622
  ): StripeCheckoutExpressCheckoutElement;
603
623
  /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
604
624
  createCurrencySelectorElement(): StripeCurrencySelectorElement;
625
+ /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
626
+ createTaxIdElement(options?: StripeTaxIdElementOptions): StripeTaxIdElement;
605
627
  }
@@ -20,3 +20,4 @@ export * from './payment-request-button';
20
20
  export * from './payment';
21
21
  export * from './shipping-address';
22
22
  export * from './issuing';
23
+ export * from './tax-id';
@@ -20,3 +20,4 @@ export * from './payment-request-button';
20
20
  export * from './payment';
21
21
  export * from './shipping-address';
22
22
  export * from './issuing';
23
+ export * from './tax-id';
@@ -306,6 +306,12 @@ export interface StripePaymentElementChangeEvent {
306
306
  */
307
307
  value: {
308
308
  type: string;
309
+ billingDetails?: {
310
+ address: {
311
+ country?: null | string;
312
+ postalCode?: null | string;
313
+ };
314
+ };
309
315
  payment_method?: {
310
316
  id: string;
311
317
  type: string;
@@ -306,6 +306,12 @@ export interface StripePaymentElementChangeEvent {
306
306
  */
307
307
  value: {
308
308
  type: string;
309
+ billingDetails?: {
310
+ address: {
311
+ country?: null | string;
312
+ postalCode?: null | string;
313
+ };
314
+ };
309
315
  payment_method?: {
310
316
  id: string;
311
317
  type: string;
@@ -0,0 +1,379 @@
1
+ import {StripeElementBase} from './base';
2
+ import {StripeError} from '../stripe';
3
+
4
+ export type StripeTaxIdElement = StripeElementBase & {
5
+ /**
6
+ * The change event is triggered when the `Element`'s value changes.
7
+ */
8
+ on(
9
+ eventType: 'change',
10
+ handler: (event: StripeTaxIdElementChangeEvent) => any
11
+ ): StripeTaxIdElement;
12
+ once(
13
+ eventType: 'change',
14
+ handler: (event: StripeTaxIdElementChangeEvent) => any
15
+ ): StripeTaxIdElement;
16
+ off(
17
+ eventType: 'change',
18
+ handler?: (event: StripeTaxIdElementChangeEvent) => any
19
+ ): StripeTaxIdElement;
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: {elementType: 'taxId'}) => any
27
+ ): StripeTaxIdElement;
28
+ once(
29
+ eventType: 'ready',
30
+ handler: (event: {elementType: 'taxId'}) => any
31
+ ): StripeTaxIdElement;
32
+ off(
33
+ eventType: 'ready',
34
+ handler?: (event: {elementType: 'taxId'}) => any
35
+ ): StripeTaxIdElement;
36
+
37
+ /**
38
+ * Triggered when the element gains focus.
39
+ */
40
+ on(
41
+ eventType: 'focus',
42
+ handler: (event: {elementType: 'taxId'}) => any
43
+ ): StripeTaxIdElement;
44
+ once(
45
+ eventType: 'focus',
46
+ handler: (event: {elementType: 'taxId'}) => any
47
+ ): StripeTaxIdElement;
48
+ off(
49
+ eventType: 'focus',
50
+ handler?: (event: {elementType: 'taxId'}) => any
51
+ ): StripeTaxIdElement;
52
+
53
+ /**
54
+ * Triggered when the element loses focus.
55
+ */
56
+ on(
57
+ eventType: 'blur',
58
+ handler: (event: {elementType: 'taxId'}) => any
59
+ ): StripeTaxIdElement;
60
+ once(
61
+ eventType: 'blur',
62
+ handler: (event: {elementType: 'taxId'}) => any
63
+ ): StripeTaxIdElement;
64
+ off(
65
+ eventType: 'blur',
66
+ handler?: (event: {elementType: 'taxId'}) => any
67
+ ): StripeTaxIdElement;
68
+
69
+ /**
70
+ * Triggered when the escape key is pressed within the element.
71
+ */
72
+ on(
73
+ eventType: 'escape',
74
+ handler: (event: {elementType: 'taxId'}) => any
75
+ ): StripeTaxIdElement;
76
+ once(
77
+ eventType: 'escape',
78
+ handler: (event: {elementType: 'taxId'}) => any
79
+ ): StripeTaxIdElement;
80
+ off(
81
+ eventType: 'escape',
82
+ handler?: (event: {elementType: 'taxId'}) => any
83
+ ): StripeTaxIdElement;
84
+
85
+ /**
86
+ * Triggered when the element fails to load.
87
+ */
88
+ on(
89
+ eventType: 'loaderror',
90
+ handler: (event: {elementType: 'taxId'; error: StripeError}) => any
91
+ ): StripeTaxIdElement;
92
+ once(
93
+ eventType: 'loaderror',
94
+ handler: (event: {elementType: 'taxId'; error: StripeError}) => any
95
+ ): StripeTaxIdElement;
96
+ off(
97
+ eventType: 'loaderror',
98
+ handler?: (event: {elementType: 'taxId'; error: StripeError}) => any
99
+ ): StripeTaxIdElement;
100
+
101
+ /**
102
+ * Triggered when the loader UI is mounted to the DOM and ready to be displayed.
103
+ */
104
+ on(
105
+ eventType: 'loaderstart',
106
+ handler: (event: {elementType: 'taxId'}) => any
107
+ ): StripeTaxIdElement;
108
+ once(
109
+ eventType: 'loaderstart',
110
+ handler: (event: {elementType: 'taxId'}) => any
111
+ ): StripeTaxIdElement;
112
+ off(
113
+ eventType: 'loaderstart',
114
+ handler?: (event: {elementType: 'taxId'}) => any
115
+ ): StripeTaxIdElement;
116
+
117
+ /**
118
+ * Updates the options the `TaxIdElement` was initialized with.
119
+ * Updates are merged into the existing configuration.
120
+ */
121
+ update(options: Partial<StripeTaxIdElementOptions>): StripeTaxIdElement;
122
+
123
+ /**
124
+ * Validates and retrieves form values from the `AddressElement`.
125
+ */
126
+ getValue(): Promise<StripeTaxIdElementChangeEvent>;
127
+ };
128
+
129
+ export type TaxIdType =
130
+ | 'al_tin'
131
+ | 'am_tin'
132
+ | 'ao_tin'
133
+ | 'at_vat'
134
+ | 'ba_tin'
135
+ | 'bb_tin'
136
+ | 'be_vat'
137
+ | 'bg_vat'
138
+ | 'bs_tin'
139
+ | 'cd_nif'
140
+ | 'cl_tin'
141
+ | 'tr_tin'
142
+ | 'cy_vat'
143
+ | 'cz_vat'
144
+ | 'de_vat'
145
+ | 'dk_vat'
146
+ | 'ee_vat'
147
+ | 'es_vat'
148
+ | 'fi_vat'
149
+ | 'fr_vat'
150
+ | 'gn_nif'
151
+ | 'gr_vat'
152
+ | 'hr_vat'
153
+ | 'th_vat'
154
+ | 'ie_vat'
155
+ | 'it_vat'
156
+ | 'kh_tin'
157
+ | 'lt_vat'
158
+ | 'lu_vat'
159
+ | 'lv_vat'
160
+ | 'me_pib'
161
+ | 'mk_vat'
162
+ | 'mr_nif'
163
+ | 'mt_vat'
164
+ | 'nl_vat'
165
+ | 'np_pan'
166
+ | 'pe_ruc'
167
+ | 'pl_vat'
168
+ | 'pt_vat'
169
+ | 'ro_vat'
170
+ | 'se_vat'
171
+ | 'sa_vat'
172
+ | 'si_vat'
173
+ | 'sk_vat'
174
+ | 'sn_ninea'
175
+ | 'sr_fin'
176
+ | 'tj_tin'
177
+ | 'ug_tin'
178
+ | 'uy_ruc'
179
+ | 'xi_vat'
180
+ | 'zm_tin'
181
+ | 'zw_tin'
182
+ | 'gb_vat'
183
+ | 'nz_gst'
184
+ | 'au_abn'
185
+ | 'no_vat'
186
+ | 'ch_vat'
187
+ | 'mx_rfc'
188
+ | 'hu_vat'
189
+ | 'ca_bn'
190
+ | 'ca_qst'
191
+ | 'ca_gst_hst'
192
+ | 'ca_pst_bc'
193
+ | 'ca_pst_mb'
194
+ | 'ca_pst_sk'
195
+ | 'sg_gst'
196
+ | 'za_vat'
197
+ | 'ru_inn'
198
+ | 'ru_kpp'
199
+ | 'ae_trn'
200
+ | 'is_vat'
201
+ | 'in_gst'
202
+ | 'kr_brn'
203
+ | 'es_cif'
204
+ | 'bh_vat'
205
+ | 'kz_bin'
206
+ | 'ng_tin'
207
+ | 'om_vat'
208
+ | 'ge_vat'
209
+ | 'ke_pin'
210
+ | 'eg_tin'
211
+ | 'tw_vat'
212
+ | 'ua_vat'
213
+ | 'ec_ruc'
214
+ | 'cr_tin'
215
+ | 'tz_vat'
216
+ | 'rs_pib'
217
+ | 'uz_vat'
218
+ | 'uz_tin'
219
+ | 'md_vat'
220
+ | 'ma_vat'
221
+ | 'by_tin'
222
+ | 'li_vat'
223
+ | 'aw_tin'
224
+ | 'az_tin'
225
+ | 'bd_bin'
226
+ | 'bj_ifu'
227
+ | 'et_tin'
228
+ | 'kg_tin'
229
+ | 'la_tin'
230
+ | 'cm_niu'
231
+ | 'cv_nif'
232
+ | 'bf_ifu'
233
+ | 'ph_tin';
234
+
235
+ export type ExternalTaxIdType =
236
+ | 'eu_vat'
237
+ | 'al_tin'
238
+ | 'am_tin'
239
+ | 'ao_tin'
240
+ | 'ba_tin'
241
+ | 'bb_tin'
242
+ | 'bs_tin'
243
+ | 'cd_nif'
244
+ | 'cl_tin'
245
+ | 'tr_tin'
246
+ | 'th_vat'
247
+ | 'gn_nif'
248
+ | 'kh_tin'
249
+ | 'me_pib'
250
+ | 'mk_vat'
251
+ | 'mr_nif'
252
+ | 'np_pan'
253
+ | 'pe_ruc'
254
+ | 'sa_vat'
255
+ | 'sn_ninea'
256
+ | 'sr_fin'
257
+ | 'tj_tin'
258
+ | 'ug_tin'
259
+ | 'uy_ruc'
260
+ | 'zm_tin'
261
+ | 'zw_tin'
262
+ | 'gb_vat'
263
+ | 'nz_gst'
264
+ | 'au_abn'
265
+ | 'no_vat'
266
+ | 'ch_vat'
267
+ | 'mx_rfc'
268
+ | 'ca_bn'
269
+ | 'ca_qst'
270
+ | 'ca_gst_hst'
271
+ | 'ca_pst_bc'
272
+ | 'ca_pst_mb'
273
+ | 'ca_pst_sk'
274
+ | 'sg_gst'
275
+ | 'za_vat'
276
+ | 'ru_inn'
277
+ | 'ru_kpp'
278
+ | 'ae_trn'
279
+ | 'is_vat'
280
+ | 'in_gst'
281
+ | 'kr_brn'
282
+ | 'es_cif'
283
+ | 'bh_vat'
284
+ | 'kz_bin'
285
+ | 'ng_tin'
286
+ | 'om_vat'
287
+ | 'ge_vat'
288
+ | 'ke_pin'
289
+ | 'eg_tin'
290
+ | 'tw_vat'
291
+ | 'ua_vat'
292
+ | 'ec_ruc'
293
+ | 'cr_tin'
294
+ | 'tz_vat'
295
+ | 'rs_pib'
296
+ | 'uz_vat'
297
+ | 'uz_tin'
298
+ | 'md_vat'
299
+ | 'ma_vat'
300
+ | 'by_tin'
301
+ | 'li_vat'
302
+ | 'aw_tin'
303
+ | 'az_tin'
304
+ | 'bd_bin'
305
+ | 'bj_ifu'
306
+ | 'et_tin'
307
+ | 'kg_tin'
308
+ | 'la_tin'
309
+ | 'cm_niu'
310
+ | 'cv_nif'
311
+ | 'bf_ifu'
312
+ | 'ph_tin';
313
+
314
+ export interface StripeTaxIdElementOptions {
315
+ /**
316
+ * Control visibility of the TaxIdElement.
317
+ */
318
+ visibility?: 'always' | 'never' | 'auto';
319
+
320
+ /**
321
+ * Control which fields to display in the TaxIdElement.
322
+ */
323
+ fields?: {
324
+ businessName?: 'always' | 'never' | 'auto';
325
+ };
326
+
327
+ /**
328
+ * Specify validation rules for the given fields.
329
+ */
330
+ validation?: {
331
+ businessName?: {
332
+ required?: 'always' | 'never' | 'auto';
333
+ };
334
+ taxId?: {
335
+ required?: 'always' | 'never' | 'auto';
336
+ };
337
+ };
338
+
339
+ /**
340
+ * Default value for TaxIdElement fields
341
+ */
342
+ defaultValues?: {
343
+ businessName?: string;
344
+ taxIdType?: TaxIdType;
345
+ taxId?: string;
346
+ };
347
+ }
348
+
349
+ export interface StripeTaxIdElementChangeEvent {
350
+ /**
351
+ * The type of element that emitted this event.
352
+ */
353
+ elementType: 'taxId';
354
+
355
+ /**
356
+ * Whether or not the TaxIdElement is currently empty.
357
+ */
358
+ empty: boolean;
359
+
360
+ /**
361
+ * Whether or not the TaxIdElement is complete.
362
+ */
363
+ complete: boolean;
364
+
365
+ /**
366
+ * Whether or not the TaxIdElement is visible.
367
+ */
368
+ visible: boolean;
369
+
370
+ /**
371
+ * An object containing the current tax id information.
372
+ */
373
+ value: {
374
+ businessName: string;
375
+ taxId: string;
376
+ taxIdType: TaxIdType;
377
+ externalTaxIdType: ExternalTaxIdType;
378
+ };
379
+ }
@@ -0,0 +1,379 @@
1
+ import {StripeElementBase} from './base';
2
+ import {StripeError} from '../stripe';
3
+
4
+ export type StripeTaxIdElement = StripeElementBase & {
5
+ /**
6
+ * The change event is triggered when the `Element`'s value changes.
7
+ */
8
+ on(
9
+ eventType: 'change',
10
+ handler: (event: StripeTaxIdElementChangeEvent) => any
11
+ ): StripeTaxIdElement;
12
+ once(
13
+ eventType: 'change',
14
+ handler: (event: StripeTaxIdElementChangeEvent) => any
15
+ ): StripeTaxIdElement;
16
+ off(
17
+ eventType: 'change',
18
+ handler?: (event: StripeTaxIdElementChangeEvent) => any
19
+ ): StripeTaxIdElement;
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: {elementType: 'taxId'}) => any
27
+ ): StripeTaxIdElement;
28
+ once(
29
+ eventType: 'ready',
30
+ handler: (event: {elementType: 'taxId'}) => any
31
+ ): StripeTaxIdElement;
32
+ off(
33
+ eventType: 'ready',
34
+ handler?: (event: {elementType: 'taxId'}) => any
35
+ ): StripeTaxIdElement;
36
+
37
+ /**
38
+ * Triggered when the element gains focus.
39
+ */
40
+ on(
41
+ eventType: 'focus',
42
+ handler: (event: {elementType: 'taxId'}) => any
43
+ ): StripeTaxIdElement;
44
+ once(
45
+ eventType: 'focus',
46
+ handler: (event: {elementType: 'taxId'}) => any
47
+ ): StripeTaxIdElement;
48
+ off(
49
+ eventType: 'focus',
50
+ handler?: (event: {elementType: 'taxId'}) => any
51
+ ): StripeTaxIdElement;
52
+
53
+ /**
54
+ * Triggered when the element loses focus.
55
+ */
56
+ on(
57
+ eventType: 'blur',
58
+ handler: (event: {elementType: 'taxId'}) => any
59
+ ): StripeTaxIdElement;
60
+ once(
61
+ eventType: 'blur',
62
+ handler: (event: {elementType: 'taxId'}) => any
63
+ ): StripeTaxIdElement;
64
+ off(
65
+ eventType: 'blur',
66
+ handler?: (event: {elementType: 'taxId'}) => any
67
+ ): StripeTaxIdElement;
68
+
69
+ /**
70
+ * Triggered when the escape key is pressed within the element.
71
+ */
72
+ on(
73
+ eventType: 'escape',
74
+ handler: (event: {elementType: 'taxId'}) => any
75
+ ): StripeTaxIdElement;
76
+ once(
77
+ eventType: 'escape',
78
+ handler: (event: {elementType: 'taxId'}) => any
79
+ ): StripeTaxIdElement;
80
+ off(
81
+ eventType: 'escape',
82
+ handler?: (event: {elementType: 'taxId'}) => any
83
+ ): StripeTaxIdElement;
84
+
85
+ /**
86
+ * Triggered when the element fails to load.
87
+ */
88
+ on(
89
+ eventType: 'loaderror',
90
+ handler: (event: {elementType: 'taxId'; error: StripeError}) => any
91
+ ): StripeTaxIdElement;
92
+ once(
93
+ eventType: 'loaderror',
94
+ handler: (event: {elementType: 'taxId'; error: StripeError}) => any
95
+ ): StripeTaxIdElement;
96
+ off(
97
+ eventType: 'loaderror',
98
+ handler?: (event: {elementType: 'taxId'; error: StripeError}) => any
99
+ ): StripeTaxIdElement;
100
+
101
+ /**
102
+ * Triggered when the loader UI is mounted to the DOM and ready to be displayed.
103
+ */
104
+ on(
105
+ eventType: 'loaderstart',
106
+ handler: (event: {elementType: 'taxId'}) => any
107
+ ): StripeTaxIdElement;
108
+ once(
109
+ eventType: 'loaderstart',
110
+ handler: (event: {elementType: 'taxId'}) => any
111
+ ): StripeTaxIdElement;
112
+ off(
113
+ eventType: 'loaderstart',
114
+ handler?: (event: {elementType: 'taxId'}) => any
115
+ ): StripeTaxIdElement;
116
+
117
+ /**
118
+ * Updates the options the `TaxIdElement` was initialized with.
119
+ * Updates are merged into the existing configuration.
120
+ */
121
+ update(options: Partial<StripeTaxIdElementOptions>): StripeTaxIdElement;
122
+
123
+ /**
124
+ * Validates and retrieves form values from the `AddressElement`.
125
+ */
126
+ getValue(): Promise<StripeTaxIdElementChangeEvent>;
127
+ };
128
+
129
+ export type TaxIdType =
130
+ | 'al_tin'
131
+ | 'am_tin'
132
+ | 'ao_tin'
133
+ | 'at_vat'
134
+ | 'ba_tin'
135
+ | 'bb_tin'
136
+ | 'be_vat'
137
+ | 'bg_vat'
138
+ | 'bs_tin'
139
+ | 'cd_nif'
140
+ | 'cl_tin'
141
+ | 'tr_tin'
142
+ | 'cy_vat'
143
+ | 'cz_vat'
144
+ | 'de_vat'
145
+ | 'dk_vat'
146
+ | 'ee_vat'
147
+ | 'es_vat'
148
+ | 'fi_vat'
149
+ | 'fr_vat'
150
+ | 'gn_nif'
151
+ | 'gr_vat'
152
+ | 'hr_vat'
153
+ | 'th_vat'
154
+ | 'ie_vat'
155
+ | 'it_vat'
156
+ | 'kh_tin'
157
+ | 'lt_vat'
158
+ | 'lu_vat'
159
+ | 'lv_vat'
160
+ | 'me_pib'
161
+ | 'mk_vat'
162
+ | 'mr_nif'
163
+ | 'mt_vat'
164
+ | 'nl_vat'
165
+ | 'np_pan'
166
+ | 'pe_ruc'
167
+ | 'pl_vat'
168
+ | 'pt_vat'
169
+ | 'ro_vat'
170
+ | 'se_vat'
171
+ | 'sa_vat'
172
+ | 'si_vat'
173
+ | 'sk_vat'
174
+ | 'sn_ninea'
175
+ | 'sr_fin'
176
+ | 'tj_tin'
177
+ | 'ug_tin'
178
+ | 'uy_ruc'
179
+ | 'xi_vat'
180
+ | 'zm_tin'
181
+ | 'zw_tin'
182
+ | 'gb_vat'
183
+ | 'nz_gst'
184
+ | 'au_abn'
185
+ | 'no_vat'
186
+ | 'ch_vat'
187
+ | 'mx_rfc'
188
+ | 'hu_vat'
189
+ | 'ca_bn'
190
+ | 'ca_qst'
191
+ | 'ca_gst_hst'
192
+ | 'ca_pst_bc'
193
+ | 'ca_pst_mb'
194
+ | 'ca_pst_sk'
195
+ | 'sg_gst'
196
+ | 'za_vat'
197
+ | 'ru_inn'
198
+ | 'ru_kpp'
199
+ | 'ae_trn'
200
+ | 'is_vat'
201
+ | 'in_gst'
202
+ | 'kr_brn'
203
+ | 'es_cif'
204
+ | 'bh_vat'
205
+ | 'kz_bin'
206
+ | 'ng_tin'
207
+ | 'om_vat'
208
+ | 'ge_vat'
209
+ | 'ke_pin'
210
+ | 'eg_tin'
211
+ | 'tw_vat'
212
+ | 'ua_vat'
213
+ | 'ec_ruc'
214
+ | 'cr_tin'
215
+ | 'tz_vat'
216
+ | 'rs_pib'
217
+ | 'uz_vat'
218
+ | 'uz_tin'
219
+ | 'md_vat'
220
+ | 'ma_vat'
221
+ | 'by_tin'
222
+ | 'li_vat'
223
+ | 'aw_tin'
224
+ | 'az_tin'
225
+ | 'bd_bin'
226
+ | 'bj_ifu'
227
+ | 'et_tin'
228
+ | 'kg_tin'
229
+ | 'la_tin'
230
+ | 'cm_niu'
231
+ | 'cv_nif'
232
+ | 'bf_ifu'
233
+ | 'ph_tin';
234
+
235
+ export type ExternalTaxIdType =
236
+ | 'eu_vat'
237
+ | 'al_tin'
238
+ | 'am_tin'
239
+ | 'ao_tin'
240
+ | 'ba_tin'
241
+ | 'bb_tin'
242
+ | 'bs_tin'
243
+ | 'cd_nif'
244
+ | 'cl_tin'
245
+ | 'tr_tin'
246
+ | 'th_vat'
247
+ | 'gn_nif'
248
+ | 'kh_tin'
249
+ | 'me_pib'
250
+ | 'mk_vat'
251
+ | 'mr_nif'
252
+ | 'np_pan'
253
+ | 'pe_ruc'
254
+ | 'sa_vat'
255
+ | 'sn_ninea'
256
+ | 'sr_fin'
257
+ | 'tj_tin'
258
+ | 'ug_tin'
259
+ | 'uy_ruc'
260
+ | 'zm_tin'
261
+ | 'zw_tin'
262
+ | 'gb_vat'
263
+ | 'nz_gst'
264
+ | 'au_abn'
265
+ | 'no_vat'
266
+ | 'ch_vat'
267
+ | 'mx_rfc'
268
+ | 'ca_bn'
269
+ | 'ca_qst'
270
+ | 'ca_gst_hst'
271
+ | 'ca_pst_bc'
272
+ | 'ca_pst_mb'
273
+ | 'ca_pst_sk'
274
+ | 'sg_gst'
275
+ | 'za_vat'
276
+ | 'ru_inn'
277
+ | 'ru_kpp'
278
+ | 'ae_trn'
279
+ | 'is_vat'
280
+ | 'in_gst'
281
+ | 'kr_brn'
282
+ | 'es_cif'
283
+ | 'bh_vat'
284
+ | 'kz_bin'
285
+ | 'ng_tin'
286
+ | 'om_vat'
287
+ | 'ge_vat'
288
+ | 'ke_pin'
289
+ | 'eg_tin'
290
+ | 'tw_vat'
291
+ | 'ua_vat'
292
+ | 'ec_ruc'
293
+ | 'cr_tin'
294
+ | 'tz_vat'
295
+ | 'rs_pib'
296
+ | 'uz_vat'
297
+ | 'uz_tin'
298
+ | 'md_vat'
299
+ | 'ma_vat'
300
+ | 'by_tin'
301
+ | 'li_vat'
302
+ | 'aw_tin'
303
+ | 'az_tin'
304
+ | 'bd_bin'
305
+ | 'bj_ifu'
306
+ | 'et_tin'
307
+ | 'kg_tin'
308
+ | 'la_tin'
309
+ | 'cm_niu'
310
+ | 'cv_nif'
311
+ | 'bf_ifu'
312
+ | 'ph_tin';
313
+
314
+ export interface StripeTaxIdElementOptions {
315
+ /**
316
+ * Control visibility of the TaxIdElement.
317
+ */
318
+ visibility?: 'always' | 'never' | 'auto';
319
+
320
+ /**
321
+ * Control which fields to display in the TaxIdElement.
322
+ */
323
+ fields?: {
324
+ businessName?: 'always' | 'never' | 'auto';
325
+ };
326
+
327
+ /**
328
+ * Specify validation rules for the given fields.
329
+ */
330
+ validation?: {
331
+ businessName?: {
332
+ required?: 'always' | 'never' | 'auto';
333
+ };
334
+ taxId?: {
335
+ required?: 'always' | 'never' | 'auto';
336
+ };
337
+ };
338
+
339
+ /**
340
+ * Default value for TaxIdElement fields
341
+ */
342
+ defaultValues?: {
343
+ businessName?: string;
344
+ taxIdType?: TaxIdType;
345
+ taxId?: string;
346
+ };
347
+ }
348
+
349
+ export interface StripeTaxIdElementChangeEvent {
350
+ /**
351
+ * The type of element that emitted this event.
352
+ */
353
+ elementType: 'taxId';
354
+
355
+ /**
356
+ * Whether or not the TaxIdElement is currently empty.
357
+ */
358
+ empty: boolean;
359
+
360
+ /**
361
+ * Whether or not the TaxIdElement is complete.
362
+ */
363
+ complete: boolean;
364
+
365
+ /**
366
+ * Whether or not the TaxIdElement is visible.
367
+ */
368
+ visible: boolean;
369
+
370
+ /**
371
+ * An object containing the current tax id information.
372
+ */
373
+ value: {
374
+ businessName: string;
375
+ taxId: string;
376
+ taxIdType: TaxIdType;
377
+ externalTaxIdType: ExternalTaxIdType;
378
+ };
379
+ }
@@ -20,6 +20,7 @@ export type CreatePaymentMethodData =
20
20
  | CreatePaymentMethodAuBecsDebitData
21
21
  | CreatePaymentMethodBacsDebitData
22
22
  | CreatePaymentMethodBancontactData
23
+ | CreatePaymentMethodBillieData
23
24
  | CreatePaymentMethodBlikData
24
25
  | CreatePaymentMethodBoletoData
25
26
  | CreatePaymentMethodCardData
@@ -96,6 +97,20 @@ export interface CreatePaymentMethodBancontactData
96
97
  };
97
98
  }
98
99
 
100
+ export interface CreatePaymentMethodBillieData
101
+ extends PaymentMethodCreateParams {
102
+ /**
103
+ * Requires beta access:
104
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
105
+ */
106
+ type: 'billie';
107
+
108
+ /**
109
+ * Details about the Billie pament method. Currently there are no supported child attributes for this field, but sending an empty object is mandatory.
110
+ */
111
+ billie: {}; // eslint-disable-line @typescript-eslint/ban-types
112
+ }
113
+
99
114
  export interface CreatePaymentMethodBlikData extends PaymentMethodCreateParams {
100
115
  type: 'blik';
101
116
 
@@ -673,6 +688,38 @@ export interface ConfirmBancontactPaymentOptions {
673
688
  handleActions?: boolean;
674
689
  }
675
690
 
691
+ /**
692
+ * Data to be sent with a `stripe.confirmBilliePayment` request.
693
+ * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
694
+ */
695
+ export interface ConfirmBilliePaymentData extends PaymentIntentConfirmParams {
696
+ /**
697
+ * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
698
+ * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`.
699
+ *
700
+ * @recommended
701
+ */
702
+ payment_method?: string | Omit<CreatePaymentMethodBillieData, 'type'>;
703
+
704
+ /**
705
+ * The url your customer will be directed to after they complete authentication.
706
+ *
707
+ * @recommended
708
+ */
709
+ return_url?: string;
710
+ }
711
+
712
+ /**
713
+ * An options object to control the behavior of `stripe.confirmBilliePayment`.
714
+ */
715
+ export interface ConfirmBilliePaymentOptions {
716
+ /**
717
+ * Set this to `false` if you want to [manually handle the authorization redirect](https://docs.stripe.com/payments/billie/accept-a-payment#handle-redirect).
718
+ * Default is `true`.
719
+ */
720
+ handleActions?: boolean;
721
+ }
722
+
676
723
  /**
677
724
  * An options object to control the behavior of `stripe.confirmBlikPayment`.
678
725
  */
@@ -20,6 +20,7 @@ export type CreatePaymentMethodData =
20
20
  | CreatePaymentMethodAuBecsDebitData
21
21
  | CreatePaymentMethodBacsDebitData
22
22
  | CreatePaymentMethodBancontactData
23
+ | CreatePaymentMethodBillieData
23
24
  | CreatePaymentMethodBlikData
24
25
  | CreatePaymentMethodBoletoData
25
26
  | CreatePaymentMethodCardData
@@ -96,6 +97,20 @@ export interface CreatePaymentMethodBancontactData
96
97
  };
97
98
  }
98
99
 
100
+ export interface CreatePaymentMethodBillieData
101
+ extends PaymentMethodCreateParams {
102
+ /**
103
+ * Requires beta access:
104
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
105
+ */
106
+ type: 'billie';
107
+
108
+ /**
109
+ * Details about the Billie pament method. Currently there are no supported child attributes for this field, but sending an empty object is mandatory.
110
+ */
111
+ billie: {}; // eslint-disable-line @typescript-eslint/ban-types
112
+ }
113
+
99
114
  export interface CreatePaymentMethodBlikData extends PaymentMethodCreateParams {
100
115
  type: 'blik';
101
116
 
@@ -673,6 +688,38 @@ export interface ConfirmBancontactPaymentOptions {
673
688
  handleActions?: boolean;
674
689
  }
675
690
 
691
+ /**
692
+ * Data to be sent with a `stripe.confirmBilliePayment` request.
693
+ * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters.
694
+ */
695
+ export interface ConfirmBilliePaymentData extends PaymentIntentConfirmParams {
696
+ /**
697
+ * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with.
698
+ * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`.
699
+ *
700
+ * @recommended
701
+ */
702
+ payment_method?: string | Omit<CreatePaymentMethodBillieData, 'type'>;
703
+
704
+ /**
705
+ * The url your customer will be directed to after they complete authentication.
706
+ *
707
+ * @recommended
708
+ */
709
+ return_url?: string;
710
+ }
711
+
712
+ /**
713
+ * An options object to control the behavior of `stripe.confirmBilliePayment`.
714
+ */
715
+ export interface ConfirmBilliePaymentOptions {
716
+ /**
717
+ * Set this to `false` if you want to [manually handle the authorization redirect](https://docs.stripe.com/payments/billie/accept-a-payment#handle-redirect).
718
+ * Default is `true`.
719
+ */
720
+ handleActions?: boolean;
721
+ }
722
+
676
723
  /**
677
724
  * An options object to control the behavior of `stripe.confirmBlikPayment`.
678
725
  */
@@ -209,6 +209,24 @@ export interface Stripe {
209
209
  options?: paymentIntents.ConfirmBancontactPaymentOptions
210
210
  ): Promise<PaymentIntentResult>;
211
211
 
212
+ /**
213
+ * Requires beta access:
214
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
215
+ *
216
+ * Use `stripe.confirmBilliePayment` in the [Billie Payments](https://stripe.com/docs/payments/billie) with Payment Methods flow when the customer submits your payment form.
217
+ * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
218
+ * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
219
+ *
220
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
221
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
222
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
223
+ */
224
+ confirmBilliePayment(
225
+ clientSecret: string,
226
+ data?: paymentIntents.ConfirmBilliePaymentData,
227
+ options?: paymentIntents.ConfirmBilliePaymentOptions
228
+ ): Promise<PaymentIntentResult>;
229
+
212
230
  /**
213
231
  * Use `stripe.confirmBlikPayment` in the [BLIK Payments with Payment Methods](https://stripe.com/docs/payments/blik) flow when the customer submits your payment form.
214
232
  * When called, it will confirm the PaymentIntent with data you provide, and it will automatically prompt the customer to authorize the transaction.
@@ -209,6 +209,24 @@ export interface Stripe {
209
209
  options?: paymentIntents.ConfirmBancontactPaymentOptions
210
210
  ): Promise<PaymentIntentResult>;
211
211
 
212
+ /**
213
+ * Requires beta access:
214
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
215
+ *
216
+ * Use `stripe.confirmBilliePayment` in the [Billie Payments](https://stripe.com/docs/payments/billie) with Payment Methods flow when the customer submits your payment form.
217
+ * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide, and it will automatically redirect the customer to authorize the transaction.
218
+ * Once authorization is complete, the customer will be redirected back to your specified `return_url`.
219
+ *
220
+ * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods).
221
+ * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you.
222
+ * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data.
223
+ */
224
+ confirmBilliePayment(
225
+ clientSecret: string,
226
+ data?: paymentIntents.ConfirmBilliePaymentData,
227
+ options?: paymentIntents.ConfirmBilliePaymentOptions
228
+ ): Promise<PaymentIntentResult>;
229
+
212
230
  /**
213
231
  * Use `stripe.confirmBlikPayment` in the [BLIK Payments with Payment Methods](https://stripe.com/docs/payments/blik) flow when the customer submits your payment form.
214
232
  * When called, it will confirm the PaymentIntent with data you provide, and it will automatically prompt the customer to authorize the transaction.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-js",
3
- "version": "7.4.0",
3
+ "version": "7.6.0",
4
4
  "description": "Stripe.js loading utility",
5
5
  "repository": "github:stripe/stripe-js",
6
6
  "main": "lib/index.js",