Download the PHP package tfs/mpesa without Composer

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

Safaricom M-Pesa Daraja API Laravel Package

Issues Stars

A modern Laravel package for Safaricom's M-Pesa Daraja API. Supports PHP 7.4+ and PHP 8.x with a flexible API that works with both array parameters and named arguments.

Features

Requirements

PHP Version Supported Recommended Style
7.4 Array parameters
8.0+ Named arguments

Installation

Publish configuration:

Usage Styles

This package supports two parameter styles for maximum compatibility:

Style 1: Array Parameters (PHP 7.4+)

Style 2: Named Arguments (PHP 8.0+)

Style 3: Positional Arguments (Both)


API Reference

STK Push (M-Pesa Express)

Prompt a customer to enter their M-Pesa PIN:

Query STK Push Status


B2C (Business to Customer)

Send money to a customer:


B2B PayBill

Pay a bill to another business:


B2B BuyGoods

Pay to a till number:


B2 Pochi (Business Wallet)

Send to a business wallet:


Account Balance

Check your M-Pesa balance:


C2B URL Registration

Register validation and confirmation URLs:


Custom Authentication

Override credentials per request (useful for multi-tenant apps):


Parameter Reference

Key Naming Convention

Both camelCase and snake_case keys are supported in arrays:

camelCase snake_case Description
accountReference account_reference Payment reference
transactionDesc transaction_desc Transaction description
checkoutRequestId checkout_request_id STK query ID
partyB party_b Recipient shortcode/phone
partyA party_a Sender shortcode
commandId command_id B2C command type
identifierType identifier_type Balance identifier
originatorConversationId originator_conversation_id Pochi conversation ID
validationUrl validation_url C2B validation URL
confirmationUrl `confirmation_url

All versions of mpesa with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0|^8.1|^8.2|^8.3
illuminate/support Version >=7.0 <13.0
illuminate/http Version ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0
illuminate/cache Version ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0
guzzlehttp/guzzle Version ^6.5|^7.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 tfs/mpesa contains the following files

Loading the files please wait ...