An event handler that is triggered when Enter is pressed in the card form.
This feature is not available for template sets configured with the stripe_connect
hosted payment gateway due to the limitations of Stripe.js.
Clears the card data from the embed. No-op if the embed is not mounted.
Updates the configuration of the payment card embed. You can change style, translations, language and interactivity settings. To change the URL of the payment card embed, you need to create a new instance. You are not required to provide the full configuration object, only the properties you want to change.
The new configuration.
Mounts the payment card embed in the given root element. If the embed is already mounted, it will be unmounted first.
The root element to mount the embed in.
A promise that resolves when the embed is mounted.
Requests the tokenization of the card data.
A promise that resolves with the tokenized card data.
Safely removes the embed iframe from the parent node, closing the message channel and cleaning up event listeners.
Generated using TypeDoc
A convenience wrapper for the payment card embed iframe. You don't have to use this class to embed the payment card iframe, but it provides a more convenient way to interact with the iframe and listen to its events.
const embed = new PaymentCardEmbed({ url: 'https://embed.foxy.io/v1.html?template_set_id=123' });
await embed.mount(document.body); console.log('Token:', await embed.tokenize());