Prerequisites
- Node.js 20+
- A deployed PaymentOperator contract (Deploy Operator)
- A running facilitator service
- Base Sepolia ETH for testing
Setup
How it works
extraconfig declares the captureAuthorizer, capture/refund deadlines, fee recipient, and fee bounds. The canonicalAuthCaptureEscrowand token collector addresses are universal CREATE2 deploys, so routes do not need to repeat them.AuthCaptureEvmSchemeregisters the auth-capture payment scheme with the x402 resource server so it can verify auth-capture-backed payments.paymentMiddlewareintercepts requests, checks for a valid payment header, and returns 402 when the caller has not provided one.HTTPFacilitatorClientconnects to the facilitator service that verifies and settles payments on-chain.
Next Steps
forwardToArbiter()
Forward escrow settlements to an arbiter service.
Merchant SDK
Capture payments, handle refunds, and manage escrow.
Deploy Operator
Deploy your own PaymentOperator contract.
