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, andfakedrivers 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
- Installation & Setup
- Configuration
- Quick Start
- M-Pesa Daraja Workflows
- Hosted Checkouts (Pesapal & Stripe)
- Webhooks & Callbacks
- Events & Listeners
- Transaction Ledger & Entities
- Error Handling & Exceptions
- Service Locator & Dependency Injection
- Real-Time Payments & Polling
- Local Development & Tunneling
- CLI Commands
- Custom Gateways & Extensibility
- Testing with Fake Gateway
- Production & Go-Live Checklist
