Skip to content

Jengo Pesa (jengo/pesa) ​

A unified multi-gateway payment processing subsystem for CodeIgniter 4 and the Jengo Framework, featuring first-class support for Kenyan and African payment networks (M-Pesa Daraja 3.0, Pesapal v3, Flutterwave) alongside global providers (Stripe, PayPal).


Key Capabilities ​

  • M-Pesa Daraja 3.0 Engine:
    • STK Push (Lipa Na M-Pesa Online) with phone sanitization and password generation.
    • C2B (Customer to Business): URL registration and instant confirmation handling for Paybills and Till numbers (Buy Goods).
    • B2C (Business to Customer): Automated payouts, dividends, and salary disbursements with automated X509 certificate encryption.
    • Status & Balance Queries: Real-time polling and transaction resolution.
    • OAuth Token Caching: Automatic token reuse via CI4 Cache.
  • Multi-Gateway Drivers: Switch between mpesa, pesapal, stripe, and fake drivers seamlessly.
  • Transaction Ledger (pesa_transactions): Full lifecycle logging with state machine (pending → successful | failed | reversed) and idempotency protection against duplicate callbacks.
  • Zero-Boilerplate Webhooks: Pre-routed webhook controller (/pesa/webhook/{gateway}) with signature verification.
  • Lifecycle Events: Typed events (PaymentInitiated, PaymentSucceeded, PaymentFailed, PaymentReversed).
  • Spark CLI Tools: Nested variants (php spark jengo:pesa mpesa register-c2b).
  • Extensible Architecture: Add custom gateway drivers via Pesa::getManager()->extend().

Documentation Sections ​

  1. Installation & Setup
  2. Configuration
  3. Quick Start
  4. M-Pesa Daraja Workflows
  5. Hosted Checkouts (Pesapal & Stripe)
  6. Webhooks & Callbacks
  7. Events & Listeners
  8. Transaction Ledger & Entities
  9. Error Handling & Exceptions
  10. Service Locator & Dependency Injection
  11. Real-Time Payments & Polling
  12. Local Development & Tunneling
  13. CLI Commands
  14. Custom Gateways & Extensibility
  15. Testing with Fake Gateway
  16. Production & Go-Live Checklist

Released under the MIT License.