That last sentence is the whole decision. This page follows one payment through code you would own, then lists what lands on your desk afterwards.
What payment gateway source code does to a payment
A gateway is a chain of decisions made for every payment. Source code lets you read and change each link.
1. Accept the request
The code receives the payment from a merchant's site or app and checks it. It then writes a record that every later step will update. If your merchants need a different field or a different screen, this is where you add it yourself.
2. Choose the acquirer
The routing layer matches the payment against your rules and picks a provider. With source code, you can change how that choice is made, for example by adding a rule type that no vendor offers. That freedom is why people buy code.
3. Talk to the provider through a connector
A connector translates your internal request into one provider's API. The integrated connectors that come with the code save the first round of this work. Every provider you add later, and every API change a provider makes, is work for your developers.
4. Handle the answer
Each result needs its own path, whether it is an approval, a decline or a timeout. Cascading to a backup acquirer, retrying and failing over during an outage are behaviors you check in the code you buy, and any gap becomes yours to close.
5. Report and reconcile
The outcome updates the payment record. Reports and settlements read from it later, which is why a mistake in step 1 shows up here as a number nobody can explain.
What you set, and what you now own
Owning the code moves items from the vendor's side of the table to yours. The table lists the main ones.
| Item | Rented platform | Source code you own |
|---|---|---|
| New feature | Vendor decides and ships | You build it, or you don't |
| Provider API change | Vendor updates the connector | Your developers update it |
| Security patch | Vendor releases it | You find the issue and release it |
| PCI DSS scope | Depends on the vendor's certification | Your environment, which you certify |
| Design | Branded within the vendor's limits | Anything you can build |
| Exit | Move to another vendor | You keep the code and move your own hosting and data |
The PCI DSS row deserves a second look. On your own infrastructure you certify your environment, and a vendor can support the audit but cannot do it for you. Budget the audit as part of operating the code, not as an afterthought.
When a payment goes wrong
With bought code, the failure handling is whatever the code already does, plus whatever you add. Check before you buy how it behaves on a timeout, on a provider outage and on a status code a provider sends by mistake. Ask for a demonstration with a connector switched off, not a slide.
After go-live a failing provider becomes your incident, and nobody ships you a fix on a schedule, so you need someone on call who can read the code, reproduce the failure and release a change. A team without that engineer is better served by a white label platform with monthly updates than by a codebase.
Open source or licensed code
The open source question comes up in almost every query behind this page. Before you pick any open source payment gateway, find out whether it is a full gateway or a plugin that wraps other gateways' libraries. A plugin gives you checkout buttons and no switching core. Each project also comes with a license, and you should read its terms before you build a business on it.
If you run a payment system for others, also check who patches the code, how fast, and who answers when a regulator or an acquirer asks about a vulnerability. Downloading unknown payment code from a public repository and pointing live cards at it isn't a plan.
Licensed code from a vendor trades some freedom for accountability, because there's a company you can ask. A rented platform goes further and moves the maintenance to the vendor. Our gateway development page lays out how the three paths compare.