postMessage. The SDK turns that into callbacks.
Never fulfil an order from a browser callback.These fire in the customer’s browser. If they close the tab, lose signal, or their battery dies, the callback never runs — but the payment still completed. Use webhooks for fulfilment and these for UI.
The callbacks
function
The checkout has loaded and completed on-chain verification. Good moment to hide your own loading state.
function
The payment reached finality. Receives the payment payload.Use it to redirect to a thank-you page or show a success state — not to release goods.
function
The payment attempt failed. Receives an error payload.
function
The customer dismissed the checkout. Fires whether or not they paid — a customer can pay and then close, so don’t read this as abandonment on its own.
Typical usage
The race you need to handle
A customer can pay and immediately close the tab. Your webhook fires; youronPaymentConfirmed doesn’t.
Design your thank-you page to read order state from your server, not from the callback. Then a customer who closes early and comes back still sees the right thing.
Checkout states
The customer may see these. Worth recognising them in support conversations.Set up webhooks
The reliable path. Do this before going live.