CarePay
CarePay is a Nigerian healthcare payment platform that enables patients to seamlessly pay for hospital services through dedicated virtual bank accounts, while giving hospitals real-time visibility and automated reconciliation of all collections powered by the Nomba payment infrastructure
Technologies Used
Python, FastAPI, Celery, Nomba, HashiCorp Vault, PostgreSQL

The Goal:
CarePay digitises healthcare payments in Nigeria, solving issues caused by fragmented, cash-based systems. It provides patients with virtual bank accounts (powered by Nomba) for easy, transfer-based payments, eliminating cash and manual receipts. Hospitals benefit from automated, real-time payment detection, invoice matching, and reconciliation, streamlining financial tracking and reducing manual bookkeeping. In essence, CarePay links patient payments directly to their medical records, automating the entire billing process for efficiency and transparency.
On the hospital side, when a patient transfers money, CarePay automatically detects the payment via webhooks, matches it to the correct invoice, updates the balance in real time, and flags any discrepancies through a nightly reconciliation engine — eliminating manual bookkeeping.
In plain terms — a hospital registers on CarePay, their patients get a bank account number linked to their medical record, and every transfer automatically pays the right bill without a human touching it.
1
The Challenge:
The most significant engineering challenges in building CarePay were setting up HashiCorp Vault on a production server, configuring
AppRole authentication, Vault Agent as a systemd service, and dynamic secret templates that auto-render environment variables to disk,
which proved far more operationally complex than anticipated. Architecting the hospital credential management system also required
careful design decisions around what lives in Vault versus Redis versus Postgres, ensuring sensitive Nomba API keys never touched the
database while keeping token refresh fast enough for real-time use.
Finally, designing the dual-ledger reconciliation engine — continuously cross-referencing CarePay's internal transaction records against
Nomba's own history, handling discrepancies, and auto-resolving stale payments — required building a fault-tolerant background
pipeline that could operate reliably without human intervention.

2
The Result
My team and I successfully built the end-to-end application, from integrating Nomba into the backend for the creation of a virtual
account, payment processing, and patient records management, patient records export, admin insights and many more.
3







