@stripe/stripe-js 2.1.1 → 2.1.2

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: "2.1.1",
57
+ version: "2.1.2",
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: "2.1.1",
61
+ version: "2.1.2",
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: "2.1.1",
41
+ version: "2.1.2",
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: "2.1.1",
45
+ version: "2.1.2",
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": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "Stripe.js loading utility",
5
5
  "main": "dist/stripe.js",
6
6
  "module": "dist/stripe.esm.js",
@@ -0,0 +1,30 @@
1
+ export interface StripeEmbeddedCheckoutOptions {
2
+ /**
3
+ * The client secret of the [Checkout Session](https://stripe.com/docs/api/checkout/sessions).
4
+ */
5
+ clientSecret: string;
6
+ /**
7
+ * onComplete is called when the Checkout Session completes successfully.
8
+ * You can use it to unmount Embedded Checkout and render a custom success UI.
9
+ */
10
+ onComplete?: () => void;
11
+ }
12
+
13
+ export interface StripeEmbeddedCheckout {
14
+ /**
15
+ * The `embeddedCheckout.mount` method attaches your Embedded Checkout to the DOM.
16
+ * `mount` accepts either a CSS Selector (e.g., `'#checkout'`) or a DOM element.
17
+ */
18
+ mount(location: string | HTMLElement): void;
19
+ /**
20
+ * Unmounts Embedded Checkout from the DOM.
21
+ * Call `embeddedCheckout.mount` to re-attach it to the DOM.
22
+ */
23
+ unmount(): void;
24
+ /**
25
+ * Removes Embedded Checkout from the DOM and destroys it.
26
+ * Once destroyed it not be re-mounted to the DOM.
27
+ * Use this if you want to create a new Embedded Checkout instance.
28
+ */
29
+ destroy(): void;
30
+ }
@@ -1,5 +1,6 @@
1
1
  export * from './checkout';
2
2
  export * from './custom-checkout';
3
+ export * from './embedded-checkout';
3
4
  export * from './elements';
4
5
  export * from './elements-group';
5
6
  export * from './ephemeral-keys';
@@ -19,6 +19,10 @@ import {
19
19
  StripeCustomCheckoutOptions,
20
20
  StripeCustomCheckout,
21
21
  } from './custom-checkout';
22
+ import {
23
+ StripeEmbeddedCheckoutOptions,
24
+ StripeEmbeddedCheckout,
25
+ } from './embedded-checkout';
22
26
 
23
27
  export interface Stripe {
24
28
  /////////////////////////////
@@ -1205,6 +1209,14 @@ export interface Stripe {
1205
1209
  initCustomCheckout(
1206
1210
  options: StripeCustomCheckoutOptions
1207
1211
  ): Promise<StripeCustomCheckout>;
1212
+
1213
+ /**
1214
+ * Requires beta access:
1215
+ * Contact [Stripe support](https://support.stripe.com/) for more information.
1216
+ */
1217
+ initEmbeddedCheckout(
1218
+ options: StripeEmbeddedCheckoutOptions
1219
+ ): Promise<StripeEmbeddedCheckout>;
1208
1220
  }
1209
1221
 
1210
1222
  export type PaymentIntentResult =