Skip to main content

What MockGateway is

MockGateway gives you working payment gateway APIs without a merchant account, provider approval, or real money.

concept3 min readUpdated September 11, 2026

MockGateway gives you working payment gateway APIs without a merchant account, provider approval, or real money. You create a gateway, call it from your code, and choose what each payment does — approved, declined, still processing, or cancelled.

Nothing here touches a card network. Every payment lives in your account. It exists so your integration has something honest to talk to while you build it.

Why it exists

Payment work usually stalls before any code gets written. You need a merchant account. The account needs approval. Approval needs paperwork. Then the sandbox keys arrive and they belong to one person on the team.

Meanwhile the checkout screen, the order states, and the callback handler are all waiting. None of them need a real processor. They need something that answers like one.

How a payment runs

Each gateway you create has its own slug, API key, and endpoints. The flow matches the shape most redirect-style providers use:

  1. Your server posts an amount and currency to the gateway's init endpoint.
  2. The reply carries a payment identifier and a hosted payment URL.
  3. You send the customer to that URL.
  4. On the hosted page you pick the result yourself. There are no card fields to fill in.
  5. MockGateway sends a webhook to your server and redirects the browser back to you.
  6. Your server calls verify to confirm the final state.

Step four is the part that matters. A real sandbox decides the outcome for you. Here you decide, so a decline or a stuck payment takes one click instead of a support ticket.

Hosted payment page showing a test-mode banner, the amount due, a test card, and four status options: Payment Succeeded, Requires Action, Processing, and Canceled.
The hosted page replaces card entry with a list of results. Every gateway carries its own set.

What a gateway comes with

PieceWhat it does
SlugNames the gateway in its endpoint URLs
API keyAuthenticates your server calls. Starts with sk_test_
Request schemaSets which fields the gateway accepts and rejects
Response templatesShape the JSON that init and verify return
ScenariosThe results offered on the hosted page
WebhookWhere notifications go, signed with a whsec_ secret
Redirect URLWhere the browser lands afterwards

Start from one of fourteen templates shaped after providers such as Stripe, PayPal, Adyen, and Razorpay, or define the whole thing yourself.

What it does not do

  • No money moves. There is no settlement, no payout, no ledger.
  • Card numbers are never checked against a real network. The hosted page asks you to pick a result, not to pass a card check.
  • It is not a proxy. Requests never reach the provider a template is modelled on.
  • Templates copy the shape of a provider's API, not all of its behaviour.

That last point is worth holding on to. A mock covers the weeks before credentials arrive and the failure cases a sandbox makes awkward to reproduce. Run against the real sandbox before you launch.

Where to go next

The quickstart runs a full payment in about five minutes. If you would rather see the pieces first, start with creating a gateway from a template.

Was this page helpful?