I'm Altamis, a software engineer from Indonesia. I build payment systems, apps and Storave, and I'm curious about everything between code and people.
Jul 26, 2026 · 17 min read · on Medium
Which one?
Every team has lived this scene. The product is nearly ready, and someone types into the meeting chat: "Okay so… which payment gateway are we going with?" Two weeks of comparison spreadsheets follow.
The hunt for one flawless gateway is the mistake. The better question is not which one, but why we're picking at all.
The one-gateway trap
- 1 · Coverage · No single provider serves the office worker on a card, the student on GoPay and the warung on QRIS equally well. The customers you lose never complain, they close the tab.
- 2 · Their bad night · Providers go down at peak hour. With one integration there's no move to make, and partial failures don't even alert.
- 3 · Price · Every method has a different cheapest route. A rounding error at small volume, a large line item at scale.
- 4 · Cash · Settlement timing is a cashflow decision nobody framed as one.
- 5 · Growth · A new market puts you on your provider's roadmap, or into a migration that touches everything.
- 6 · Leverage · At renewal, both sides know what leaving costs you. So you absorb the new rate, every time.
So why not all of them?
Six providers sounds like six times the work, if you integrate them the usual way. The expensive part was never the HTTP calls. It's how status is modelled, how refunds behave, how webhooks are verified and made idempotent. Do that once, in your own vocabulary, and the second provider is an adapter. So is the sixth.
It doesn't mean ten providers on launch day. It means one behind the boundary on day one, a second the week you need it, and none of them ever load-bearing again.
A payment abstraction layer
- 1 · A contract · One interface every provider must satisfy: create, status, cancel, refund, webhook, plus the two reports finance depends on.
- 2 · A capability map · Each adapter declares the methods, currencies and banks it can actually serve. Nobody hardcodes routes in checkout.
- 3 · A router · Weighs method, cost, priority, geography and health. A circuit breaker takes a sick provider out of rotation, and an outage becomes a graph instead of a revenue hole.
- 4 · One webhook handler · Every callback is verified with its own scheme and normalised into one status model. Idempotency and retry are solved once.
Two worlds, one contract
An aggregator hands you an API key. A bank hands you a terminal ID, a channel ID and a certificate, and sometimes a file to download instead of an endpoint. Model the difference in configuration instead of fighting it: a factory picks the adapter from the shape of the config, and adding a provider becomes a new case, not a refactor.
Reconciliation is a trust problem
Every night, money that moved has to be proven, not assumed. Without the abstraction that means four portals, a downloaded bank file and a spreadsheet glued together by hand every morning.
With it, every adapter answers the same two questions in the same shape: what moved yesterday, and what will land in the bank. A 2 a.m. job asks them all, compares, and checks four things: is everything present, do the amounts agree, are the fees what we negotiated, did the cash arrive.
One screen instead of six
Finance opens one page, picks a date, and sees every provider in a row. Green means walk away. A mismatch arrives as a short brief for the person closing the books, with the next steps already written, and a seventh provider adds a row, not a spreadsheet.
The bottom line
There is no perfect payment gateway. Over a product's life you'll run several at once, and the set will keep changing, so design for that on day one. Your application shouldn't know or care who processed a payment. It should ask for one and get on with its life.