Open
Conversation
Adds a machine-to-machine x402 payment flow as an alternative to the existing browser-based credit card checkout. The merchant backend serves HTTP 402 responses with payment requirements, and agents sign and settle USDC payments on-chain via a facilitator. - Add x402 setup module with server initialization and settlement logic - Rewrite x402 checkout endpoint as two-mode (402 → sign → 200) flow - Add wallet setup scripts for merchant and agent - Add Solana ATA creation script - Add x402 checkout UI to TAP agent Streamlit app - Add x402 header logging to CDN proxy - Update README with setup, facilitator, and production docs - Add *.db and .env to .gitignore Tested end-to-end on Solana devnet and Base Sepolia testnet.
Capture and decode the base64-encoded PAYMENT-RESPONSE header returned by the merchant after settlement, showing the facilitator receipt in the Streamlit UI.
The payment requirements are already encoded in the PAYMENT-REQUIRED header per the x402 spec. No need to duplicate them in the JSON body.
Add five low-cost digital products ($0.01-$0.50) to the sample data seed script, suitable for testing x402 payments with small amounts of testnet USDC.
Change x402 checkout to use CDN_PROXY_URL (localhost:3001) instead of hitting the merchant backend directly, aligning with the TAP architecture where all agent traffic flows through the CDN proxy.
Users hitting a ValueError on quickstart because RSA/Ed25519 keys weren't configured. This adds a one-command setup script and updates the README quickstart with the new step.
Auto-seed the database (including digital products for x402) when the merchant backend starts, so users don't need to run create_sample_data.py manually. Also removes the stale merchant.db that was committed despite .gitignore, and cleans up setup_keys.py output.
- setup_x402.py: orchestrates wallet generation, ATA creation, and polls for SOL/USDC funding with in-place terminal updates - Wallet scripts now prompt before overwriting existing private keys - Remove redundant next-steps output from sub-scripts since the orchestrator handles user guidance - Only poll USDC for agent wallets (merchants receive payments) - Improve x402 testing instructions in README
The database and sample data are now created automatically when the server starts, so remove the manual create_sample_data.py step from the setup instructions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add x402 payment integration (USDC on Solana and Base)
Adds a machine-to-machine x402 payment flow as an alternative to the
existing browser-based credit card checkout.
The merchant backend serves HTTP 402 responses with payment requirements, and agents sign and settle
USDC payments on-chain via a facilitator.
Tested end-to-end on Solana devnet and Base Sepolia testnet.
Demo
x402-checkout-demo-compressed_1_3x_with_groovesalad_soft.mp4