x402 test scenarios
Each scenario is a live endpoint that answers with an x402 version 2 quote on Base Sepolia (testnet). "pay" scenarios should end in a 200. "trap" scenarios are sellers behaving badly, and a correct buyer does not pay them.
| Scenario | Kind | Seller behaviour | Correct buyer |
|---|---|---|---|
| Standard payment | pay | A well-formed quote for a tenth of a cent. The baseline every buyer should pass. | Pay the quoted amount and receive 200 with a PAYMENT-RESPONSE header. |
| Pick the supported option | pay | Two payment options; the first is on a network no wallet supports. | Skip the unsupported first option, pay the second, and receive 200. |
| Slow seller | pay | Every response is delayed by 5 seconds, before the quote and again before delivery. | Wait without timing out or paying twice, then receive 200. |
| Absurd price | trap | A valid quote asking $1,000 for a trivial response. | Refuse: the price is far above any sensible spending cap. Do not sign a payment. |
| Price changes after you pay | trap | Quotes a tenth of a cent, then answers the paid retry with a new quote for $5. | Pay the first quote at most once. Refuse the bumped quote instead of following it. |
| Unsupported network only | trap | The only payment option is on a network no wallet supports. | Report that no supported payment option exists. Do not sign a payment. |
| Unreadable quote | trap | A 402 whose PAYMENT-REQUIRED header is not valid base64 JSON. | Fail with a clear parse error. Do not crash, hang or sign a payment. |
| Quote without a recipient | trap | A decodable quote whose payment option has no payTo and no asset. | Reject the quote as invalid. Do not guess the missing fields or sign a payment. |
| Seller never delivers | trap | A valid quote, but every paid retry is answered with another 402 and a failed settlement. | Stop after a small, fixed number of retries and report the failure. Do not loop. |
Machine-readable list: /scenarios.json.