openpesa / laravel-pesa

Laravel Pesa
https://openpesa.github.io/
MIT License
20 stars 9 forks source link
hacktoberfest hacktoberfest-accepted laravel openpesa php

Laravel pesa

Latest Version on Packagist Total Downloads

Laravel pesa

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](https://github.com/alphaolomi/laravel-pesa-demo). ## πŸš€ Installation You can install the package via Composer: ```bash composer require openpesa/laravel-pesa ``` ## πŸ’Ό Usage ### Using Facades ```php 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 ```bash composer test ``` ## πŸ“œ Changelog Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently. ## 🀝 Contributing Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details. ## πŸ” Security Vulnerabilities Please review [our security policy](../../security/policy) on how to report security vulnerabilities. ## πŸ‘₯ Credits - [All Contributors](../../contributors) ## πŸ“„ License The MIT License (MIT). Please see [License File](LICENSE.md) for more information.