Payment Testing
How to test payment functionality
This document covers how to test various payment scenarios in development.
Stripe Testing
Test Card Numbers
| Card Number | Scenario |
|---|---|
4242 4242 4242 4242 | Successful payment |
4000 0000 0000 0002 | Card declined |
4000 0000 0000 9995 | Insufficient funds |
Local Webhook Testing
Use Stripe CLI to forward webhooks:
# Install Stripe CLI
brew install stripe/stripe-cli/stripe
# Login
stripe login
# Forward webhook
stripe listen --forward-to localhost:7001/api/payment/stripe/webhookWeChat Pay Testing
Sandbox Environment
WeChat Pay provides a sandbox environment for testing, needs to be enabled in Merchant Platform.
Testing Notes
- Sandbox amounts are 1/100 of real amounts
- "Sandbox Test" indicator shows after scanning
- Callback must respond with 200 status code
Creem Testing
Test Mode
Use test API Key in test environment:
CREEM_API_KEY="test_xxx"Dodo Payments Testing
Test Mode
Use test credentials and enable test mode:
DODO_PAYMENTS_API_KEY=TSxxxxxxxxxx
DODO_PAYMENTS_WEBHOOK_KEY=whsec_xxxxxxxxxx
DODO_PAYMENTS_TEST_MODE=trueTest Card Numbers
| Card Number | Scenario |
|---|---|
4242 4242 4242 4242 | Successful payment |
4000 0000 0000 0002 | Payment failed |
- Expiration date: any future date, for example
06/32 - CVC: any three digits, for example
123 - Cardholder name: any English name without numbers
Local Webhook Testing
Dodo Payments requires a publicly reachable Webhook URL during local development. Use ngrok or Cloudflare Tunnel and configure:
https://your-tunnel.example.com/api/payment/webhook/dodoWaffo Pancake Testing
Test Mode
API keys are bound to Test or Production at creation time — there is no separate TEST_MODE switch:
WAFFO_MERCHANT_ID=MER_xxxxxxxxxx
WAFFO_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
# Optional. Dashboard RSA public key, not a Stripe-style webhook secret
# WAFFO_WEBHOOK_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----"Dynamic pricing: fill in the real PROD_xxx in pricing_plan. Static pricing: set waffoProductId in config/payment.ts.
Test Card Numbers
| Card Number | Scenario |
|---|---|
4576 7500 0000 0110 | Visa Credit success |
2226 9000 0000 0110 | Mastercard Credit success |
4576 7500 0000 0220 | Visa Credit decline |
- Expiration date: any future date; CVC: any three digits
- The Test Mode checkout offers Quick Fill → Visa Success
- See Waffo Configuration
Checkout is two steps: email/country → Continue → card or Quick Fill → Subscribe. After payment, Waffo shows a hosted success page first — click Done to return to /payment-success?provider=waffo.
Local Webhook Testing
Use ngrok or Cloudflare Tunnel and configure:
https://your-tunnel.example.com/api/payment/webhook/waffoCommon Issues
Webhook Not Receiving Callbacks
- Check if callback URL is correct
- Ensure server is accessible from public network
- Check firewall settings
- View webhook logs in payment platform
Signature Verification Failed
- Check if key is correct
- Ensure request body is not modified
- Check if timestamp is expired