Download the PHP package escarter/openapimomo without Composer
On this page you can find all versions of the php package escarter/openapimomo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download escarter/openapimomo
More information about escarter/openapimomo
Files in escarter/openapimomo
Package openapimomo
Short Description Laravel Package for MTN Mobile Money Open API wrapper
License MIT
Informations about the package openapimomo
OpenapiMoMo Documentation
This is a laravel package that helps you easily use the MTN OpenAPI in your laravel project. This package simplifies the integration of this API by providing simple methods which you can use when calling the different endpoints provided by this API. This package contains a configuration file that helps you easily manage your settings in a single location and permits you to swap between environments with a single value change.
How to install?
You can install this package to your laravel application using composer as below
After installation is complete, you will have to publish the configuration file by running the command below
This will move the openapimomo.php configuration file to your config folder. Open this file and update as required.
Before you start using this package, you need to update the configuration file appropriately.
General configuration
Collection API configuration
This section contains configurations for the collection API. Ensure to replace the keys with their appropriate values
The other parts of the collection section stays untouched, only the section shown above should be updated. Same goes for the Disbursement and Remittance sections in the configuration file.
Disbursement API configuration
This section contains configurations for the disburement API. Ensure to replace the keys with their appropriate values
The Remittance section is similar, so will leave it out from the documentation.
Note:
- Collection API user and Collection API key are different from disbursement and remittance. Each API has it's user and key
- You can generate sandbox user for these APIs here Sandbox user provisioning
- Here is a video showing you how you can provision a sandbox user and api key for each of the APIs how to generate sandbox users and api keys
How to use this package ?
Below are sample codes showing how you can use this package.
1. sample requesttopay and get transaction status (Collection API)
Once all your configurations are done, you can peform a requesttopay using the get transaction status method to check the transaction as show below. Ensure that you have a correct collection
- API user
- API key
- Ocp-Apim-Subscription-Key
properly set in the config file
2. Check Collection account balance (Collection API)
The sample code below shows you how to get your collection account balance.
3. Sample transfer request (Disbursement API)
Before you can perform a transfer request, you should ensure that you have properly updated the disbursement section in the openapimomo.php configuration file with the correct
- API user
- API key
- Ocp-Apim-Subscription-Key
4. Check Disbursement account balance (Disbursement API)
The sample code below shows you how to get your disburement account balance.
Thanks.