Mpesa Daraja SDK implementation for .net.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
CallbackServer
ClientTest
MpesaSDK.NET
.gitattributes
.gitignore
MpesaSDK.NET.sln
README.md
license.txt

README.md

MpesaSDK.NET

Mpesa Daraja SDK implementation for .net.

For More Info check Safaricom Mpesa Documentation

Download and Install

nugget install

Usage

Sending Requests


STK Push request
using MpesaSDK.NET;
using MpesaSDK.NET.Dtos.Requests;
...

MpesaClient mpesaclient = new MpesaClient("consumerkey","secret");

var result = await mpesaclient.STKPush(...);
Stk Push Query request
var result = await mpesaclient.StkPushQuery(...);
B2C request
var result = await mpesaclient.B2C(...);
B2B request
var result = await mpesaclient.B2B(...);

To get MPesa Security credetials for both B2B and B2C use method below.

string credential = "pass".MpesaSecurityCredential(); 
C2B Register Url request
var result = await mpesaclient.C2BRegisterUrl(...);
C2B Simulate Transaction request
var result = await mpesaclient.C2BSimulateTransaction(...);
Account Balance request
var result = await mpesaclient.AccountBalance(...);
Transaction Status request
var result = await mpesaclient.TransactionStatus(...);
Reversal request
var result = await mpesaclient.Reversal(...);

Callback server


Check sample callback api here

Docs to be updated soon.

LICENSE

Apache LICENSE-2.0 read more