openpesa / laravel-pesa
Easy OpenAPI integration for Laravel Apps
Fund package maintenance!
alphaolomi
Requires
- php: ^7.4|^8.0
- illuminate/contracts: ^7.0|^8.0|^9.0
- openpesa/pesa: ^0.1.0
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^5.0|^6.23|^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
README
Offers effortless integration with mobile money operators, such as Vodacom's M-Pesa, for seamless inclusion in your Laravel applications. 💰
View Demo · Report Bug · Request Feature
Documentation
🚧 Work in Progress
For detailed instructions on package usage, please refer to the example readme available here.
🚀 Installation
You can install the package via Composer:
composer require openpesa/laravel-pesa
💼 Usage
Using Facades
use Openpesa\Pesa\Facades\Pesa; // This route will be mapped to: `your-URL/api/charge` Route::get('/charge', function () { $response = Pesa::c2b([ 'input_Amount' => 5000, // Amount to be charged 'input_Country' => 'TZN', 'input_Currency' => 'TZS', 'input_CustomerMSISDN' => '000000000001', // Replace with your phone number 'input_ServiceProviderCode' => '000001', // Replace with your service provider code given by M-Pesa 'input_ThirdPartyConversationID' => 'mpesatz', // Unique 'input_TransactionReference' => 'imethibitishwa', // Unique 'input_PurchasedItemsDesc' => 'Item description' }); return $response; });
💼 Usage
composer test
📜 Changelog
Please see CHANGELOG for more information on what has changed recently.
🤝 Contributing
Please see CONTRIBUTING for details.
🔐 Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
👥 Credits
📄 License
The MIT License (MIT). Please see License File for more information.