Integrating telebirr and CBE Birr: A Fault-Tolerant Checkout Flow in Node.js
Idempotent payment intents, webhook verification, and reconciliation jobs — the patterns that keep mobile-money checkout honest when the network is not.
Mobile-money integrations fail in predictable ways: duplicate callbacks, timeouts that hide successful charges, and users who tap "pay" three times when nothing appears to happen. The fix is architectural, not cosmetic.
Begin with idempotent payment intents. Every checkout attempt creates one server-side intent with a unique key; the provider callback, the retry, and the user's double-tap all resolve to that same record. Charging twice becomes structurally impossible.
Next, verify every webhook signature and treat the provider's status as advisory until your own reconciliation job confirms it. A pending state is a first-class state — display it honestly rather than optimistically flipping orders to "paid".
Finally, schedule the reconciliation sweep: compare your intent ledger against provider statements on a fixed cadence, alert on drift, and settle discrepancies before the next business day opens. Reliability users can feel is reliability they return for.
Implementation templates, calculators, and detailed walk-throughs covering this strategy are available in the corresponding DCM 11 curriculum module.
