Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cweiss-stripe committed Sep 5, 2023
1 parent 2beac91 commit d3cf05d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions types/stripe-js/embedded-checkout.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
export interface StripeEmbeddedCheckoutOptions {
/**
* The client secret of the [Checkout Session](https://stripe.com/docs/api/checkout/sessions).
*/
clientSecret: string;
/**
* onComplete is called when the Checkout Session completes successfully.
* You can use it to unmount Embedded Checkout and render a custom success UI.
*/
onComplete?: () => void;
}

export interface StripeEmbeddedCheckout {
/**
* The `embeddedCheckout.mount` method attaches your Embedded Checkout to the DOM.
* `mount` accepts either a CSS Selector (e.g., `'#checkout'`) or a DOM element.
*/
mount(location: string | HTMLElement): void;
/**
* Unmounts Embedded Checkout from the DOM.
* Call `embeddedCheckout.mount` to re-attach it to the DOM.
*/
unmount(): void;
/**
* Removes Embedded Checkout from the DOM and destroys it.
* Once destroyed it not be re-mounted to the DOM.
* Use this if you want to create a new Embedded Checkout instance.
*/
destroy(): void;
}

0 comments on commit d3cf05d

Please sign in to comment.