mutiadavid / MpesaSDK.NET

Safaricom mobile banking 'MPESA' SDK implementation for .NET.
Other
13 stars 6 forks source link

Concrete code examples #8

Closed vmureithi closed 4 years ago

vmureithi commented 4 years ago

Beautiful Library but misses code examples E.g.

            var result = await mpesaclient.STKPushAsync("44444", "254722600601", 10, "passkey", "https://urdomain.ext/path", accountReference: "1234567890", transactionDesc: "Goods payment");
mutiadavid commented 4 years ago

Hello,

I haven't had enough time to document, I will work on it once I get time. You welcome to contribute and update the repo by creating a pull request.

vmureithi commented 4 years ago

Hi,

Getting the below error for b2c

System.AggregateException HResult=0x80131500 Message=One or more errors occurred. Source=mscorlib StackTrace: at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.Wait() at Tool_mpesasdk.net_b2c.Program.Main(String[] args) in C:\Users\P50\source\repos\Tool-mpesasdk.net-b2c\Tool-mpesasdk.net-b2c\Program.cs:line 21

Inner Exception 1: CryptographicException: Bad Length.

This seems to be a credential issue…. I’m generating as follows:

string credential = "pass".ToMpesaSecurityCredential();

var result = await mpesaclient.B2CAsync("vmureithi", credential,…….);

can you help?

From: mutiadavid [mailto:notifications@github.com] Sent: Saturday, 21 March 2020 16:47 To: mutiadavid/MpesaSDK.NET MpesaSDK.NET@noreply.github.com Cc: Vincent Mureithi vincent.mureithi@payitive.com; Author author@noreply.github.com Subject: Re: [mutiadavid/MpesaSDK.NET] Concrete code examples (#8)

Reopened #8https://github.com/mutiadavid/MpesaSDK.NET/issues/8.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/mutiadavid/MpesaSDK.NET/issues/8#event-3151751294, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABXG6RQ2HL5JBTR63Q7C2QTRITALXANCNFSM4LQ4WBRQ.

mutiadavid commented 4 years ago

Docs updated.