Documentation Index
Fetch the complete documentation index at: https://docs.x402r.org/llms.txt
Use this file to discover all available pages before exploring further.
Overview
- Type: Singleton (one per network)
- Deployment: Direct deployment (no factory)
- Purpose: Track refund request lifecycle
Request Types
- Void (before capture)
- Refund (after capture)
Who can request: Payer, Receiver, OR ArbiterTypical flow:
- Payer suspects fraud, requests a refund
- Arbiter investigates
- Arbiter approves or denies the request
- If approved, arbiter calls
operator.void()
- Buyer remorse
- Seller fraud
- Payment error
Request status states
Each payment supports one refund request, keyed bypaymentInfoHash. The payer may only request again after cancelling the prior request.
Key methods
requestRefund()
Creates a refund request for this payment. Only the payer can call.paymentInfo: PaymentInfo structamount: refund amount the payer is asking for (uint120)
amount == 0.
cancelRefundRequest()
Payer cancels their own pending request, freeing the slot to request again.deny()
Arbiter rejects the claim after reviewing evidence. Terminal state.refuse()
Arbiter refuses to consider the request (spam, out of jurisdiction, invalid). Terminal state.Approval
The contract has noupdateStatus or explicit approve entrypoint. Approval happens automatically when the arbiter executes the refund through the operator (operator.void() or operator.refund()), which fires VOID_POST_ACTION_HOOK / REFUND_POST_ACTION_HOOK and flips status to Approved.
Query helpers
getRefundRequest(paymentInfo): fullRefundRequestDatafor this paymenthasRefundRequest(paymentInfo): booleangetRefundRequestStatus(paymentInfo): just theRequestStatusgetPayerRefundRequests(payer, offset, count)/getReceiverRefundRequests(...)/getOperatorRefundRequests(...): paginated index lookups
Usage example
RefundRequest is the request-tracking layer. Executing the refund is always a separate call into the operator/escrow.
