@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 +1 -1
- package/dist/pure.js +1 -1
- package/dist/stripe.esm.js +1 -1
- package/dist/stripe.js +1 -1
- package/package.json +1 -1
- package/types/stripe-js/embedded-checkout.d.ts +30 -0
- package/types/stripe-js/index.d.ts +1 -0
- package/types/stripe-js/stripe.d.ts +12 -0
package/dist/pure.esm.js
CHANGED
package/dist/pure.js
CHANGED
package/dist/stripe.esm.js
CHANGED
package/dist/stripe.js
CHANGED
package/package.json
CHANGED
|
@@ -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
|
+
}
|
|
@@ -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 =
|