Backend
Full-Stack
Payment Systems
API Development
hSenid Mobile Solutions

Rincewind Payment Gateway Aggregator

A comprehensive payment aggregator middleware that simplifies payment gateway integration for external applications, enabling seamless multi-bank IPG connectivity with unified API interfaces.

80%
Integration Time Reduction
6+
Supported Payment Providers
Real-time
Transaction Processing
6 currencies
Multi-Currency Support

The Problem

Merchants faced significant complexity integrating multiple payment gateways (IPGs) from different banks, requiring separate implementations, configurations, and maintenance for each provider.

The Solution

Developed a unified payment aggregator middleware that abstracts all IPG complexities, providing a single API interface for merchants to integrate with multiple payment providers seamlessly.

Project Impact

Enabled merchants to integrate with multiple payment gateways through a single unified interface, reducing integration time by 80% and eliminating the need for merchant-specific IPG implementations.

Rincewind Payment Gateway Aggregator

TL;DR: Built a comprehensive payment aggregator middleware that unified multiple bank payment gateway integrations, reducing merchant integration complexity by 80% and enabling seamless multi-currency, multi-provider payment processing through a single API interface.

The Challenge

The payment gateway landscape in the region involved multiple independent payment providers (IPGs) from different banks, each with unique APIs, authentication mechanisms, response formats, and integration requirements. Merchants wanting to offer multiple payment options faced significant challenges:

Pain Points:

  • Complex Integration Requirements: Each bank IPG required separate implementation, authentication, and configuration management
  • Inconsistent API Patterns: Different providers used varying request/response formats, making unified handling difficult
  • Maintenance Overhead: Updates to individual IPG integrations required merchant-side changes across multiple systems
  • Limited Flexibility: Merchants were locked into specific provider implementations, making it difficult to switch or add new providers
  • Multi-Currency Complexity: Different providers supported different currencies with varying configuration requirements
  • Response Handling Variations: Each IPG had unique callback mechanisms and response validation requirements

Business Impact: These challenges created barriers for merchants wanting to expand payment options, increased development and maintenance costs, and limited the ability to quickly adapt to market needs or provider changes.

The Solution

Architecture Design

Architectural Decisions

  1. Connector Pattern Implementation: Adopted a strategy pattern with provider-specific connectors to abstract IPG differences, enabling easy addition of new providers without modifying core payment logic.

  2. Layered Architecture: Separated concerns into API (REST endpoints), Web (UI routing), Core (domain models), and Connector layers, ensuring maintainability and testability.

  3. Configuration Caching: Implemented in-memory caching for merchant and provider configurations to reduce database queries and improve response times for high-volume transactions.

  4. Unified Response Model: Created standardized response models that abstract provider-specific differences, allowing merchants to handle all providers uniformly.

  5. Asynchronous Callback Handling: Designed callback endpoints that can handle provider-specific response formats while normalizing them into a common transaction status model.

Key Contributions & Problem Solutions

Feature Development

The Problem: Lack of flexible configuration and multi-currency support limited market expansion.

  • Multi-Currency Engine: Configurable framework supporting per-provider/merchant currency settings.
    • Result: Enabled processing in 6+ currencies (LKR, USD, EUR, etc.), expanding market reach.
  • Unified Payment Interface: Single API abstractions for multiple disparate bank IPGs.
    • Result: Merchants integrate once to access all providers, cutting integration effort by 80%.
  • Feature Toggles: Database-driven configuration to enable/disable features per merchant.
    • Result: rapid customization without code changes or deployments.
  • Provider Onboarding: Templatized integration patterns for adding new gateways.
    • Result: Reduced new provider onboarding time from weeks to days.

Tech Stack

Java
Kotlin
Spring Boot
MySQL
Keycloak
Gradle
REST API
Microservices
JOOQ
c3p0
Apache HTTP
Docker

Impact & Results

Integration Time
Weeks → Days
Config Flexibility
100%
Ambiguous Txns
~0%
Supported Currencies
6+
Provider Onboarding
80% Faster
Security Breaches
Zero

Business Impact

  • Market Expansion: Multi-currency support (6+) allowed merchants to enter international markets instantly.
  • Operational Efficiency: Standardized integrations reduced merchant onboarding time from weeks to just days.
  • Revenue Growth: High reliability and diverse payment options directly increased transaction completion rates.

Technical Efficiency

  • Scalability: Plug-and-play connector architecture reduced new provider development effort by 80%.
  • Performance: Configuration caching and optimized schema supported high-volume transaction processing with minimal latency.
  • Maintainability: Clean separation of concerns (Layered Architecture) significantly reduced code complexity and regression risks.

Operational Excellence

  • Reliability: Dual-verification (Callback + Status Query) eliminated transaction ambiguity, ensuring financial accuracy.
  • Observability: Comprehensive state tracking and checkpoint logging reduced troubleshooting time for payment issues.

Key Learnings

  1. Abstraction is Key: Creating proper abstraction layers for payment providers enabled the platform to handle provider differences transparently, making the system more maintainable and extensible.

  2. Configuration Flexibility: Building flexible configuration systems that allow per-merchant customization without code changes proved essential for serving diverse merchant needs.

  3. Reliability Through Redundancy: Implementing status query mechanisms as a fallback for callback-based systems improved overall transaction reliability and user experience.

  4. Domain-Driven Design: Using clear domain models and repository patterns made the codebase more understandable and easier to extend with new features.

  5. Security First: Implementing proper request signing and validation from the start prevented security issues and ensured compliance with payment industry standards.

My Role

Software Engineer

hSenid Mobile Solutions

Technologies Used

Java
Kotlin
Spring Boot
MySQL
Keycloak
Gradle
REST API
Microservices

Interested in this project?

Want to learn more about the technical architecture or discuss similar challenges?