PHPackages                             calvinchiulele/mpesa-mz - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. calvinchiulele/mpesa-mz

ActiveLibrary[Payment Processing](/categories/payments)

calvinchiulele/mpesa-mz
=======================

Unofficial Laravel package for Vodacom Mozambique M-Pesa

v0.1.0(5y ago)8884[1 issues](https://github.com/calvinchiulele/mpesa-mz/issues)MITPHPPHP ^7.3

Since Oct 24Pushed 5y ago1 watchersCompare

[ Source](https://github.com/calvinchiulele/mpesa-mz)[ Packagist](https://packagist.org/packages/calvinchiulele/mpesa-mz)[ RSS](/packages/calvinchiulele-mpesa-mz/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (3)Versions (3)Used By (0)

Laravel Package for Vodacom Mozambique M-Pesa
=============================================

[](#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:

For more information of what abdulmueid/mpesa-php-api is, refer to

1. Installation
===============

[](#1-installation)

All you have to do is the following:

```
composer require calvinchiulele/mpesa-mz

```

```
php artisan vendor:publish

```

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
================

[](#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:

```
MPESA_PUBLIC_KEY=xxx
MPESA_API_HOST="api.sandbox.vm.co.mz"
MPESA_API_KEY=xxx
MPESA_ORIGIN=xxx
MPESA_SERVICE_PROVIDER_CODE=xxx
MPESA_INITIATOR_IDENTIFIER=xxx
MPESA_SECURITY_CREDENTIAL=xxx
```

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 `php artisan config:clear` 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`**

```
