Use the MTN Mobile Money API in your .NET applications.
Currently targeting netstandard1.3.
Find the package on NuGet
Visual Studio Nuget Console
Install-Package MtnMomo.NET -IncludePrerelease
Dotnet CLI Tools
dotnet add package MtnMomo.NET --version 1.0.0-alpha-17
using MtnMomo.NET;
var config = new MomoConfig();
config.UserId = UserId;
config.UserSecret = UserSecretKey;
config.SubscriptionKey = SubscriptionKey;
var collections = new CollectionsClient(config);
var result = await collections.RequestToPay(
25000.00M,
"UGX",
"External ID",
new Party("0777000000", PartyIdType.Msisdn),
"Payer message",
"Payee note",
new Uri("http://www.example.com")
);
using MtnMomo.NET;
var config = new MomoConfig();
config.UserId = UserId;
config.UserSecret = UserSecretKey;
config.SubscriptionKey = SubscriptionKey;
var disbursements = new DisbursementsClient(config);
var result = await disbursements.Transfer(
25000.00M,
"UGX",
"External ID",
new Party("0777000000", PartyIdType.Msisdn),
"Payer message",
"Payee message",
new Uri("http://www.example.com")
);
using MtnMomo.NET;
var config = new MomoConfig();
config.UserId = UserId;
config.UserSecret = UserSecretKey;
config.SubscriptionKey = SubscriptionKey;
var remittances = new RemittancesClient(config);
var result = await remittances.Transfer(
25000.00M,
"UGX",
"External Id",
new Party("0777000000", PartyIdType.Msisdn),
"Payer note",
"Payee note",
new Uri("http://www.example.com")
);