User GuidePayment
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"Common 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