Transfer log. Track captured - refunded in your ledger because ERC-20 tokens do not maintain an order-level refundable balance.
Demo
Return a B20 Payment with Its Order Reference
TypeScript backend
transfer instead and record the original order ID, capture hash, refund hash, and amount offchain. B20 can carry the original order ID in the refund transaction with transferWithMemo.
reserveOnce must atomically create a pending refund and reduce the available refundable balance before broadcasting. If the worker loses the receipt, reconcile that pending record from chain data instead of releasing it and risking a duplicate transfer.
The refund transfer goes to the payer from the original receipt, and the durable refund ledger reduces the remaining refundable amount.
See Also
Verify a Payment
Extract the canonical payer and captured amount.
Reconcile Payments
Match refunds back to captures and orders.