Handling Events with Lemon.js
Handling overlay events with Lemon.js is easy-peasy. Overlay events are triggered by actions from within the Checkout and Payment Method Update overlays themselves.
You can listen to the overlay events easily with a few lines of code. You’ll need to make sure you’ve got the Lemon.js library installed on your page first.
Every time an event is fired from the overlay,
You will be able to determine which event happened by checking the value in event.event
.
Checkout.Success
events will be passed an Order object in event.data
, which you can use to access or save data immediately after purchase.
Available events
The following events are available in Lemon.js:
Event | Description |
---|---|
Checkout.Success | Checkout was successful |
PaymentMethodUpdate.Mounted | Payment Method Update Overlay has been loaded |
PaymentMethodUpdate.Closed | Payment Method Update Overlay has been closed |
PaymentMethodUpdate.Updated | Payment method has been updated successfully |