Download the PHP package abdulmueid/mpesa without Composer

On this page you can find all versions of the php package abdulmueid/mpesa. 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 mpesa

Welcome to M-Pesa PHP API

This project aims to provide an easy-to-use and up-to-date PHP wrapper for the M-Pesa Mozambique API.

Target version of M-Pesa API: v1x

Installation

Install using composer:

Usage

  1. Load the configuration from file.

    See sample configuration file in examples folder.

  2. Create a Transaction using the configuration.

  3. Execute API operations and pass appropriate parameters.

    1. Initiate a C2B payment collection.

    2. Initiate a B2C payment.

    3. Initiate a B2B payment.

    4. Initiate a reversal.

    5. Query a transaction.
  4. Check Response

    All transactions return the TransactionResponse object. The object has the following public methods:

    1. getCode() - Returns the response code i.e. INS-0

    2. getDescription() - Returns the description.

    3. getTransactionID() - Returns the transaction ID.

    4. getConversationID() - Returns the conversation ID.

    5. getTransactionStatus() - Returns the transaction status. Only populated when calling the query() transaction.

    6. getResponse() - Returns the full response JSON object as received from M-Pesa servers. Good for debugging any issues or undocumented behaviors of the M-Pesa API.

In a typical scenario, code to check for successful transactions should be as follows:

Testing

This repo provides Unit Tests to validate the objects and their interaction with M-Pesa.

To run tests,

  1. Open the phpunit.xml file and add the require credentials/parameters as supplied by M-Pesa.
  2. Run phpunit
  3. Check the handset for USSD prompts to approve test transactions.

All tests use 1MT as the test amount.

License

This library is release under the MIT License. See LICENSE file for details.


All versions of mpesa with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
ext-curl Version *
ext-json Version *
ext-openssl Version *
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 abdulmueid/mpesa contains the following files

Loading the files please wait ....