Download the PHP package calvinchiulele/mpesa-mz without Composer
On this page you can find all versions of the php package calvinchiulele/mpesa-mz. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download calvinchiulele/mpesa-mz
More information about calvinchiulele/mpesa-mz
Files in calvinchiulele/mpesa-mz
Package mpesa-mz
Short Description Unofficial Laravel package for Vodacom Mozambique M-Pesa
License MIT
Informations about the package mpesa-mz
Laravel Package for Vodacom Mozambique M-Pesa
This package is a wrapper for abdulmueid/mpesa-php-api to integrate M-Pesa API easier in Laravel applications
For more information of what M-Pesa is, please refer to M-Pesa official website: https://www.vm.co.mz/en/M-Pesa2
For more information of what abdulmueid/mpesa-php-api is, refer to https://github.com/abdulmueid/mpesa-php-api
1. Installation
All you have to do is the following:
After hitting the above command in terminal, you will be provided a list of all service providers registered
in your application. Choose the CalvinChiulele\MPesaMz\Providers\MPesaMzServiceProvider
and hit enter.
Now if you check your config folder, you'll find your mpesa-config.php file in there.
2. Configuration
After you have published the config files necessary for the package, you've to add all the keys necessary for the config file in your .env in order to the config file work properly.
The .env should be like that:
Where xxx is your data. Note: You've to either use MPESA_API_HOST to reflect to "api.sandbox.vm.co.mz" or production URL from M-Pesa API
And the newly file created config/mpesa-config.php
will be like that:
Note : After adding the entries in the .env file, you've to run in your terminal in order to remove the configuration cached file and have the just added values in .env
available to be used in config/mpesa-config.php
3. Usage
In order to use the package in your Laravel application, you can use either the facade or get an instance of the M-Pesa service on the Laravel service container.
3.1 - Using the M-Pesa facade
3.2 - Using the M-Pesa service from Laravel service container
4. Testing
- Update tests/config/mpesa-config-test.php with required parameters
- Enter the test amount and MSISDN in tests/Services/MPesaMzTest.php, respectively on lines 47 and 48
- Run PHPUnit 9 binary in vendor/bin/
- Check the phone for M-Pesa payment requests
The test case currently creates a new transaction, refunds the transaction and queries the transaction status. Tests may be billable when running on production.
5. License
This library is release under the MIT License. See LICENSE file for details.
6. Authors
Calvin Carlos da Conceição Chiulele [email protected] and contributors
This package is still in development phase, so any suggestions, improvements and recommendations are welcomed.
All versions of mpesa-mz with dependencies
illuminate/support Version 5.8.* || 6.* || 7.* || 8.*
php Version ^7.3