Mock Payment Gatewaysfor Payment Integration Testing

Test your payment integration with realistic payment flows, checkout, webhooks, and failure scenarios without real gateway credentials or sandbox setup.

curl -X POST https://mockgateway.com/api/base/stripe-demo/v1/payment_intents \
-H "Authorization: Bearer sk_test_stripe_demo_public" \
-H "Content-Type: application/json" \
-d '{
"amount": 2500,
"currency": "USD",
"return_url": "https://mockgateway.com/payment/return" }'
→ returns "payment_url": "https://mockgateway.com/pg/pay/6f35d1b3…"

Templates modelled on these gateways (and more)

Why Developers Choose MockGateway?

Web developers often find that testing a payment integration against a gateway can be harder than it should be. Sandboxes can be slow or unreliable. Some failures are difficult to reproduce when you need them.

  • Hard-to-trigger failures: Declines and timeouts are not easy to reproduce.
  • Webhook setup: Testing often means setting up a tunnel.
  • Flaky CI tests: Sandbox behaviour can make tests unreliable.
  • Slow sandbox access: Getting access can take days.
  • Setup per gateway: Every provider has its own sandbox and test data.
  • Money at risk: One wrong live key can cause a real charge.
Test Payment Integrations Without the Sandbox
MockGateway gives you a simple way to test your payment integration before going live.
  • Trigger any scenario: Declines, timeouts, retries, and 3D Secure.
  • Test signed webhooks: Automatic retries when your endpoint fails.
  • Keep tests predictable: Same flow, same response, every run.
  • Start in 60 seconds: No need to wait for sandbox access.
  • 14 gateway templates: Test multiple gateways from one account.
  • No real money involved: No merchant account or live keys needed.

How MockGateway Works?

Pick a gateway template, send a payment request, choose the outcome on the checkout page, and receive the webhook. The whole round trip takes under a minute. Click any step to follow it.

POST /api/base/stripe-demo/v1/payment_intents
{
"amount": 2500,
"currency": "USD",
"return_url": "https://yourapp.dev/callback"
}

Same API path as production. Every gateway gets a simulated base URL (https://mockgateway.com/api/base/{slug}). The path after it is identical to the real provider's own API, e.g. Stripe's /v1/payment_intents. Point your app at it in sandbox, then swap only the base URL when you go live, with no code changes.

Webhooks on Localhost

A tunnel gives you a new URL every restart, and the webhook settings have to be updated again each time. This one never changes.

$ npm install -g mockgateway-cli

$ mockgateway listen --forward-to http://localhost:3000/webhook

✓ Connected to MockGateway

✓ Forwarding to http://localhost:3000/webhook

14:22:07  payment.success  → 200 OK   42ms

14:22:19  payment.failed   → 200 OK   31ms

14:22:31  refund.completed → 500      12ms

1

No account anywhere else. No tunnel to sign up for, no second dashboard.

2

Nothing is exposed. Your machine opens the connection outward, so the receiver is never reachable from the internet.

3

Signatures arrive intact. The same headers a real provider sends, so your verification code is what gets tested.

4

Skip the checkout. mockgateway trigger sends one webhook without running a payment first.

Install the CLI
npm install -g mockgateway-cli
Read the localhost webhook guide

Built-In Test Scenarios for Every Edge Case

The outcomes your real gateway will eventually return are preconfigured, deterministic, one click away.

Success
Failed / Declined
Cancelled
Timeout
Retry / Pending
3D Secure / SCA
Custom HTTP Errors
Redirect Chains
Webhook Variants

Start Testing Payments in Minutes

Create a mock payment gateway with a real API endpoint, hosted checkout page, and webhook delivery with no credentials required.

MockGateway is in active development and improving fast.

Free forever: 500 test payment requests per month. See pricing·Read the FAQ