refundExpiry. The Commerce Payments Protocol maintains the refundable limit onchain and always sends the refund to paymentInfo.payer.
Demo
Fund and Submit the Refund
Captured funds have already left escrow. The deployedOperatorRefundCollector sources replacement liquidity from paymentInfo.operator, so approve it for the refund amount before calling refund.
TypeScript
refundableAmount by its gross amount. Fees do not reduce that limit. Every refund decreases it by the amount returned.
Verify
PaymentRefunded(paymentInfoHash, amount, tokenCollector), the transfer to the stored payer, and the updated refundableAmount before completing the return.See Also
Verify a Payment
Confirm the original protocol settlement and payment hash.
Reconcile Payments
Match refunds to charges and captures.