Download the PHP package crysoft/mpesa-bundle without Composer

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

SYMFONY M-PESA API Bundle

This is a Symfony Bundle for the integration Safaricom's M-Pesa Online API. The API allows a merchant to initiate Online C2B (Paybill via web) transactions. The merchant submits authentication details, transaction details, callback url and callback method.

Normally after request submission, the merchant receives instant feedback with validity status of their requests but this bundle implements a custom request for that status. The C2B API handles customer validation and authentication via USSD push. The customer then confirms the transaction.

Requirements

Installation

To install this bundle, run the command below and you will get the latest version by [Packagist][4].

Load the Bundle

Load bundle in AppKernel.php:

Configuration of the Bundle

Configuration in config.yml:

Config Options

The M-Pesa API Endpoint. Confirm this as it might change at some point

The fully qualified callback URL to be queried by Safaricom on transaction completion.

The callback method to be used. Can also be GET

The merchant's Paybill number.

The SAG Passkey given by Safaricom on registration. You probably have to ask for it.

Usage

Usage of the Bundle is simple. Use it in your controller you have access to the Service Container using "$this->container" which in turn accesses the config variables.

In your controller do:

You can just chain the method calls into one single call as shown above. This Bundle comes with a handy method named "generateTransactionNumber()" that generates a random transaction number for you to use. Take note of the generated transaction id/number as you will use it to query the status of the transaction isntead of waiting for Safaricom to make the callback.

Requesting for the Status is trivial as this bundle also provides a simple way of doing that:

You dont have to name your variables as we have named them, you can name them anything. And that's it. You are good to go

Testing

Be careful when testing this, Paybill will deduct the amount from Mpesa. You can use kes 10 which is the minimum allowed.

License

The M-Pesa Package is open-sourced software licensed under the MIT license.


All versions of mpesa-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
ext-curl Version *
eightpoints/guzzle-bundle Version ~5.3
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 crysoft/mpesa-bundle contains the following files

Loading the files please wait ....