@stripe/stripe-js 1.29.0 → 1.30.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.29.0",
57
+ version: "1.30.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.29.0",
61
+ version: "1.30.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.29.0",
41
+ version: "1.30.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.29.0",
45
+ version: "1.30.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.29.0",
3
+ "version": "1.30.0",
4
4
  "description": "Stripe.js loading utility",
5
5
  "main": "dist/stripe.js",
6
6
  "module": "dist/stripe.esm.js",
@@ -1,4 +1,5 @@
1
1
  import {StripeElementBase} from './base';
2
+ import {StripeError} from '../stripe';
2
3
 
3
4
  export type StripePaymentElement = StripeElementBase & {
4
5
  /**
@@ -81,6 +82,22 @@ export type StripePaymentElement = StripeElementBase & {
81
82
  handler?: (event: {elementType: 'payment'}) => any
82
83
  ): StripePaymentElement;
83
84
 
85
+ /**
86
+ * Triggered when the element fails to load.
87
+ */
88
+ on(
89
+ eventType: 'loaderror',
90
+ handler: (event: {elementType: 'payment'; error: StripeError}) => any
91
+ ): StripePaymentElement;
92
+ once(
93
+ eventType: 'loaderror',
94
+ handler: (event: {elementType: 'payment'; error: StripeError}) => any
95
+ ): StripePaymentElement;
96
+ off(
97
+ eventType: 'loaderror',
98
+ handler?: (event: {elementType: 'payment'; error: StripeError}) => any
99
+ ): StripePaymentElement;
100
+
84
101
  /**
85
102
  * Updates the options the `PaymentElement` was initialized with.
86
103
  * Updates are merged into the existing configuration.
@@ -80,14 +80,6 @@ export type StripeShippingAddressElement = StripeElementBase & {
80
80
  eventType: 'escape',
81
81
  handler?: (event: {elementType: 'shippingAddress'}) => any
82
82
  ): StripeShippingAddressElement;
83
-
84
- /**
85
- * Updates the options the `ShippingAddressElement` was initialized with.
86
- * Updates are merged into the existing configuration.
87
- */
88
- update(
89
- options: Partial<StripeShippingAddressElementOptions>
90
- ): StripeShippingAddressElement;
91
83
  };
92
84
 
93
85
  export interface StripeShippingAddressElementOptions {
@@ -471,6 +471,15 @@ export interface StripeElementsOptions {
471
471
  * Default is `'auto'` (Stripe determines if a loader UI should be shown).
472
472
  */
473
473
  loader?: 'auto' | 'always' | 'never';
474
+
475
+ /**
476
+ * Requires beta access:
477
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
478
+ *
479
+ * Display saved PaymentMethods and Customer information.
480
+ * Supported for the `payment`, `shippingAddress`, and `linkAuthentication` Elements.
481
+ */
482
+ customerOptions?: CustomerOptions;
474
483
  }
475
484
 
476
485
  /*
@@ -485,9 +494,6 @@ export interface StripeElementsUpdateOptions {
485
494
  locale?: StripeElementLocale;
486
495
 
487
496
  /**
488
- * Used with the Payment Element, requires beta access:
489
- * Contact [Stripe support](https://support.stripe.com/) for more information.
490
- *
491
497
  * Match the design of your site with the appearance option.
492
498
  * The layout of each Element stays consistent, but you can modify colors, fonts, borders, padding, and more.
493
499
  *
@@ -638,3 +644,15 @@ export interface Appearance {
638
644
 
639
645
  labels?: 'above' | 'floating';
640
646
  }
647
+
648
+ export interface CustomerOptions {
649
+ /**
650
+ * The Customer id.
651
+ */
652
+ customer: string;
653
+
654
+ /**
655
+ * The ephemeral key for a Customer that grants temporary access to Customer data.
656
+ */
657
+ ephemeralKey: string;
658
+ }
@@ -14,6 +14,11 @@ export interface PaymentRequest {
14
14
  */
15
15
  show(): void;
16
16
 
17
+ /**
18
+ * Closes the browser’s payment interface.
19
+ */
20
+ abort: () => void;
21
+
17
22
  /**
18
23
  * `true` if the browser’s payment interface is showing.
19
24
  * When using the `PaymentRequestButtonElement`, this is called for you automatically.