Our new version of Mollie Components is in private beta.If you are interested in early access you can reach out to us. Looking to embed a card form with Mollie.JS V1? See Embedding a card form.
The checkout object is the client side representation of the Session. It can be used to create one or more components which can be mounted in your checkout.
Checkout(clientToken, options?)
Checkout(clientToken, options?)To create a Checkout object, use Mollie.Checkout(clientToken, options?). The client token can be generated by creating a Session from your backend by calling the Sessions API.
const checkout = Mollie.Checkout("eyJzZXNzaW9uVG9rZW4X...", { locale: 'en-US' });
Compatibility modeIf you have loaded Mollie.js in compatibility mode, you can initialize calling
Mollie2.Checkout(clientToken, options?)
Parameters
clientToken string required
clientToken string requiredThe client token from the Session. Create a Session via the Sessions API to retrieve a token.
options object
options objectInitialization options.
Methods
.create(componentType: string, options: object): ComponentInstance
.create(componentType: string, options: object): ComponentInstanceCreates a new component.
.on(event: string, handler: Function): this
.on(event: string, handler: Function): thisSubscribes to checkout events.
.off(event: string, handler?: Function): this
.off(event: string, handler?: Function): thisUnsubscribes from checkout events.
Events
You can listen for events via .on(eventName, handler).
.on('submit', handler)
.on('submit', handler)The submit event is triggered before the Session will create a payment. You can pause the processing of the payment while you trigger any logic in your system and decide to continue processing or canceling.