Skip to content

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

ServiceURL
APIhttps://sandbox-api.govpayplan.com/v1
Hosted Pagehttps://sandbox-pay.govpayplan.com
JavaScript SDKhttps://js.govpayplan.com/v1/sdk.js

Sandbox Credentials

  1. Log in to the Admin Portal
  2. Navigate to Settings > API
  3. Switch to Sandbox tab
  4. Copy your sandbox API key

Test Card Numbers

Successful Payments

BrandNumberCVVExpiry
Visa4242 4242 4242 4242Any 3 digitsAny future date
Mastercard5555 5555 5555 4444Any 3 digitsAny future date
American Express3782 822463 10005Any 4 digitsAny future date
Discover6011 1111 1111 1117Any 3 digitsAny future date

Declined Payments

ScenarioCard Number
Generic decline4000 0000 0000 0002
Insufficient funds4000 0000 0000 9995
Lost card4000 0000 0000 9987
Stolen card4000 0000 0000 9979
Expired card4000 0000 0000 0069
Incorrect CVV4000 0000 0000 0127

Special Scenarios

ScenarioCard Number
3D Secure required4000 0000 0000 3220
3D Secure fail4000 0000 0000 3097
Processing error4000 0000 0000 0119
Rate limit4000 0000 0000 6975

Test Bank Accounts

Successful ACH

RoutingAccountResult
110000000000123456789Success
110000000000111111116Success (micro-deposits)

Failed ACH

RoutingAccountResult
110000000000111111113Account closed
110000000000111111116NSF

Testing Webhooks

Send Test Events

  1. Navigate to Settings > API > Webhooks
  2. Select your endpoint
  3. Click Send Test Event
  4. Choose event type:
    • payment.completed
    • payment.failed
    • refund.completed
  5. 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/webhooks

Webhook 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

  1. Complete all testing scenarios
  2. Request production credentials
  3. Update API keys in your application
  4. Update base URLs to production
  5. Test one real transaction (small amount)
  6. 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

  1. Process a small amount ($1)
  2. Verify transaction in dashboard
  3. Confirm webhook received
  4. Test refund process
  5. Verify receipt delivery

Troubleshooting

Common Issues

IssueSolution
401 UnauthorizedCheck API key is correct and for right environment
Webhook not receivedVerify endpoint URL, check firewall
Card declinedUse test card numbers
CORS errorSDK 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:

  1. Check this documentation
  2. Review API response errors
  3. Contact developer support

GovPayPlan - Secure Payment Processing for Government Agencies