Checkout SDK
Events
Lifecycle callbacks you can pass to checkout() (or to a button's checkout options) to react to the payment as it progresses.
Callbacks
All callbacks are optional. Each receives the current invoice object, except onError, which receives an Error. The Type column below is the argument each callback is called with.
| Property | Type | Description |
|---|---|---|
| onReady | invoice | The invoice first loads. |
| onCoinSelected | invoice | The payer picks or switches a coin. |
| onPaymentDetected | invoice | An on-chain payment is detected and confirming. |
| onCompleted | invoice | The invoice completes. |
| onExpired | invoice | The invoice expires. |
| onCanceled | invoice | The invoice is canceled. |
| onError | Error | A load, select, or requote fails. Receives a CheckoutApiError. |
Each transition fires once per invoice. Reopening a modal does not replay callbacks that already ran.