Troubleshooting

Common issues and solutions

Authentication Errors (401)

Problem: Receiving "Unauthorized" or "Invalid API key" errors

Solutions:

  • Verify you're using the correct API key format: sandbox_sk_test_...
  • Check that the Authorization header is properly formatted: Bearer YOUR_API_KEY
  • Ensure your API key hasn't been revoked or regenerated
  • Verify you're using the Server Key, not the Client Key for API calls

Webhook Not Received

Problem: Webhooks are not being delivered to your endpoint

Solutions:

  • Verify your webhook URL is publicly accessible (not localhost)
  • Check that your endpoint accepts POST requests
  • Ensure your server responds with 200 OK status
  • For local development, use ngrok or similar tunneling tools
  • Check webhook logs in your dashboard

Payment Not Processing

Problem: Payment stuck in pending status

Solutions:

  • Use the simulation tools to complete test payments
  • Check transaction expiry time (default 24 hours)
  • Verify the payment URL is accessible
  • Check if the transaction was cancelled

Invalid Request (400)

Problem: Receiving "Bad Request" or validation errors

Solutions:

  • Check the request payload matches the API documentation
  • Ensure all required fields are included
  • Verify data types (amount should be integer, not string)
  • Check for special characters in customer data
  • Review the error message for specific field errors

Rate Limit Exceeded (429)

Problem: Too many requests error

Solutions:

  • Implement exponential backoff in your retry logic
  • Reduce the frequency of API calls
  • Use webhooks instead of polling for status updates
  • Contact support if you need higher rate limits

3D Secure Issues

Problem: 3D Secure authentication not working

Solutions:

  • Use test card 4111111111110000 for 3DS testing
  • Use OTP: 112233 for test 3DS authentication
  • Ensure redirect URLs are properly configured
  • Check that your callback URL is accessible

Still having issues? Contact our support team at support@mockpay.test or submit a support ticket.