Skip to main content
The script exposes the window.PaymoveWidget object. It is deliberately small - configuration stays in the data-* attributes, and from code you only open, close and clean up widgets.
  • ready() waits for widgets that are starting right now. A widget with invalid configuration does not block the others - ready() resolves anyway, and get() returns undefined for it.
  • There is no update() method. You can’t change the configuration after start - remove the widget and insert the script again.
  • The script uses the defer (or async) attribute, so window.PaymoveWidget may not exist yet when your code runs. Access it only in the script’s onload or after DOMContentLoaded.

Custom button

Any element with the data-paymove-open="<widget-id>" attribute opens the modal of the given widget - no JavaScript needed:
  • A click on a link with data-paymove-open opens the modal instead of navigating to href. Put a fallback page in href - it will work if the script fails to load.
  • A click with Ctrl, Cmd, Shift or Alt held is ignored, so “open in new tab” works as usual.
  • Elements with the disabled attribute or aria-disabled="true" are ignored.
  • The attribute also works on elements inside Shadow DOM and on elements added to the page later.
A button that is visible before the script loads won’t react to clicks. If that matters, enable it only after ready():
The same effect from JavaScript:

The paymove:completed event

After a successful payment the widget dispatches the paymove:completed event on document:
  • The event arrives only once the payment page has confirmed the payment with the paymove API and displayed the confirmation screen.
  • It arrives once per payment.
  • After the payment the modal stays open so the customer can see the confirmation. They close it with the “End” button, the close icon, a click on the backdrop or the Esc key.
paymove:completed is an event in the customer’s browser - it can be dispatched manually from the console. Use it to refresh the UI, never as proof of payment. Fulfil and book orders based on the webhook.