@stripe/stripe-js 7.5.0 → 7.6.1

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.5.0",
58
+ version: "7.6.1",
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.5.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.1", " 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.5.0",
54
+ version: "7.6.1",
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.5.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.1", " 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.5.0",
74
+ version: "7.6.1",
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.5.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.1", " 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.5.0",
70
+ version: "7.6.1",
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.5.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.1", " 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
  /**
@@ -604,6 +606,8 @@ export interface StripeCheckout {
604
606
  getExpressCheckoutElement(): StripeCheckoutExpressCheckoutElement | null;
605
607
  /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
606
608
  getCurrencySelectorElement(): StripeCurrencySelectorElement | null;
609
+ /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
610
+ getTaxIdElement(): StripeTaxIdElement | null;
607
611
  createPaymentElement(
608
612
  options?: StripeCheckoutPaymentElementOptions
609
613
  ): StripePaymentElement;
@@ -618,4 +622,6 @@ export interface StripeCheckout {
618
622
  ): StripeCheckoutExpressCheckoutElement;
619
623
  /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
620
624
  createCurrencySelectorElement(): StripeCurrencySelectorElement;
625
+ /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
626
+ createTaxIdElement(options?: StripeTaxIdElementOptions): StripeTaxIdElement;
621
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
  /**
@@ -604,6 +606,8 @@ export interface StripeCheckout {
604
606
  getExpressCheckoutElement(): StripeCheckoutExpressCheckoutElement | null;
605
607
  /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
606
608
  getCurrencySelectorElement(): StripeCurrencySelectorElement | null;
609
+ /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
610
+ getTaxIdElement(): StripeTaxIdElement | null;
607
611
  createPaymentElement(
608
612
  options?: StripeCheckoutPaymentElementOptions
609
613
  ): StripePaymentElement;
@@ -618,4 +622,6 @@ export interface StripeCheckout {
618
622
  ): StripeCheckoutExpressCheckoutElement;
619
623
  /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
620
624
  createCurrencySelectorElement(): StripeCurrencySelectorElement;
625
+ /* Requires beta access: Contact [Stripe support](https://support.stripe.com/) for more information. */
626
+ createTaxIdElement(options?: StripeTaxIdElementOptions): StripeTaxIdElement;
621
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';
@@ -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
+ }
@@ -49,6 +49,7 @@ import {
49
49
  StripeExpressCheckoutElement,
50
50
  StripeExpressCheckoutElementOptions,
51
51
  StripeAddressElementGetElementOptions,
52
+ StripeTaxIdElement,
52
53
  } from './elements';
53
54
  import {StripeError} from './stripe';
54
55
 
@@ -519,7 +520,8 @@ export type StripeElementType =
519
520
  | 'issuingCardCvcDisplay'
520
521
  | 'issuingCardExpiryDisplay'
521
522
  | 'issuingCardPinDisplay'
522
- | 'issuingCardCopyButton';
523
+ | 'issuingCardCopyButton'
524
+ | 'taxId';
523
525
 
524
526
  export type StripeElement =
525
527
  | StripeAddressElement
@@ -545,7 +547,8 @@ export type StripeElement =
545
547
  | StripeIssuingCardExpiryDisplayElement
546
548
  | StripeIssuingCardPinDisplayElement
547
549
  | StripeIssuingCardCopyButtonElement
548
- | StripeShippingAddressElement;
550
+ | StripeShippingAddressElement
551
+ | StripeTaxIdElement;
549
552
 
550
553
  export type StripeElementLocale =
551
554
  | 'auto'
@@ -49,6 +49,7 @@ import {
49
49
  StripeExpressCheckoutElement,
50
50
  StripeExpressCheckoutElementOptions,
51
51
  StripeAddressElementGetElementOptions,
52
+ StripeTaxIdElement,
52
53
  } from './elements';
53
54
  import {StripeError} from './stripe';
54
55
 
@@ -519,7 +520,8 @@ export type StripeElementType =
519
520
  | 'issuingCardCvcDisplay'
520
521
  | 'issuingCardExpiryDisplay'
521
522
  | 'issuingCardPinDisplay'
522
- | 'issuingCardCopyButton';
523
+ | 'issuingCardCopyButton'
524
+ | 'taxId';
523
525
 
524
526
  export type StripeElement =
525
527
  | StripeAddressElement
@@ -545,7 +547,8 @@ export type StripeElement =
545
547
  | StripeIssuingCardExpiryDisplayElement
546
548
  | StripeIssuingCardPinDisplayElement
547
549
  | StripeIssuingCardCopyButtonElement
548
- | StripeShippingAddressElement;
550
+ | StripeShippingAddressElement
551
+ | StripeTaxIdElement;
549
552
 
550
553
  export type StripeElementLocale =
551
554
  | 'auto'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-js",
3
- "version": "7.5.0",
3
+ "version": "7.6.1",
4
4
  "description": "Stripe.js loading utility",
5
5
  "repository": "github:stripe/stripe-js",
6
6
  "main": "lib/index.js",