Skip to main content

MockGateway vs Real Payment Sandboxes

Use MockGateway when tests need to be fast, deterministic, and easy to run before credentials exist. Use the real provider sandbox when you need final proof that the provider account and production-shaped settings work.

Which one should you use?

A mock payment gateway and a real provider sandbox answer different questions. MockGateway is for repeatable application testing: does your code handle success, decline, timeout, redirect, webhook delivery results correctly? A provider sandbox is for provider validation: do your real credentials, account settings, and provider-specific flows work before launch?

Decision table

MockGateway compared with real payment provider sandboxes
QuestionMockGatewayReal provider sandbox
Setup timeUnder a minute for a hosted mock endpointAccount, app, credentials, dashboard setup, and provider-specific configuration
CredentialsNone for the demo flow; saved gateways use MockGateway keysProvider sandbox keys and account access required
Failure injectionSelect built-in outcomes and inspect webhook delivery resultsLimited to the provider scenarios and test values that exist
Webhook deliveryOne webhook delivery per test eventDepends on the provider dashboard and webhook tooling
CI suitabilityDeterministic and stable across runsUseful for scheduled checks, but can be flaky or rate-limited
CostFree tier for routine testingUsually free, but setup and maintenance cost engineering time

When MockGateway is the better first step

  • You need a payment endpoint before credentials exist.
  • You want automated tests where the same request returns the same response every time.
  • You need to practice rare paths such as timeouts, duplicate webhooks, and failed delivery.

When the real sandbox is the right answer

  • You are validating provider credentials, dashboard settings, or account capabilities.
  • You need to confirm a provider-specific behavior that MockGateway intentionally simulates but does not certify.
  • You are doing the final pre-launch pass before live payment traffic.

Start with the layer that answers today's question

Most teams should use both. Keep MockGateway in local development and CI so payment logic is exercised on every change. Then run a smaller, deliberate pass against the provider sandbox before launch, where the goal is provider validation rather than broad failure coverage.