From 7837c91f4bdba588ff9b946d092dab07486e5d64 Mon Sep 17 00:00:00 2001 From: oobayly Date: Tue, 13 Jan 2015 17:44:33 +0000 Subject: [PATCH 1/6] Added PayoutId property to Payload.Bill --- GoCardlessSdk/WebHooks/GoCardlessRequest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/GoCardlessSdk/WebHooks/GoCardlessRequest.cs b/GoCardlessSdk/WebHooks/GoCardlessRequest.cs index cc7accd..4210c39 100644 --- a/GoCardlessSdk/WebHooks/GoCardlessRequest.cs +++ b/GoCardlessSdk/WebHooks/GoCardlessRequest.cs @@ -18,6 +18,7 @@ public class Payload public class Bill { public string Id { get; set; } + public string PayoutId { get; set; } public string Status { get; set; } public string SourceType { get; set; } public string SourceId { get; set; } From b69a6382fe987da0271f29289417f56940c48f08 Mon Sep 17 00:00:00 2001 From: oobayly Date: Mon, 26 Jan 2015 14:37:11 +0000 Subject: [PATCH 2/6] Add StatusCode property to ApiException --- GoCardlessSdk/Connect/ConnectClient.cs | 2 +- GoCardlessSdk/Exceptions.cs | 2 ++ GoCardlessSdk/Partners/PartnerClient.cs | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/GoCardlessSdk/Connect/ConnectClient.cs b/GoCardlessSdk/Connect/ConnectClient.cs index 0e78394..a5035c9 100644 --- a/GoCardlessSdk/Connect/ConnectClient.cs +++ b/GoCardlessSdk/Connect/ConnectClient.cs @@ -161,7 +161,7 @@ public ConfirmResource ConfirmResource(NameValueCollection requestContent) var response = client.Execute(request); if (response.StatusCode != HttpStatusCode.OK) { - throw new ApiException("Unexpected response : " + (int)response.StatusCode + " " + response.StatusCode); + throw new ApiException("Unexpected response : " + (int)response.StatusCode + " " + response.StatusCode) { StatusCode = response.StatusCode }; } return resource; diff --git a/GoCardlessSdk/Exceptions.cs b/GoCardlessSdk/Exceptions.cs index dce919b..6e23a90 100644 --- a/GoCardlessSdk/Exceptions.cs +++ b/GoCardlessSdk/Exceptions.cs @@ -11,6 +11,8 @@ public ApiException(string message) : base(message) public JObject Content { get; set; } public string RawContent { get; set; } + + public System.Net.HttpStatusCode StatusCode { get; set; } } public class ClientException : Exception { diff --git a/GoCardlessSdk/Partners/PartnerClient.cs b/GoCardlessSdk/Partners/PartnerClient.cs index 103acf2..b4bf067 100644 --- a/GoCardlessSdk/Partners/PartnerClient.cs +++ b/GoCardlessSdk/Partners/PartnerClient.cs @@ -54,7 +54,8 @@ public MerchantAccessTokenResponse ParseCreateMerchantResponse(string redirectUr { throw new ApiException("Invalid response getting access token from " + tokenUrl) { - Content = JObject.Parse(response.Content) + Content = JObject.Parse(response.Content), + StatusCode = response.StatusCode, }; } } From 8dd710bd24112db60936bd38cc50c17d1f27c3f9 Mon Sep 17 00:00:00 2001 From: oobayly Date: Wed, 22 Apr 2015 09:43:31 +0100 Subject: [PATCH 3/6] Update Nuget packages --- GoCardlessSdk/GoCardlessSdk.csproj | 10 ++++++---- GoCardlessSdk/packages.config | 4 ++-- Sample.Mvc3/Sample.Mvc3.csproj | 1 + 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/GoCardlessSdk/GoCardlessSdk.csproj b/GoCardlessSdk/GoCardlessSdk.csproj index 91d446c..bce8d3a 100644 --- a/GoCardlessSdk/GoCardlessSdk.csproj +++ b/GoCardlessSdk/GoCardlessSdk.csproj @@ -34,11 +34,13 @@ 4 - - ..\packages\Newtonsoft.Json.5.0.2\lib\net35\Newtonsoft.Json.dll + + False + ..\..\TipsTrade Applications\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll - - ..\packages\RestSharp.104.1\lib\net35\RestSharp.dll + + False + ..\..\TipsTrade Applications\packages\RestSharp.105.0.1\lib\net35\RestSharp.dll diff --git a/GoCardlessSdk/packages.config b/GoCardlessSdk/packages.config index 230d023..15ab8ab 100644 --- a/GoCardlessSdk/packages.config +++ b/GoCardlessSdk/packages.config @@ -1,5 +1,5 @@  - - + + \ No newline at end of file diff --git a/Sample.Mvc3/Sample.Mvc3.csproj b/Sample.Mvc3/Sample.Mvc3.csproj index 886055b..761a0fe 100644 --- a/Sample.Mvc3/Sample.Mvc3.csproj +++ b/Sample.Mvc3/Sample.Mvc3.csproj @@ -21,6 +21,7 @@ 4.0 + true true From 5a4597f513903e3115db193d50df96454199018c Mon Sep 17 00:00:00 2001 From: oobayly Date: Wed, 22 Apr 2015 09:44:18 +0100 Subject: [PATCH 4/6] Fix breaking change caused by REST library --- GoCardlessSdk/Api/ApiClient.cs | 2 +- GoCardlessSdk/Connect/ConnectClient.cs | 2 +- GoCardlessSdk/Partners/PartnerClient.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/GoCardlessSdk/Api/ApiClient.cs b/GoCardlessSdk/Api/ApiClient.cs index ee25664..208d077 100644 --- a/GoCardlessSdk/Api/ApiClient.cs +++ b/GoCardlessSdk/Api/ApiClient.cs @@ -131,7 +131,7 @@ private static Dictionary ToHash(object obj) { var client = new RestClient { - BaseUrl = ApiUrl, + BaseUrl = new Uri(ApiUrl), UserAgent = GoCardless.UserAgent }; var serializer = new Newtonsoft.Json.JsonSerializer diff --git a/GoCardlessSdk/Connect/ConnectClient.cs b/GoCardlessSdk/Connect/ConnectClient.cs index a5035c9..2f55224 100644 --- a/GoCardlessSdk/Connect/ConnectClient.cs +++ b/GoCardlessSdk/Connect/ConnectClient.cs @@ -149,7 +149,7 @@ public ConfirmResource ConfirmResource(NameValueCollection requestContent) var client = new RestClient { - BaseUrl = ApiClient.ApiUrl, + BaseUrl = new Uri(ApiClient.ApiUrl), UserAgent = GoCardless.UserAgent }; var serializer = new JsonSerializer diff --git a/GoCardlessSdk/Partners/PartnerClient.cs b/GoCardlessSdk/Partners/PartnerClient.cs index b4bf067..d3d2a31 100644 --- a/GoCardlessSdk/Partners/PartnerClient.cs +++ b/GoCardlessSdk/Partners/PartnerClient.cs @@ -36,7 +36,7 @@ public MerchantAccessTokenResponse ParseCreateMerchantResponse(string redirectUr var client = new RestClient { - BaseUrl = GoCardless.BaseUrl, + BaseUrl = new System.Uri( GoCardless.BaseUrl), UserAgent = GoCardless.UserAgent }; client.Authenticator = new HttpBasicAuthenticator(GoCardless.AccountDetails.AppId, GoCardless.AccountDetails.AppSecret); From 5730807e70a5b23c22a608409780cfb8266cc901 Mon Sep 17 00:00:00 2001 From: oobayly Date: Thu, 18 Jun 2015 14:34:03 +0100 Subject: [PATCH 5/6] Update RestSharp --- GoCardlessSdk/GoCardlessSdk.csproj | 4 ++-- GoCardlessSdk/packages.config | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/GoCardlessSdk/GoCardlessSdk.csproj b/GoCardlessSdk/GoCardlessSdk.csproj index bce8d3a..abb1833 100644 --- a/GoCardlessSdk/GoCardlessSdk.csproj +++ b/GoCardlessSdk/GoCardlessSdk.csproj @@ -38,9 +38,9 @@ False ..\..\TipsTrade Applications\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll - + False - ..\..\TipsTrade Applications\packages\RestSharp.105.0.1\lib\net35\RestSharp.dll + ..\..\TipsTrade Applications\packages\RestSharp.105.1.0\lib\net35\RestSharp.dll diff --git a/GoCardlessSdk/packages.config b/GoCardlessSdk/packages.config index 15ab8ab..44e0b65 100644 --- a/GoCardlessSdk/packages.config +++ b/GoCardlessSdk/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file From 150bee03918fa17aa35e3caf41ea8bc2739e3167 Mon Sep 17 00:00:00 2001 From: oobayly Date: Tue, 12 Jul 2016 10:14:25 +0100 Subject: [PATCH 6/6] Update nuget packages --- GoCardlessSdk/Connect/ConnectClient.cs | 11 ++++++----- GoCardlessSdk/GoCardlessSdk.csproj | 12 ++++++------ GoCardlessSdk/Partners/PartnerClient.cs | 1 + GoCardlessSdk/packages.config | 4 ++-- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/GoCardlessSdk/Connect/ConnectClient.cs b/GoCardlessSdk/Connect/ConnectClient.cs index 2f55224..85b0190 100644 --- a/GoCardlessSdk/Connect/ConnectClient.cs +++ b/GoCardlessSdk/Connect/ConnectClient.cs @@ -5,6 +5,7 @@ using GoCardlessSdk.Helpers; using Newtonsoft.Json; using RestSharp; +using RestSharp.Authenticators; namespace GoCardlessSdk.Connect { @@ -40,11 +41,11 @@ private static Utils.HashParams SignParams(Utils.HashParams @params) private static string GenerateNewLimitUrl(string type, object requestResource, string redirectUri = null, string cancelUri = null, string state = null) { - var hash = new Utils.HashParams - { - {"client_id", GoCardless.AccountDetails.AppId}, - {"nonce", GoCardless.GenerateNonce()}, - {"timestamp", GoCardless.GetUtcNow().IsoFormatTime()}, + var hash = new Utils.HashParams + { + {"client_id", GoCardless.AccountDetails.AppId}, + {"nonce", GoCardless.GenerateNonce()}, + {"timestamp", GoCardless.GetUtcNow().IsoFormatTime()}, }; hash = requestResource.ToHashParams(hash, type); diff --git a/GoCardlessSdk/GoCardlessSdk.csproj b/GoCardlessSdk/GoCardlessSdk.csproj index abb1833..08a3e06 100644 --- a/GoCardlessSdk/GoCardlessSdk.csproj +++ b/GoCardlessSdk/GoCardlessSdk.csproj @@ -34,13 +34,13 @@ 4 - - False - ..\..\TipsTrade Applications\packages\Newtonsoft.Json.6.0.8\lib\net35\Newtonsoft.Json.dll + + ..\..\TipsTrade Applications\packages\Newtonsoft.Json.9.0.1\lib\net35\Newtonsoft.Json.dll + True - - False - ..\..\TipsTrade Applications\packages\RestSharp.105.1.0\lib\net35\RestSharp.dll + + ..\..\TipsTrade Applications\packages\RestSharp.105.2.3\lib\net35\RestSharp.dll + True diff --git a/GoCardlessSdk/Partners/PartnerClient.cs b/GoCardlessSdk/Partners/PartnerClient.cs index d3d2a31..a100af7 100644 --- a/GoCardlessSdk/Partners/PartnerClient.cs +++ b/GoCardlessSdk/Partners/PartnerClient.cs @@ -3,6 +3,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using RestSharp; +using RestSharp.Authenticators; namespace GoCardlessSdk.Partners { diff --git a/GoCardlessSdk/packages.config b/GoCardlessSdk/packages.config index 44e0b65..1e88ec5 100644 --- a/GoCardlessSdk/packages.config +++ b/GoCardlessSdk/packages.config @@ -1,5 +1,5 @@  - - + + \ No newline at end of file