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

Commit

Permalink
Merge branch 'master' into Dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ayiemba authored Mar 18, 2019
2 parents a5950a0 + cfb6242 commit 31b5380
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/MpesaLib/MpesaClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ public async Task<string> ReverseMpesaTransactionAsync(ReversalDto reversalDto,
return await MpesaHttpRequest(reversalDto,accesstoken, requestEndPoint,cancellationToken);
}



//private static void HttpClientInit(HttpClient httpclient, string accesstoken)
//{
Expand All @@ -345,7 +344,6 @@ public async Task<string> ReverseMpesaTransactionAsync(ReversalDto reversalDto,
//}



/// <summary>
/// Method makes the accesstoken request to mpesa api
/// </summary>
Expand Down Expand Up @@ -383,6 +381,7 @@ private async Task<string> RequestAccessToken(string consumerKey, string consume

return JsonConvert.DeserializeObject<TokenResponse>(strData).AccessToken;
}


/// <summary>
/// Makes HttpRequest to mpesa api server
Expand All @@ -399,6 +398,7 @@ private async Task<string> MpesaHttpRequest(object Dto,string token, string Endp
Content = new StringContent(JsonConvert.SerializeObject(Dto).ToString(), Encoding.UTF8, "application/json")
};


request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", token);
Expand All @@ -417,13 +417,13 @@ private async Task<string> MpesaHttpRequest(object Dto,string token, string Endp
throw new MpesaApiException
{
StatusCode = (int)response.StatusCode,

Content = strData
};
}

return strData;
}


}
}
4 changes: 4 additions & 0 deletions src/MpesaLib/MpesaLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<Version>3.2.4</Version>
</PropertyGroup>

<PropertyGroup>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<PropertyGroup>
<LangVersion>latest</LangVersion>
</PropertyGroup>
Expand Down

0 comments on commit 31b5380

Please sign in to comment.