PropSpaceX Payment Service
Multi-provider payment processing — Stripe, Paystack, and Flutterwave behind one NestJS API, with idempotent webhook handling and automated reconciliation.
System Architecture
The provider router abstracts Stripe, Paystack, and Flutterwave behind one API. Confirmations come back asynchronously as signed webhooks, are processed idempotently, and settled events fan out through RabbitMQ. Daily reconciliation matches internal records against provider statements.
Database Design
Provider-agnostic transaction log — webhook events and refunds hang off the transaction; reconciliation runs track daily matching per provider.
Engineering Challenges
Provider abstraction
One payment API hides the differences between Stripe, Paystack, and Flutterwave request/response models.
Webhook reliability
Signature verification, idempotency keys, and replay protection make confirmations safe to process more than once.
Reconciliation
A daily job matches internal transaction records against provider statements and flags mismatches.
Money correctness
Decimal128 amounts and explicit currency handling avoid floating-point drift in financial records.