Payment Integration
Overview
Payment Flow
┌──────────────────────────────────────────────────────────────────────────┐
│ Payment Flow │
│ │
│ Client Gateway Blockchain │
│ │ │ │ │
│ │ 1. Submit request │ │ │
│ │──────────────────────▶│ │ │
│ │ │ │ │
│ │ 2. Payment info │ │ │
│ │◀──────────────────────│ │ │
│ │ (amount, contract) │ │ │
│ │ │ │ │
│ │ 3. Pay to contract │ │ │
│ │───────────────────────────────────────────────▶│ │
│ │ │ │ │
│ │ 4. tx_hash │ │ │
│ │◀──────────────────────────────────────────────│ │
│ │ │ │ │
│ │ 5. Confirm payment │ │ │
│ │──────────────────────▶│ │ │
│ │ (tx_hash) │ │ │
│ │ │ │ │
│ │ │ 6. Verify tx │ │
│ │ │──────────────────────▶│ │
│ │ │ │ │
│ │ 7. Processing... │ │ │
│ │◀──────────────────────│ │ │
│ │ │ │ │
│ │ 8. Result │ │ │
│ │◀──────────────────────│ │ │
│ │ │ │ │
└──────────────────────────────────────────────────────────────────────────┘Prerequisites
Contract Addresses
Testnet (Forknet)
Contract
Address
Integration Steps
1. Submit Request & Get Payment Info
2. Approve Token Spend
3. Initiate Payment
4. Confirm Payment with Gateway
5. Wait for Result
JavaScript Integration
Using ethers.js
Complete Example
Python with Full Payment Flow
Testnet Faucet
Next Steps
Last updated
