Download the PHP package joemuigai/laravel-mpesa without Composer
On this page you can find all versions of the php package joemuigai/laravel-mpesa. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download joemuigai/laravel-mpesa
More information about joemuigai/laravel-mpesa
Files in joemuigai/laravel-mpesa
Package laravel-mpesa
Short Description A Laravel Mpesa integration package
License MIT
Homepage https://github.com/joemuigai/laravel-mpesa
Informations about the package laravel-mpesa
Laravel M-Pesa
A comprehensive, production-ready Laravel package for integrating with Safaricom's M-Pesa Daraja API. Built for both single-merchant applications and multi-tenant SaaS platforms.
Table of Contents
- Features
- Requirements
- Installation
- Configuration
- Usage
- Multi-Tenant Usage
- Production Checklist
- Testing
- Contributing
- License
Features
โจ Complete API Coverage - 11 M-Pesa APIs supported
๐ข Multi-Tenant Ready - Database-driven account management
๐ช Production Optimized - HTTP retries, caching, and failsafe mechanisms
๐ฏ Flexible - Paybill & Till Number (Buy Goods) support
๐ง Developer Friendly - Interactive installation, IDE autocomplete
๐งช Well Tested - Comprehensive test suite
๐ Type Safe - Full PHPDoc annotations
๐ View Full Features Guide for detailed capabilities.
Requirements
- PHP 8.4+
- Laravel 11.0+ or 12.0+
Installation
Install via Composer:
Run the interactive installation command to set up configuration and migrations:
The wizard will guide you through:
- Scenario Selection (Single vs Multi-tenant)
- API Selection (STK, C2B, B2C, etc.)
- Environment Setup
Configuration
Environment Variables
After installation, add your credentials to .env:
See config/mpesa.php for all available options.
Usage
For detailed code examples, payloads, and callback handling, please refer to the USAGE.md file.
Quick Example: STK Push
Supported APIs
- STK Push (Lipa Na M-Pesa Online)
- STK Push Query
- C2B (Customer to Business)
- B2C (Business to Customer)
- B2B (Business to Business)
- Transaction Status
- Account Balance
- Reversal
- Dynamic QR Code
- Pull Transaction
Multi-Tenant Usage
For SaaS platforms, you can switch accounts dynamically:
See the Multi-Tenant Guide for database setup and more examples.
Production Checklist
Before going live, ensure you have:
- [ ] Set
MPESA_ENVIRONMENT=productionin.env - [ ] Updated
MPESA_CONSUMER_KEYandMPESA_CONSUMER_SECRETwith production credentials - [ ] Enabled SSL verification (
MPESA_HTTP_VERIFY=true) - [ ] Configured HTTPS callback URLs (M-Pesa requires valid SSL)
- [ ] Set up logging to monitor
laravel-mpesachannel or default logs - [ ] Implemented
try-catchblocks around all API calls - [ ] Configured queue workers if processing callbacks asynchronously
Testing
Run the package test suite:
Contributing
Contributions are welcome! Please see CONTRIBUTING for details.
Security
If you discover a security vulnerability, please email [email protected].
Credits
- Joemuigai
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Support
- Issues: GitHub Issues
- Email: [email protected]
Made with โค๏ธ in Kenya ๐ฐ๐ช
All versions of laravel-mpesa with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.0