Spring Boot reference architecture for Mobile Money / Stripe / FlutterWave / Cyclos integration — Africa-grade fintech backend patterns
# fintech-mobile-money-spring
> Reference architecture and starter code for a **Spring Boot** payments backend that integrates **Mobile Money (MTN, Orange)**, **Stripe**, **FlutterWave**, **Cyclos 4** and **USSD/SMS** fallback channels — with the operational realities of CEMAC / West Africa baked in.
This is the public, architecture-and-patterns companion of fintech work I've delivered for clients across Cameroon, Nigeria, and broader CEMAC. Client code remains under NDA. Here you'll find the patterns that survive in production.
---
## Why this exists
Most Spring Boot fintech tutorials assume:
- A single payment provider (usually Stripe)
- A stable internet connection
- A client who already has a bank account and a smartphone with a recent OS
None of these assumptions hold across CEMAC and West Africa. Real production fintech here means:
- Multiple Mobile Money providers per country, each with their own API quirks
- USSD / SMS as **primary** channels, not fallback
- Idempotency that survives 3G/GPRS network flapping
- Reconciliation against statements that arrive by email PDF, not API
- Compliance with **BEAC / COBAC** (CEMAC central bank) and OHADA rules
This repository captures the patterns that work.
---
## Reference architecture
\`\`\`
┌─────────────┐ ┌─────────────┐
│ Web / Apps │ │ USSD gateway │
└─────┬──────┘ └────┬───────┘
│ │
┌──────┴───────────────────────┐
│ Spring Boot · REST API │
│ - PaymentOrchestrator │
│ - IdempotencyService │
│ - ReconciliationService │
└─┬──────┬────────┬──────┬───────┘
│ │ │ │
MTN MoMo Orange Stripe FlutterWave
API Money API API
│ │ │ │
└─────┴──────┴──────┴─────┘
PostgreSQL + Outbox
\`\`\`
## Stack
- **Java 21**, **Spring Boot 3.x**
- **PostgreSQL** with **transactional outbox** pattern
- **Resilience4j** for retries, circuit breakers, bulkheads
- **MapStruct** for DTO mapping, **Lombok** fo …