The Stripe Checkout handler is essentially a readily configured Stripe Checkout window, prepared to open when you need it.
The createHandler method takes the configuration options you know from the Stripe Checkout documentation. Required options are: key and token.
4. Open the Stripe Checkout window to begin payment flow.
Finally, you may trigger open somewhere in your code, to open the payment window.
The open method takes the Stripe Checkout configuration options again, but this time key and token are not required.
Use this to set amount, user's email and other things that might change from each time the window is opened.
After payment, the token callback will be triggered (see step 3 above).
// If the window has been opened, this is how you can close it:
this.stripeCheckoutHandler.close();
}
}
New in 1.0.4
The open method now returns a promise, while still being fully backwards compatible.
Using the promise handlers lets you simplify your code, as you don't have to configure separate callback functions to receive the token.