Paydable
A unified payment orchestration engine that abstracts fragmented Tanzanian mobile money and global card gateways into a single, reliable API.

About The Project
Originally engineered as an in-house tool to handle payment integration for our own projects, we quickly realized the broader need for a unified payment system. Businesses operating in Tanzania face a highly fragmented payment landscape, juggling complex integrations for various mobile money networks and traditional card processors. We evolved Paydable into a standalone orchestration layer that allows any business to write one integration to handle everything from USSD mobile push timeouts to delayed webhooks.
Projects Challenge
Mobile money gateways are notoriously unreliable. Networks often drop connections, push duplicate webhook callbacks, or suffer from long delays. If a system doesn't handle these edge cases perfectly, customers get charged twice or merchants lose money. The primary challenge was building an infrastructure that strictly prevents these race conditions under heavy concurrent load while keeping merchant data secure.

Key Features
Paydable is designed strictly as Enterprise Infrastructure, focusing on high concurrency, fault tolerance, and developer experience.
Universal Gateway Adapter: A single API endpoint that dynamically routes transactions to either Stripe or local providers like AzamPay based on the payload, ensuring the merchant only integrates one unified SDK.
Automated Subscription Daemon: A continuous background worker service that manages recurring billing cycles. It automatically pulls active subscriptions and executes charging cycles without human intervention.
Resilient Webhook Delivery: When a payment clears, Paydable guarantees the merchant's server is notified. It utilizes a queue paired with an exponential backoff algorithm to automatically retry delivery if the merchant's server is temporarily down.
Engineering Architecture
To guarantee zero double-spending and strict security, Paydable relies on advanced database locking and envelope encryption.
Concurrency Protection (Advisory Locks):
We implemented PostgreSQL session-scoped advisory locks to prevent race conditions. If a payment provider accidentally fires two success callbacks at the exact same millisecond, the database creates an atomic lock based on a hash of the transaction ID to ensure the user is only credited once.
Military-Grade Cryptography:
Merchant API keys are never stored in plain text. We built an AES-256-GCM envelope encryption vault that protects all gateway credentials with unique initialization vectors. Even if the database is compromised, the API keys remain cryptographically secure.
Real-Time Telemetry Stream:
Instead of forcing clients to continuously poll the server to check if a mobile USSD payment was approved, we established Server-Sent Events (SSE). Once a transaction completes, the Fastify backend instantly pushes the update to the user's browser.
View other projects
Explore more of our recent work and discover how we help ambitious brands transform their digital presence.


