Skip to content
This repository has been archived by the owner on Jul 11, 2021. It is now read-only.

Commit

Permalink
Synchronous Request Endpoint Updates (#100)
Browse files Browse the repository at this point in the history
* version 3.1.0

Signed-off-by: elvis ayiemba <[email protected]>

* Documentation urls modified

Signed-off-by: elvis ayiemba <[email protected]>

* Update reversal.md

* Update accountbalance.md

* Update b2b.md

* Update b2c.md

* Update callbacks.md

* Update callbacks.md

* Update callbacks.md

* Update and rename commonpitfalls.md to tips.md

* Update tips.md

* Update tips.md

* Update toc.yml

* Update index.md

* Update README.md

* Update README.md

* Update README.md

* Updated Documentation, resolved broken links

Signed-off-by: elvis ayiemba <[email protected]>

* updated documentation

Signed-off-by: elvis ayiemba <[email protected]>

* edited csproj

Signed-off-by: elvis ayiemba <[email protected]>

* Documentation

* Documentation

* Refactoring MpesaClient

* Adding test project

* version 3.1.3

* adding test project

* Update MpesaClient

* minor cleanup

* updates

* Improved Error Handling and Improved Asyn -> Sync conversion

* Adding Cancellation Tokens

* Update IMpesaClient.cs
  • Loading branch information
ayiemba authored Mar 17, 2019
1 parent 3ea761a commit e5cc98c
Show file tree
Hide file tree
Showing 8 changed files with 211 additions and 147 deletions.
12 changes: 6 additions & 6 deletions MpesaLibrary.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{9372EA7C-3B1
__JSONSchema =
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MpesaLib.Tests", "MpesaLib.Tests\MpesaLib.Tests.csproj", "{C9FBF83B-0C56-4071-B4F1-B835AE86A026}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MpesaLib.Tests", "src\MpesaLib.Tests\MpesaLib.Tests.csproj", "{D2EFFCF9-1F0B-4A14-AD20-ADDE06A2C885}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -26,17 +26,17 @@ Global
{C780CBA5-DDED-4311-B829-16FDF97F163E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C780CBA5-DDED-4311-B829-16FDF97F163E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C780CBA5-DDED-4311-B829-16FDF97F163E}.Release|Any CPU.Build.0 = Release|Any CPU
{C9FBF83B-0C56-4071-B4F1-B835AE86A026}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C9FBF83B-0C56-4071-B4F1-B835AE86A026}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C9FBF83B-0C56-4071-B4F1-B835AE86A026}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C9FBF83B-0C56-4071-B4F1-B835AE86A026}.Release|Any CPU.Build.0 = Release|Any CPU
{D2EFFCF9-1F0B-4A14-AD20-ADDE06A2C885}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D2EFFCF9-1F0B-4A14-AD20-ADDE06A2C885}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D2EFFCF9-1F0B-4A14-AD20-ADDE06A2C885}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D2EFFCF9-1F0B-4A14-AD20-ADDE06A2C885}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{C780CBA5-DDED-4311-B829-16FDF97F163E} = {9372EA7C-3B1B-4E16-A108-6E1F0B7C23BD}
{C9FBF83B-0C56-4071-B4F1-B835AE86A026} = {9372EA7C-3B1B-4E16-A108-6E1F0B7C23BD}
{D2EFFCF9-1F0B-4A14-AD20-ADDE06A2C885} = {9372EA7C-3B1B-4E16-A108-6E1F0B7C23BD}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {AF2D71E1-E089-4701-96B8-A55DE41A7751}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\src\MpesaLib\MpesaLib.csproj" />
<ProjectReference Include="..\MpesaLib\MpesaLib.csproj" />
</ItemGroup>

</Project>
File renamed without changes.
22 changes: 22 additions & 0 deletions src/MpesaLib/Helpers/Exceptions/MpesaApiException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace MpesaLib.Helpers.Exceptions
{
/// <summary>
/// Mpesa Api Exceptions Helper class
/// </summary>
public class MpesaApiException : Exception
{
/// <summary>
/// Http Status code
/// </summary>
public int StatusCode { get; set; }

/// <summary>
/// Content from response body
/// </summary>
public string Content { get; set; }
}
}
65 changes: 43 additions & 22 deletions src/MpesaLib/IMpesaClient.cs

Large diffs are not rendered by default.

249 changes: 135 additions & 114 deletions src/MpesaLib/MpesaClient.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
using System.Linq;
using System.Threading.Tasks;

namespace MpesaLib
namespace MpesaLib.Responses
{
/// <summary>
/// Accesstoken data transfer object
/// </summary>
public class TokenDto
public class TokenResponse
{
/// <summary>
/// Access token to access other APIs
/// </summary>
[JsonProperty("access_token")]
public string access_token { get; set; }
public string AccessToken { get; set; }

/// <summary>
/// time token expires
/// </summary>
[JsonProperty("expires_in")]
public string expires_in { get; set; }
public string ExpiresIn { get; set; }
}
}

0 comments on commit e5cc98c

Please sign in to comment.