
Looking for a free payment gateway for testing usually means one thing: you don't want a billing surprise. That's fair. But the part of payment testing that actually costs the most isn't on any invoice — it's the hours spent before a single test runs.
Where the time goes before you write a test
Setting up a real provider sandbox from scratch goes like this: create an account, confirm the email, fill in business name and country, wait for activation, generate API keys, open the dashboard and register a webhook endpoint, copy credentials into your local environment and your CI secrets, then hunt through documentation for the test card numbers that trigger specific decline codes. That's before you've written a line of test code.
None of those steps are hard. Together, they reliably take two to three hours per provider. If you're evaluating multiple gateways, you do this more than once.
What a real payment test actually needs
A mocked HTTP response in a test file tells you that your code constructs the right request. It doesn't tell you whether the full flow works — checkout redirect, server-side verification, webhook delivery. To test that properly, you need a real endpoint to send requests to, a checkout page to exercise the redirect, and a verify endpoint that returns what the actual gateway returns.
You also need to trigger specific outcomes without looking up test card numbers. Selecting "decline" from a simulated checkout and watching your handler respond is a faster, more reliable way to test that path than finding the right 16-digit number in a docs page.
Why CI is where this breaks down most visibly
Payment tests tied to a real provider sandbox are a liability in automated pipelines. Sandboxes go down. They rate-limit. They occasionally return responses in slightly different shapes depending on the day. When a CI payment test fails, the team spends ten minutes deciding whether the code broke or the sandbox did. Then someone marks the test as non-blocking. Then it stops mattering, and eventually stops running.
A mock gateway running on your own infrastructure doesn't have those problems. It answers every time, returns exactly what you configured, and doesn't need anyone managing separate credentials in the CI environment.
MockGateway's playground is free with no account required. There's also a self-hosted option if you need it inside your own pipeline.
Tagged with
Found this helpful?
Share it with your network.


