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, validates the fee against a fresh authoritative quote, and then 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 gate returns
402; the merchant payment is not settled. - On approval, the facilitator records the exact approved payment.
/settleconsumes that 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.
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,
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.