Download the PHP package leefipay/mpesa without Composer

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

LeefiPay M-Pesa for Laravel

tests

Official Laravel package for integrating applications with the LeefiPay M-Pesa Open API.

API base: https://leefipay.com/api/v1/ · Docs: https://leefipay.com/developers

This package talks to LeefiPay’s public REST API (/api/v1) using Sanctum Bearer tokens. It does not call Safaricom Daraja directly — LeefiPay handles Daraja on your behalf.

Requirements

Laravel PHP Status
9.x 8.1+ Supported
10.x 8.1+ Supported
11.x 8.2+ Supported
12.x 8.2+ Supported
13.x 8.3+ Supported

Compatibility is enforced by GitHub Actions: package PHPUnit tests (HTTP-faked) plus install into a fresh Laravel application for each matrix entry. Mark rows as Tested only after the Actions workflow is green on main.

Installation

Publish config (optional):

Configuration

Create an API credential in the LeefiPay dashboard (API & Integrations or Developer console). Use the secret token as LEEFIPAY_API_KEY. The public key (lp_pk_…) is not used for request authentication.

LEEFIPAY_ENVIRONMENT is informational (sandbox vs production host is controlled by LEEFIPAY_BASE_URL).

Basic usage

Dependency injection:

STK Push

Required fields (Open API):

Field Notes
amount Integer KES ≥ 1
phone Customer MSISDN
payment_channel_id Till / Paybill channel from LeefiPay

Optional: customer_name, notes, idempotency_key / Idempotency-Key, account_reference (alias reference), mode (stk|manual|auto).

Transaction status & verify

Payment channels

Connection test

Webhooks (LeefiPay → your app)

Register a webhook URL in the LeefiPay dashboard pointing to:

Set LEEFIPAY_WEBHOOK_SECRET to the whsec_… secret.

The package verifies:

Dispatched events:

Error handling

Credentials are never included in exception messages or package logs.

Retries

Not currently supported

These are not exposed on the LeefiPay public Open API and are therefore not implemented:

Security

See SECURITY.md.

Testing

CI also installs the package into a temporary Laravel app for each supported major version (package discovery, config publish, container + facade resolution). No real LeefiPay / M-Pesa API calls are made.

Versioning

Semantic Versioning. Current development line: 0.1.x. Do not treat this as v1.0.0 until the full Laravel matrix is green in CI.

License

MIT — see LICENSE.


All versions of mpesa with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
guzzlehttp/guzzle Version ^7.5
illuminate/contracts Version ^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/events Version ^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/routing Version ^9.0|^10.0|^11.0|^12.0|^13.0
illuminate/support Version ^9.0|^10.0|^11.0|^12.0|^13.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 leefipay/mpesa contains the following files

Loading the files please wait ...