Connect Wallet
Handle payment status
Treat the browser result as a submission hint. Your backend remains the authority for whether the order was paid.
Submitted is not paid
The adapter returns after the wallet submits a transaction. The transaction can still be pending, replaced, reverted or confirmed with unexpected transfer details.
Never unlock goods or credit a balance from the browser-returned hash alone.
Register the transaction hash
await fetch('/api/payments/submitted', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
sessionId: request.session.id,
transactionHash,
idempotencyKey: request.idempotencyKey,
}),
});Authenticate this endpoint and ensure the session belongs to the current payer or merchant order.
Confirm on-chain
Your backend or chain indexer must verify all of the following:
- The receipt or signature succeeded on the session’s selected network.
- The contract or mint is the server-configured asset reference.
- The transfer recipient is the configured destination.
- The transferred base-unit amount satisfies the order.
- The sender is acceptable for the Checkout Session.
- The chain-specific finality policy has been reached.
Credit exactly once
Put a unique constraint on the transaction hash and on the merchant order’s terminal credit record. Replayed requests must return the existing result instead of applying the payment again.