Download the PHP package wanzoou/momoapicollection without Composer
On this page you can find all versions of the php package wanzoou/momoapicollection. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wanzoou/momoapicollection
More information about wanzoou/momoapicollection
Files in wanzoou/momoapicollection
Package momoapicollection
Short Description This repository provides a PHP class, MomoAPI, to facilitate integration with the MTN Mobile Money (MoMo) API for collection services. This class allows you to create API users, generate API keys, obtain access tokens, and make payment requests to the MTN MoMo platform.
License MIT
Informations about the package momoapicollection
MTN MoMo API Collection Integration PHP
Introduction
This repository provides a PHP class, MomoAPI, to facilitate integration with the MTN Mobile Money (MoMo) API for collection services. This class allows you to create API users, generate API keys, obtain access tokens, and make payment requests to the MTN MoMo platform.
Features
- Create API User: Automatically create an API user for MTN MoMo integration.
- Generate API Key: Securely generate an API key for the created API user.
- Obtain Access Token: Generate an access token for authorization.
- Request to Pay: Initiate payment requests to the MoMo API.
- Check Transaction Status: Retrieve the status of a payment request.
Requirements
PHP 7.0or highercURLextension for PHP
Installation
You can install the library via Composer. Run the following command:
Include the MomoAPI class in your project:
Usage
Initialization
Instantiate the MomoAPI class:
Configuration
Set the required parameters:
Request to Pay
Initiate a payment request:
Check Transaction Status
Retrieve the status of a payment request:
Methods
setMomoPayHost($momo_pay_host)
Set the MoMo API host.
setProviderCallbackHost($providerCallbackHost)
Set the provider callback host.
setPrimaryKey($primary_key)
Set the primary key.
setTargetEnvironment($targetEnvironment)
Set the target environment (sandbox or live).
requestToPay($phone, $amount, $currency)
Initiate a payment request.
requestToPayTransactionStatus()
Retrieve the status of a payment request.
Example
Here is an example of using the MomoAPI class in a PHP script:
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request for any changes.
Contact
For any inquiries, please contact [email protected].
All versions of momoapicollection with dependencies
ext-curl Version *