x402 and the Payments SDK
On the exact x402 rail, roles split like this:
| Role | Responsibility | Package |
|---|---|---|
| Shopper (agent) | Answers HTTP 402 with EIP-3009 / PAYMENT-SIGNATURE | Standard @x402/* client (not Payments SDK) |
| Resource server | Issues challenges, talks to Curvy’s facilitator, confirms shield evidence | @0xcurvy/payments-sdk + @0xcurvy/x402-protocol |
| Facilitator | Verify, settle, submit shield | Curvy proprietary service |
Copyable merchant reference in this monorepo: packages/merchant/merchant-x402-exact. Human-checkout helpers (signPaymentIntent, buildCheckoutUrl, …) are not part of this rail — see Human checkout.
Tests
- Unit (mocked chain, Payments SDK only):
pnpm --filter @0xcurvy/payments-sdk test— includesx402-merchantcases for challenge note derivation, facilitator-recovery portal prediction, and shield confirmation. - E2E (Anvil + facilitator +
merchant-x402-exact+ shopper driver):pnpm demo:payments:x402-merchant-e2e(documented underpackages/demo/TESTING.md).
Related
- Confirming payments —
verifyPaymentand payment references - API surface — all Payments SDK entry points
@0xcurvy/x402-protocol— x402 wire types (not part of this package)