Payment Service - Multi-Provider Payment Integration
A centralized payment service that connects several client companies with different payment providers, for both cash-in and cash-out. The goal was to stop managing payments across scattered systems.
- Client
- PT Nusantara Sukses Teknologi
- Role
- Backend Golang Developer
- Duration
- 6 Months
- Team
- 3 Developers
- Completed
- March 2022
Each company has its own credentials at every provider, and payments used to be handled in different ways. One service had to accommodate all of that without getting in the way of each other, while still being able to add new providers such as Xfers, Xendit, or Nicepay.
Built an admin panel to map providers and companies, provided an Open API that each company uses for service-to-service calls, and set up a callback system so payment status is sent as soon as a transaction is done.
Project Overview
The application is built as a CMS with modules for managing companies, providers, and payment channels. Each company can choose which channels it uses, and admin access is set per role.
Through the Open API, companies under one parent can use this service even though they previously worked with different payment providers. All transactions are recorded and can be monitored from one place, so integration and status checks no longer have to be done separately in each system.
What I worked on
My focus was the layer that connects client companies with payment providers. Because each company has its own account and credentials at every provider, the service had to store and use different configurations without one getting in the way of another.
A few parts I handled:
- Mapping companies to providers. An admin picks which provider each company uses. From that data, the system knows which credentials to use when a payment request comes in.
- The Open API for client companies. Companies send cash in or cash out requests through a single door. The format is the same for everyone, so teams at each company do not have to learn a new way for every provider.
- Transaction status callbacks. When a provider finishes processing a transaction, the status is sent back to the system and passed on to the company involved. I made sure incoming statuses stayed matched to the right transaction.
- Transaction records. Every request and its result is stored, so when a company raises an issue, the trail can be traced from one place.
Things worth noting
A payment does not always succeed on the first attempt. Some transactions are pending, fail, and get retried. Those states have to be stored as they are, because forcing everything into just “success” or “failed” would take away the real picture from the company.
I also had to be careful about ordering. Sometimes a callback arrives more than once, or arrives after the company has already asked for the status through the API. The system was built so the final result stays the same even when events repeat or arrive in a different order.
The result
Companies that used to manage payments in their own systems could finally share one service. Adding a new provider only took a change in the admin panel, without altering how companies send requests. For me, this project taught a lot about handling data that comes from outside, which is not always tidy and not always on time.
Interested in a similar project?
Let's discuss how I can help bring your ideas to life.