Prerequisites: - Node.js version 18 or higher - A Solana wallet (Phantom,
Solflare, or Backpack) - Basic understanding of TypeScript/JavaScript
1
Clone the CheapPay repository
2
Install dependencies
CheapPay uses pnpm for workspace management:
3
Set up environment variables
Create a
.env
file in your project root:4
Get devnet tokens
For testing, you’ll need devnet SOL and USDC:
Running examples locally
CheapPay includes several working examples you can run immediately:Express.js API server
Express.js API server
http://localhost:3001/api/premium
Next.js fullstack application
Next.js fullstack application
bash cd examples/typescript/fullstack/next npm install npm run dev
Visit http://localhost:3000
to see the complete payment flowFacilitator service (advanced)
Facilitator service (advanced)
http://localhost:3011
Testing payments
Devnet testing workflow
1
Start your development server
Run any of the example applications above.
2
Navigate to a protected endpoint
Try accessing a payment-protected route in your browser.
3
Connect your wallet
Use a Solana wallet with devnet enabled (Phantom recommended).
4
Complete the test payment
Pay with fake devnet USDC - no real money involved!
Testing different scenarios
Development tools
Debugging payments
Enable debug logging to trace payment flows:Wallet connections
Test with multiple wallets to ensure compatibility:- Phantom: Most popular Solana wallet
- Solflare: Web and mobile support
- Backpack: Developer-friendly wallet
- Coin98: Multi-chain support
Network switching
Test across different Solana networks:Contributing to CheapPay
Development workflow
1
Fork and clone
Fork the repository and create a feature branch:
2
Make your changes
Follow our coding standards: - Use TypeScript for type safety - Add tests for
new features - Update documentation
3
Test thoroughly
4
Submit a pull request
Include a clear description of your changes and test results.
Code formatting
We use Prettier and ESLint for consistent code style:Troubleshooting
Error: Wallet connection failed
Error: Wallet connection failed
Solutions:
- Ensure your wallet is set to Solana devnet
- Check that you have sufficient SOL for transaction fees
- Try refreshing the page and reconnecting
- Clear browser cache and wallet cache
Error: Payment verification failed
Error: Payment verification failed
Common causes: 1. Insufficient devnet USDC balance 2. Network connectivity
issues 3. RPC rate limiting Solutions: - Get more devnet tokens from the
faucet - Switch to a different RPC endpoint - Wait a few seconds and retry
Error: Transaction timeout
Error: Transaction timeout
Solutions:
- Increase timeout settings in your configuration
- Check Solana network status
- Use a more reliable RPC endpoint
Performance optimization
RPC endpoint selection
Use reliable RPC providers for better performance:Caching strategies
Implement caching for better user experience:Next steps
Build your first API
Create a payment-enabled Express API from scratch.
Integration guide
Learn about different framework integrations.
Production deployment
Deploy your payment-enabled API to production.
Join our community
Connect with us on all platforms via our Linktree.
Telegram Community
Get help from developers and the CheapPay team.
Ready to start building? Check out our examples repository for complete working implementations.