/laravel-pesa

Laravel Pesa

Primary LanguagePHPMIT LicenseMIT

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.

๐Ÿš€ 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.