Appearance
Testing
Use the GovPayPlan sandbox environment to test your integration before going live.
Sandbox Environment
Overview
The sandbox is a complete replica of the production environment for testing purposes:
- Separate API keys
- No real payments processed
- Test card numbers provided
- Full API functionality
Sandbox URLs
| Service | URL |
|---|---|
| API | https://sandbox-api.govpayplan.com/v1 |
| Hosted Page | https://sandbox-pay.govpayplan.com |
| JavaScript SDK | https://js.govpayplan.com/v1/sdk.js |
Sandbox Credentials
- Log in to the Admin Portal
- Navigate to Settings > API
- Switch to Sandbox tab
- Copy your sandbox API key
Test Card Numbers
Successful Payments
| Brand | Number | CVV | Expiry |
|---|---|---|---|
| Visa | 4242 4242 4242 4242 | Any 3 digits | Any future date |
| Mastercard | 5555 5555 5555 4444 | Any 3 digits | Any future date |
| American Express | 3782 822463 10005 | Any 4 digits | Any future date |
| Discover | 6011 1111 1111 1117 | Any 3 digits | Any future date |
Declined Payments
| Scenario | Card Number |
|---|---|
| Generic decline | 4000 0000 0000 0002 |
| Insufficient funds | 4000 0000 0000 9995 |
| Lost card | 4000 0000 0000 9987 |
| Stolen card | 4000 0000 0000 9979 |
| Expired card | 4000 0000 0000 0069 |
| Incorrect CVV | 4000 0000 0000 0127 |
Special Scenarios
| Scenario | Card Number |
|---|---|
| 3D Secure required | 4000 0000 0000 3220 |
| 3D Secure fail | 4000 0000 0000 3097 |
| Processing error | 4000 0000 0000 0119 |
| Rate limit | 4000 0000 0000 6975 |
Test Bank Accounts
Successful ACH
| Routing | Account | Result |
|---|---|---|
| 110000000 | 000123456789 | Success |
| 110000000 | 000111111116 | Success (micro-deposits) |
Failed ACH
| Routing | Account | Result |
|---|---|---|
| 110000000 | 000111111113 | Account closed |
| 110000000 | 000111111116 | NSF |
Testing Webhooks
Send Test Events
- Navigate to Settings > API > Webhooks
- Select your endpoint
- Click Send Test Event
- Choose event type:
payment.completedpayment.failedrefund.completed
- Click Send
Local Development
Use a tunnel for local testing:
bash
# Install ngrok
npm install -g ngrok
# Start tunnel
ngrok http 3000
# Use the HTTPS URL for webhooks
# https://abc123.ngrok.io/webhooksWebhook Test Payload
json
{
"id": "evt_test_123",
"type": "payment.completed",
"test_mode": true,
"created_at": "2024-01-15T10:30:00Z",
"data": {
"payment": {
"id": "pay_test_xyz",
"amount": 100.00,
"status": "completed"
}
}
}Testing Checklist
Before Going Live
- [ ] Successful payments: Test with success cards
- [ ] Failed payments: Handle declines gracefully
- [ ] Refunds: Test full and partial refunds
- [ ] Webhooks: Verify all events received
- [ ] Error handling: Check all error scenarios
- [ ] Edge cases: Empty forms, invalid data
- [ ] Mobile: Test on mobile devices
- [ ] Receipts: Verify email delivery
- [ ] Recurring: Test subscription flows
Integration Points
- [ ] Payment creation
- [ ] Payment status checks
- [ ] Refund processing
- [ ] Webhook receipt and verification
- [ ] Session creation (hosted page)
- [ ] Token creation (embedded forms)
Going Live
Pre-Launch Steps
- Complete all testing scenarios
- Request production credentials
- Update API keys in your application
- Update base URLs to production
- Test one real transaction (small amount)
- Monitor for errors
Production Checklist
- [ ] Production API keys configured
- [ ] Production URLs in use
- [ ] Webhook endpoints updated
- [ ] SSL certificate valid
- [ ] Error logging enabled
- [ ] Monitoring in place
First Production Payment
- Process a small amount ($1)
- Verify transaction in dashboard
- Confirm webhook received
- Test refund process
- Verify receipt delivery
Troubleshooting
Common Issues
| Issue | Solution |
|---|---|
| 401 Unauthorized | Check API key is correct and for right environment |
| Webhook not received | Verify endpoint URL, check firewall |
| Card declined | Use test card numbers |
| CORS error | SDK must be loaded from approved domain |
Debug Mode
Enable debug logging in the SDK:
javascript
const gpp = GovPayPlan.init({
publishableKey: 'gpp_pub_test_xxx',
debug: true
});Support
If you encounter issues:
- Check this documentation
- Review API response errors
- Contact developer support
Related Topics
- Getting Started - Initial setup
- Webhooks - Event notifications
- Authentication - API credentials
