MicroPay-Payment is the heart of MicroPay’s transaction flow ecosystem — a distributed, event-driven Wallet Application.
It manages and coordinates all payment-related transactions through Saga Orchestration and asynchronous communication between multiple microservices.
MicroPay consists of six independent microservices:
| Service | Description |
|---|---|
| Gateway | Central API gateway for routing and load balancing |
| Security | Handles authentication and authorization |
| Payment | Orchestrates the payment lifecycle |
| Wallet | Maintains wallet balance and reservations |
| Transaction | Records and tracks transaction states |
| Notification | Sends notifications to users |
Four services — Payment, Wallet, Transaction, and Notification — communicate asynchronously via RabbitMQ.
The Payment Service acts as the central coordinator for all transaction workflows.
It:
- Initiates, validates, and processes payment requests.
- Implements Saga orchestration to ensure distributed consistency.
- Coordinates asynchronous events across other microservices.
- Handles failure recovery and compensation logic.
| Endpoint | Method | Description |
|---|---|---|
/transfer |
POST |
Wallet → Wallet transaction |
/top-up |
POST |
External Provider → Wallet transaction |
/withdraw |
POST |
Wallet → External Provider transaction |
To ensure scalability and extensibility, the Payment Service uses the Strategy Pattern for payment processing.
- Three core processor services:
TopUpProcessorServiceTransferProcessorServiceWithdrawalProcessorService
Two of them (TopUpProcessorService, WithdrawalProcessorService) use a strategy registry:
Map<PaymentKey, PaymentProcessor> registry;This allows automatic processor selection based on payment source and destination type. New payment types can be added by simply registering a new processor — no changes to existing code.
- Payment Service initiates the transaction cycle.
- Coordinates processing and validation events.
- Updates wallet and transaction states asynchronously.
- Sends success/failure notifications at completion.
All MicroPay services are:
- Built with Gradle
- Containerized using Docker
- Deployed and tested in Google Cloud Platform (GCP)
- Designed for Kubernetes orchestration
- Java 21
- Spring Boot
- RabbitMQ
- PostgreSQL
- Redis
- Docker & Kubernetes
- Gradle
- JUnit & Mockito
- Prometheus & Grafana(later)
Omar Ismailov
Software Engineer • Backend & System Design Enthusiast
Building reliable systems with simplicity and architecture in mind.