Nava Gateway payment lifecycle
Developer Preview
The preview inserts a policy gate after structural x402 verification and before merchant settlement.
Resource-server path
- The resource gate deterministically quotes an
exactEIP-3009 USDC payment for Base or Base Sepolia. - If Guardian applies and verification fees are enabled, it obtains a separate
fee requirement from the facilitator's
/verification/quoteendpoint. - With no
X-PAYMENTheader, the gate returns402with the merchant requirement and optional verification requirement. - The payer signs the merchant authorization and, when quoted, a separate verification-fee authorization.
- The gate calls
/verify. The facilitator pins the configured network/asset, enforces a minimum value when configured, verifies the merchant payment, and resolves enrollment from the signed payer wallet and payment chain. Inoptionalmode an enrolled wallet is gated and an unenrolled wallet uses vanilla x402; inrequiredmode an unenrolled wallet is invalid. Any lookup error fails closed. When Guardian applies, the facilitator validates the fee against a fresh authoritative quote and asks Guardian to evaluate the merchant payment. - On a terminal
approvedorrejectedverdict, the facilitator settles the verification fee when one was required. A timeout/error is not terminal and does not settle the fee. - On rejection, the facilitator records the rejected decision and the gate
returns
402; the merchant payment is not settled. - On approval, the facilitator records the exact approved payment. Both
approved and rejected records freeze the resolved
agentId,policyId, andpolicyVersion./settleconsumes the applicable record before submitting the merchant transfer. Redis uses atomicGETDEL; the default in-memory implementation does not make its read/delete sequence atomic under concurrent calls. - After successful merchant settlement, the gate returns
200andX-PAYMENT-RESPONSE.
The two payments are independent authorizations. Only the merchant payment is policy-gated. The fee pays for a completed verification and can therefore settle after either terminal outcome; the merchant receives funds only after approval.
An owner can remove a wallet or deactivate its policy before a later payment,
changing whether that later payment is enrolled. While the bridge record
remains, /settle always enforces it — an approval survives unenrollment and a
rejected payment never becomes claimable. Records last for the lesser of the
authorization's remaining validBefore and a one-hour facilitator cap;
authorizations that outlive the cap are rejected at /verify.
Because approval consumption precedes merchant broadcast, a settlement failure
or resource-gate 502 requires a new /verify before another /settle. A
previously settled verification fee may require a fresh fee authorization for
that new verification. Do not blindly retry /settle; first reconcile any
uncertain on-chain result, then re-run verification for the exact payment.
Existing-facilitator path
- Your verifier validates the x402 payment.
withGuardianshort-circuits an invalid base result.- For a valid base result, the facilitator resolves the payer wallet through
the Integrator API. When Guardian applies,
verifyPaymentmaps the payment to a previewPaymentActionand waits within configured bounds. withGuardianreports valid only when the returned verdict outcome isapproved; rejected, timeout, and error results fail closed.- Your existing settlement path runs only after that valid response.
This wrapper path does not add fee settlement or an approval store. Those controls remain the responsibility of the integrating facilitator.
Outcome handling
Read verdict.outcome, not the wording of humanReason and not a reason-code
allowlist. Preserve any unknown reasonCode for diagnostics. Missing,
pending, malformed, timed-out, or error results are not approval.