Skip to content

This is a PHP software development kit (SDK) for integrating the Mpesa Daraja API into your PHP applications. The Mpesa Daraja API is a secure and efficient way to integrate Mpesa mobile payments and other functionalities into your web or mobile applications in Kenya.

License

Notifications You must be signed in to change notification settings

alvin-kiveu/Mpesa-Daraja-Api-Php-Sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mpesa Daraja Api Php Sdk

This is a php sdk for the new Mpesa Daraja Api. It is still in development and will be updated as the api changes.

Installation

You can install the package via composer:

composer require kiveu/mpesa

dev version

composer require kiveu/mpesa:dev-main

UNDER DEVELOPMENT

Usage

use Kiveu\Mpesa\StkPush;

$stkpush = new StkPush();

$stkpush->initiate($phone_number, $amount, $reference, $description);

Testing

composer test

ENVIRONMENT VARIABLES

MPESA_ENV= production # or sandbox >
MPESA_CONSUMER_KEY= add your consumer key
MPESA_CONSUMER_SECRET= add your consumer secret
MPESA_PASSKEY= add your passkey
MPESA_SHORTCODE= add your shortcode
MPESA_SHORTCODE_TYPE= Paybill # or BuyGoods
MPESA_BUY_GOODS_TILL= add your buy goods till
MPESA_CALLBACK_URL= add your callback url
MPESA_INITIATOR_NAME= add your initiator name
MPESA_INITIATOR_PASSWORD= add your initiator password
MPESA_B2C_SHORTCODE= add your b2c shortcode
MPESA_B2C_COMMAND_ID= add your b2c command id eg SalaryPayment, BusinessPayment, PromotionPayment
MAPESA_C2B_VERSION= add your c2b version v1 or v2
MPESA_CONFIRMATION_URL= add your confirmation url
MPESA_VALIDATION_URL= add your validation url
MPESA_RESULT_URL= add your result url
KRA_SHORT_CODE= add your kra shortcode

About

This is a PHP software development kit (SDK) for integrating the Mpesa Daraja API into your PHP applications. The Mpesa Daraja API is a secure and efficient way to integrate Mpesa mobile payments and other functionalities into your web or mobile applications in Kenya.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages