Owning the code moves work to your side of the table. You decide what to build, but after the purchase maintenance, upgrades, support and updates are yours too. This page looks at that trade from the integration seat, and it also answers the many questions people ask about open source gateways.
01Payment gateway source code: where it sits in the layer
Once the code runs on your servers, it's your gateway, and it sits between your merchants and your providers just as a hosted one would. The table follows one sample payment (sample data, not a specification).
| Your side sends | The code does | The provider receives |
|---|---|---|
| A merchant's checkout calls your gateway's API | Validates the request and picks a route using your configuration | A request in the connector's format |
| The customer enters details on your payment page | Handles the page, the entry and the redirects | The details the provider needs |
| Nothing, the provider answers | Turns the answer into your gateway's own status | Nothing further |
| Your team ships a change | The change is yours to test and deploy | Nothing changes for the provider |
The last row is the real difference from a hosted product. Every change in your gateway travels through your own release process.
02What it replaces
A team that wants to own a gateway has three paths: write it from scratch, assemble it from open source parts, or buy code that already works. The third replaces the first two.
Writing the provider integrations yourself
Each acquirer needs its own integration, and each one takes documentation, credentials, testing and upkeep that somebody on your team has to own for as long as the connection stays live. Code that ships with multiple connectors already integrated starts you ahead of that list. It doesn't remove the work for a provider that isn't in it, so check the connector list against your acquirers before you sign.
Assembling open source parts
An open source payment library usually wraps provider calls inside your own application. It isn't a gateway with an admin panel, merchant tools and reports.
Ask four things of any repository: who maintains it, when it was last updated, how it is licensed and who reviewed its handling of card data. Downloading payment code from an unknown repository is a security risk, so read before you run.
Renting someone else's roadmap
With a hosted gateway, upgrades and prices follow the vendor's decisions. With the code you control the changes: you can add a feature, adjust a screen or fix a small annoyance without waiting. A buyer should weigh that against the cost of staffing it.
03Moving it over
01 First, decide who will own the code
You need developers who will read, change and release it, and someone on call. Name them before you buy. The work they take on is the real cost of the choice.
02 Then, check the connectors against your providers
List your acquirers and payment methods. Compare the list with the connectors that ship with the code, and note any that need a custom integration. We build custom integrations on request, though what applies to code buyers is worth confirming in your first conversation.
03 Then, stand it up in a test environment
Deploy the code somewhere you control and run your own test cases, from approvals and declines to refunds. Keep the environment separate from production, because your tests will break things.
04 Finally, move merchants in stages
Route a small group of merchants through your gateway while the rest stay on their current route. Widen the group as settlements reconcile correctly. For the migration of stored cards, see the portable vault page.
04Data on the way through
Because the code runs in your environment, card data, logs and merchant records sit on infrastructure you chose. That gives you control, and it makes you responsible. If your environment stores or handles card data, the PCI DSS work for that environment is yours. Ask what documentation the seller supplies for your assessor, and see how scope is decided.
Backups, encryption keys, access reviews and log retention are your team's tasks. Plan them as part of the project, not as an afterthought.
05Questions for your engineers
- Who will maintain the code after purchase, and who is the backup?
- Which connectors ship with it, and which of your providers are missing?
- Where will you host it, and who certifies that environment?
- How will you test an upgrade before it reaches production?
- What is your plan if a provider changes its API?
- Who reviews changes that touch card data?
- How will you get support when something breaks at night?
If you can't name a person for each, a hosted option may suit you better, and the self-hosted layer is the middle path.
06FAQ
Can I build a secure gateway with open source software only?
It's possible in principle, but you take on the security review, the provider integrations, the upkeep and the PCI DSS work yourself. The integrations and the upkeep are the parts that keep costing after the first release.
Is there an open source payment gateway that is more than a library?
A few projects exist, and their quality varies. Check the maintainers, the update history, the license and how card data is handled before you rely on one. Code you buy comes with a seller you can put questions to.
Which companies sell a gateway where the client owns the source code?
We do. The gateway source code comes with multiple payment connectors already integrated, and after purchase maintenance, upgrades, support and updates are the buyer's.
Is it safe to download gateway files from a public repository?
Not without review. Check who published it, read the code that touches card data, scan the dependencies and run it in an isolated environment first. A public repository carries no promise of support or security fixes.