Case study

Payment gateway for a fintech platform

A high-load payment gateway on Laravel and Go: payment processing with guaranteed idempotency and 99.98% uptime.

Year
2025
Client
Fintech platform (B2B acquiring)
Role
Lead Backend Engineer
P

Description

The payment gateway is the core of the fintech platform through which all money operations pass: accepting payments, payouts, refunds and reconciliation with acquiring banks. I designed and implemented a system capable of processing thousands of transactions per second with strict requirements for correctness and fault tolerance. The product logic and provider integrations are implemented in Laravel, while the latency-critical layer of routing and callback handling is moved into a Go service. All monetary amounts are stored in integer minor units, every operation is idempotent thanks to idempotency keys, and consistency between the gateway and providers is ensured by the transactional outbox pattern and asynchronous reconciliation. Special attention is paid to security: tokenization of payment data, strict authorization of every action, auditing of all state changes and protection against reprocessing of callbacks. Redis-based queues process provider webhooks with guaranteed retries and protection against duplicates, and PostgreSQL serves as a reliable source of truth with a thought-out schema and indexes for analytical queries.

Task

The previous monolithic integration could not withstand peak loads, lost provider callbacks and allowed double charging of funds during network failures. Reconciliation with banks was done manually and took hours.

Solution

I extracted the payment domain into a separate service, introduced idempotency keys for every operation, implemented a transactional outbox for reliable event publishing, moved callback handling into queues with deduplication and automated reconciliation with acquirers.

Results

Uptime rose to 99.98%, double charges were eliminated entirely, automatic reconciliation time dropped from several hours to 4 minutes, and peak throughput increased fivefold without latency degradation.

Technologies