Skip to content

Mpesa Daraja SDK implementation for .net.

License

Notifications You must be signed in to change notification settings

ElishaMisoi/MpesaSDK.NET

 
 

Repository files navigation

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

About

Mpesa Daraja SDK implementation for .net.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%