Download the PHP package lepresk/momo-api without Composer

On this page you can find all versions of the php package lepresk/momo-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package momo-api

Librairie Momo API

Static Badge CI GitHub

A powerful and professional PHP wrapper for integrating MTN Mobile Money and Airtel Money APIs. Supports Collection (receive payments) and Disbursement (send money) operations.

Features

Provider Product Supported Operations
MTN MoMo Collection Request payments, Check payment status, Check account holder, Get balance
MTN MoMo Disbursement Transfer money, Deposit funds, Process refunds, Check account holder, Get balance
MTN MoMo Sandbox Create API users, Generate API keys, Test environment support
Airtel Money Collection Request payments, Check payment status, Get balance
Airtel Money Disbursement Transfer money, Check transfer status, Get balance

Requirements

Installation

Quick Start

Collection API (Receive Payments)

Disbursement API (Send Money)

Sandbox Setup

Advanced Usage

Collection API - Full Example

Disbursement API - Full Example

Airtel Money

Airtel Collection API (Receive Payments)

Airtel Disbursement API (Send Money)

Airtel Environments

Mode URL Use Case
staging https://openapiuat.airtel.cg Testing
production https://openapi.airtel.cg Production - Congo

Handling Callbacks

Error Handling

Available Environments

Constant Value Use Case
ENVIRONMENT_SANDBOX sandbox Testing
ENVIRONMENT_MTN_CONGO mtncongo Production - Congo
ENVIRONMENT_MTN_UGANDA mtnuganda Production - Uganda
ENVIRONMENT_MTN_GHANA mtnghana Production - Ghana
ENVIRONMENT_IVORY_COAST mtnivorycoast Production - Ivory Coast
ENVIRONMENT_ZAMBIA mtnzambia Production - Zambia
ENVIRONMENT_CAMEROON mtncameroon Production - Cameroon
ENVIRONMENT_BENIN mtnbenin Production - Benin
ENVIRONMENT_SWAZILAND mtnswaziland Production - Swaziland
ENVIRONMENT_GUINEACONAKRY mtnguineaconakry Production - Guinea Conakry
ENVIRONMENT_SOUTHAFRICA mtnsouthafrica Production - South Africa
ENVIRONMENT_LIBERIA mtnliberia Production - Liberia

API Reference

Collection API

Method Description
requestToPay(PaymentRequest $request) Request payment from customer
quickPay(string $amount, string $phone, string $ref) Quick payment helper
getPaymentStatus(string $paymentId) Check payment status
checkAccountHolder(string $phone) Check if MSISDN is active
getBalance() Get account balance
getAccessToken() Get OAuth token (auto-managed)

Disbursement API

Method Description
transfer(TransferRequest $request) Transfer money to beneficiary
getTransferStatus(string $transferId) Check transfer status
deposit(PaymentRequest $request) Deposit funds
getDepositStatus(string $depositId) Check deposit status
refund(RefundRequest $request) Refund a transaction
getRefundStatus(string $refundId) Check refund status
checkAccountHolder(string $phone) Check if MSISDN is active
getBalance() Get account balance
getAccessToken() Get OAuth token (auto-managed)

Airtel Collection API

Method Description
requestToPay(string $amount, string $phone, string $reference) Request payment from customer
getPaymentStatus(string $externalId) Check payment status (returns AirtelTransaction)
getBalance() Get account balance
getAccessToken() Get OAuth token (cached automatically)

Airtel Disbursement API

Method Description
transfer(string $amount, string $phone, string $reference) Transfer money (requires encryptedPin)
getTransferStatus(string $externalId) Check transfer status (returns AirtelTransaction)
getBalance() Get account balance
getAccessToken() Get OAuth token (cached automatically)

Sandbox API

Method Description
createApiUser(string $uuid, string $callback) Create sandbox API user
getApiUser(string $uuid) Get API user details
createApiKey(string $uuid) Generate API key

Testing

The package includes two types of tests:

Unit Tests - Fast tests with mocked HTTP responses:

Fixture Tests - Validate parsing of real MTN API responses:

Run PHPStan analysis:

Production Notes

Ecosystem

The same client is available for multiple languages:

Language Package Install
PHP lepresk/momo-api composer require lepresk/momo-api
Node.js / TypeScript @lepresk/momo-api npm install @lepresk/momo-api
Python mtn-momo-client pip install mtn-momo-client

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

Changelog

See CHANGELOG.md for the full history of changes.

License

MIT License - see LICENSE file for details.

Support


All versions of momo-api with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
symfony/http-client Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lepresk/momo-api contains the following files

Loading the files please wait ...