Skip to content

yourdudeken/mpesa-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mpesa SDK

Multi-language SDK for Mpesa Daraja API.

PHP Node.js Python Java C# Go

Supported Languages

Language Package Version
PHP/Laravel yourdudeken/mpesa-sdk v1.0.0
Node.js/TypeScript @yourdudeken/mpesa-sdk v1.0.0
Python yourdudeken-mpesa-sdk v1.0.0
Java com.yourdudeken.mpesa v1.0.0
C#/.NET Yourdudeken.Mpesa v1.0.0
Go github.com/yourdudeken/mpesa-sdk v1.0.0

Quick Start

PHP (Laravel)

composer require yourdudeken/mpesa-sdk
php artisan mpesa:install

Node.js

npm install @yourdudeken/mpesa-sdk

Python

pip install yourdudeken-mpesa-sdk

Documentation

API Reference

All SDKs expose a consistent interface:

// PHP
$mpesa->stkpush($phone, $amount, $account);
$mpesa->b2c($phone, $command, $amount, $remarks);
$mpesa->c2bregisterURLS($shortcode, $confirmUrl, $validateUrl);
$mpesa->transactionStatus($shortcode, $transactionId, $identifierType, $remarks);
// Node.js
await mpesa.stkpush({ phonenumber, amount, accountNumber });
await mpesa.b2c({ phonenumber, commandId, amount, remarks });
await mpesa.c2bregisterURLS({ shortcode, confirmUrl, validateUrl });
await mpesa.transactionStatus({ shortcode, transactionId, identifierType, remarks });
# Python
mpesa.stkpush(phonenumber, amount, account_number)
mpesa.b2c(phonenumber, command_id, amount, remarks)
mpesa.c2bregisterURLS(shortcode, confirm_url, validate_url)
mpesa.transaction_status(shortcode, transaction_id, identifier_type, remarks)

Supported APIs

  • STK Push - Lipa na Mpesa Online
  • B2C - Business to Customer
  • B2B - Business to Business
  • C2B - Customer to Business
  • B2Pochi - Business to Pochi
  • Account Balance - Check till balance
  • Transaction Status - Query transaction
  • Reversal - Reverse transaction

License

MIT License - see LICENSE.md

About

Multi-language SDK for Mpesa Daraja API.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors