PHPackages                             foris-master/mtn-mobile-money-sdk - 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. [API Development](/categories/api)
4. /
5. foris-master/mtn-mobile-money-sdk

ActiveLibrary[API Development](/categories/api)

foris-master/mtn-mobile-money-sdk
=================================

This is a php sdk for MTN operator mobile money api.

0.2.0(2y ago)12.2k1MITPHPPHP &gt;=5.3.0|^7.4 | ^8.0.2CI failing

Since Jul 13Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Foris-master/mtn-mobile-money-sdk)[ Packagist](https://packagist.org/packages/foris-master/mtn-mobile-money-sdk)[ Docs](https://github.com/php-loep/:package_name)[ RSS](/packages/foris-master-mtn-mobile-money-sdk/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

mtn-mobile-money-sdk
====================

[](#mtn-mobile-money-sdk)

php sdk for MTN MNO Mobile Money API

**Note:** `mtn-mobile-money-sdk`.

This is a php sdk for mtn operator mobile money api.

Install
-------

[](#install)

Via Composer

```
$ composer require foris-master/mtn-mobile-money-sdk
```

Global Config
-------------

[](#global-config)

- `MOMO_CURRENCY` Setup the currency `value`: EUR
- `MOMO_SDK_ENV` Configures the value of the SDK environment `value`: sandbox or prod
- `MOMO_ENV` variable to specify the application environment `value`: mtncameroon
- `MOMO_CALLBACK_HOST`Sets the callback host for MTN API notifications `value`:
- `MOMO_CALLBACK_URL` URL of the callback for MTN API notifications `value`:
- enviroment variable ( .env file if using dotenv)

Quick Usage
-----------

[](#quick-usage)

```
use Foris\MoMoSdk\Disbursement;
use Foris\MoMoSdk\Collection;

        putenv('MOMO_CALLBACK_URL=https://myawesome.callback.com');
        putenv('MOMO_CALLBACK_HOST=azz.com');
        putenv('MOMO_ENV=mtncameroon');
        putenv('MOMO_SDK_ENV=prod');
        putenv('MOMO_CURRENCY=XAF');

Exemple  Disbursement
$disbursement = new Disbursement();
$disbursement->getAccessToken();
$disbursement->transfer(100, '0123456789');
$transferData = $disbursement->transfer(100, '0123456789');
$transactionData = $disbursement->getTransaction('transaction_id');
$balance = $disbursement->getBalance();
$accountValidation = $disbursement->isAccountValid('0123456789');

Exemple  Collection
$collection = new Collection();
$collection->getAccessToken();
$collection->requestToPay(100, '0123456789');
$collection-> getTransaction($id);
$collection->getBalance();
$collection->isAccountValid("0123456789")
```

Config Disbursement
-------------------

[](#config-disbursement)

Disbursement is used for transferring money from the provider account to a customer [Read more about Momo Disbursement](https://momodeveloper.mtn.com/docs/services/disbursement).

- `MOMO_DISBURSEMENT_PRIMARY_KEY` Primary Key for the Disbursement product on the developer portal `value`: your primary key here
- `MOMO_DISBURSEMENT_API_USER` User for the Disbursement API `value`: Your appuser
- `MOMO_DISBURSEMENT_APP_KEY` application key for the Disbursement product `value`: your app key

Disbursement Usage
------------------

[](#disbursement-usage)

- Get token

`getAccessToken()` This method allows you to obtain an access token to perform disbursement operations.

```
use Foris\MoMoSdk\Disbursement;

$disbursement = new Disbursement();
$accessToken = $disbursement->getAccessToken();
```

- transfer

`transfer($amount, $tel, $options = array())` This method allows you to perform a funds transfer.

```
use Foris\MoMoSdk\Disbursement;

$disbursement = new Disbursement();
$transferData = $disbursement->transfer(100, '0123456789');
```

- getTransaction

`getTransaction('transaction_id')`This method allows you to retrieve the details of a disbursement transaction.

```
use Foris\MoMoSdk\Disbursement;

$disbursement = new Disbursement();
$transactionData = $disbursement->getTransaction('transaction_id');
```

- getBalance

`getBalance()`This method allows you to get the balance of the disbursement account.

```
use Foris\MoMoSdk\Disbursement;

$disbursement = new Disbursement();
$balance = $disbursement->getBalance();
```

- isAccountValid

`isAccountValid('0123456789')`This method allows you to check if a phone number is associated with a valid account.

```
use Foris\MoMoSdk\Disbursement;

$disbursement = new Disbursement();
$accountValidation = $disbursement->isAccountValid('0123456789');
```

Config Collection
-----------------

[](#config-collection)

Collections is used for requesting a payment from a customer and checking status of transactions [Read more about Momo Collection](https://momodeveloper.mtn.com/docs/services/collection).

- `MOMO_COLLECTION_PRIMARY_KEY` Primary Key for the Collection product on the developer portal `value`: your primary key here
- `MOMO_COLLECTION_API_USER` User for the Collection API `value`: Your appuser
- `MOMO_COLLECTION_APP_KEY` application key for the Collection product `value`: your app key

Collection Usage
----------------

[](#collection-usage)

Collections is used for requesting a payment from a customer and checking status of transactions.

- Get token

`getAccessToken()` This method allows you to obtain an access token to perform collection operations.

```
use Foris\MoMoSdk\Collection;

$collection = new Collection();
$accessToken = $collection->getAccessToken();
```

- requestToPay

`requestToPay(100, '0123456789')` This method Initiates a payment request for a specific amount to the given phone number

```
use Foris\MoMoSdk\CollectionCollection;

$collection = new CollectionCollection();
$requesPay = $collection->requestToPay(100, '0123456789');
```

- getTransaction

`getTransaction($id)` This method allows you to retrieve the details of a transaction.

```
use Foris\MoMoSdk\CollectionCollection;

$collection = new CollectionCollection();
$showTransaction = $collection->getTransaction($id);
```

- getBalance `getBalance()`Retrieves the balance of the collection account

```
use Foris\MoMoSdk\CollectionCollection;

$collection = new CollectionCollection();
$balance = $collection->getBalance();
```

- isAccountValid `isAccountValid()`Checks if the given phone number is associated with a valid collection account

```
use Foris\MoMoSdk\Collection;

$collection = new Collection();
$accountValidation = $collection->isAccountValid('0123456789');
```

#### Note

[](#note)

The status could take one of the following values: INITIATED; PENDING; EXPIRED; SUCCESS; FAILED

- INITIATED waiting for user entry
- PENDING user has clicked on “Confirmer”, transaction is in progress on Mtn side
- EXPIRED user has clicked on “Confirmer” too late (after token’s validity)
- SUCCESS payment is done
- FAILED payment has failed

Production
----------

[](#production)

```
  For production your need to set your target country code in COUNTRY enviroment variable ( .env file if using dotenv)
  example:  COUNTRY = mtncameroon

```

Testing
-------

[](#testing)

```
$ vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/thephpleague/:package_name/blob/master/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [foris-master](https://github.com/foris-master)
- [marlinbleriaux](https://github.com/marlinbleriaux)
- [All Contributors](https://github.com/thephpleague/:package_name/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

1078d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4623684?v=4)[foris.ai](/maintainers/foris)[@Foris](https://github.com/Foris)

---

Top Contributors

[![marlinbleriaux](https://avatars.githubusercontent.com/u/80590737?v=4)](https://github.com/marlinbleriaux "marlinbleriaux (4 commits)")[![Foris-master](https://avatars.githubusercontent.com/u/15254899?v=4)](https://github.com/Foris-master "Foris-master (3 commits)")

---

Tags

mobile-moneymtnphpsdkphpmoneysdkmobile-moneymtn

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/foris-master-mtn-mobile-money-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/foris-master-mtn-mobile-money-sdk/health.svg)](https://phpackages.com/packages/foris-master-mtn-mobile-money-sdk)
```

###  Alternatives

[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[resend/resend-php

Resend PHP library.

596.2M35](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.5M10](/packages/checkout-checkout-sdk-php)[mailchimp/transactional

529.5M18](/packages/mailchimp-transactional)[mozex/anthropic-laravel

Laravel integration for the Anthropic API: facade, config publishing, install command, testing fakes, messages, streaming, tool use, thinking, and batches.

72287.1k1](/packages/mozex-anthropic-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
