Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldwight authored May 6, 2022
1 parent cca1d37 commit a304e1e
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ A .NET Standard M-PESA API Helper Library for .NET Developers.

## Supported Platforms

| *Platform* | .Net 5.0 | .NET Core | .NET Framework | Mono | Xamarin.iOS | Xamarin.Android | Xamarin.Mac | UWP |
|:--------------:|---------:|:---------:|:--------------:|:----:|:-----------:|:---------------:|:-----------:|:----------:|
| *Min. Version* | 5 | 2.0 | 4.6.1 | 5.4 | 10.14 | 8.0 | 3.8 | 10.0.16299 |
| *Platform* | .Net 6.0 | .Net 5.0 | .NET Core | .NET Framework | Mono | Xamarin.iOS | Xamarin.Android | Xamarin.Mac | UWP |
|:--------------:|---------:|---------:|:---------:|:--------------:|:----:|:-----------:|:---------------:|:-----------:|:----------:|
| *Min. Version* | 6 | 5 | 2.0 | 4.6.1 | 5.4 | 10.14 | 8.0 | 3.8 | 10.0.16299 |

## Installation
- PackageManager: ```PM> Install-Package MpesaSdk```
Expand Down Expand Up @@ -344,6 +344,20 @@ var SecutityCredential = Credentials.EncryptPassword(certificate, "Initiator Pas

```

## Dynamic Mpesa QR Request
```c#
DynamicMpesaQR dynamicMpesaQR = new DynamicMpesaQR(qrVersion: "01",
qrFormat: 1, // 1, 2, 3 or 4
qrType: "D", // D or S
merchantName: dynamicQR.MerchantName,
refNo: dynamicQR.Reference,
amount: dynamicQR.Amount,
trxCode: "PB", // BG, WA, PB, SM or SB
cpi: dynamicQR.CPI);

DynamicMpesaQRResponse dynamicMpesaQRResponse = await _mpesaClient.GenerateDynamicMpesaQRAsync(dynamicMpesaQR, accessToken, MpesaRequestEndpoint.DynamicMpesaQR);
```

## Error handling
MpesaClient Throws ```MpesaApiException``` whenever A 200 status code is not returned. It is your role as the developer to catch
the exception and continue processing in your aplication. Snippet below shows how you can catch the MpesaApiException.
Expand Down

0 comments on commit a304e1e

Please sign in to comment.