diff --git a/GoCardless/GoCardless.csproj b/GoCardless/GoCardless.csproj index 213350a..9d58c7b 100644 --- a/GoCardless/GoCardless.csproj +++ b/GoCardless/GoCardless.csproj @@ -2,7 +2,7 @@ GoCardless - 6.2.0 + 6.3.0 GoCardless Ltd Client for the GoCardless API - a powerful, simple solution for the collection of recurring bank-to-bank payments false @@ -11,7 +11,7 @@ GoCardless Ltd gocardless payments rest api direct debit https://github.com/gocardless/gocardless-dotnet/blob/master/LICENSE.txt - https://github.com/gocardless/gocardless-dotnet/releases/tag/v6.2.0 + https://github.com/gocardless/gocardless-dotnet/releases/tag/v6.3.0 netstandard1.6;netstandard2.0;netstandard2.1;net46;net8.0 True true diff --git a/GoCardless/GoCardlessClient.cs b/GoCardless/GoCardlessClient.cs index 8afafd4..11886a0 100644 --- a/GoCardless/GoCardlessClient.cs +++ b/GoCardless/GoCardlessClient.cs @@ -277,11 +277,11 @@ private HttpRequestMessage BuildHttpRequestMessage(string method, string path runtimeFrameworkInformation = System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion(); #endif - var userAgentInformation = $" gocardless-dotnet/6.2.0 {runtimeFrameworkInformation} {Helpers.CleanupOSDescriptionString(OSRunningOn)}"; + var userAgentInformation = $" gocardless-dotnet/6.3.0 {runtimeFrameworkInformation} {Helpers.CleanupOSDescriptionString(OSRunningOn)}"; requestMessage.Headers.Add("User-Agent", userAgentInformation); requestMessage.Headers.Add("GoCardless-Version", "2015-07-06"); - requestMessage.Headers.Add("GoCardless-Client-Version", "6.2.0"); + requestMessage.Headers.Add("GoCardless-Client-Version", "6.3.0"); requestMessage.Headers.Add("GoCardless-Client-Library", "gocardless-dotnet"); requestMessage.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _accessToken); diff --git a/GoCardless/Services/LogoService.cs b/GoCardless/Services/LogoService.cs index e0fff71..b19e885 100644 --- a/GoCardless/Services/LogoService.cs +++ b/GoCardless/Services/LogoService.cs @@ -38,22 +38,18 @@ public LogoService(GoCardlessClient goCardlessClient) /// Creates a new logo associated with a creditor. If a creditor already /// has a logo, this will update the existing logo linked to the /// creditor. - /// - /// Unique identifier, beginning with "CR". + /// /// An optional `LogoCreateForCreditorRequest` representing the body for this create_for_creditor request. /// An optional `RequestSettings` allowing you to configure the request /// A single logo resource - public Task CreateForCreditorAsync(string identity, LogoCreateForCreditorRequest request = null, RequestSettings customiseRequestMessage = null) + public Task CreateForCreditorAsync(LogoCreateForCreditorRequest request = null, RequestSettings customiseRequestMessage = null) { request = request ?? new LogoCreateForCreditorRequest(); - if (identity == null) throw new ArgumentException(nameof(identity)); var urlParams = new List> - { - new KeyValuePair("identity", identity), - }; + {}; - return _goCardlessClient.ExecuteAsync("POST", "/creditors/:identity/branding/logos", urlParams, request, null, "logos", customiseRequestMessage); + return _goCardlessClient.ExecuteAsync("POST", "/branding/logos", urlParams, request, null, "logos", customiseRequestMessage); } } @@ -64,6 +60,30 @@ public Task CreateForCreditorAsync(string identity, LogoCreateForC /// public class LogoCreateForCreditorRequest { + + /// + /// Base64 encoded string. + /// + [JsonProperty("image")] + public string Image { get; set; } + + /// + /// Linked resources. + /// + [JsonProperty("links")] + public LogoLinks Links { get; set; } + /// + /// Linked resources for a Logo. + /// + public class LogoLinks + { + + /// + /// ID of the creditor the payer theme belongs to + /// + [JsonProperty("creditor")] + public string Creditor { get; set; } + } } /// diff --git a/GoCardless/Services/PayerThemeService.cs b/GoCardless/Services/PayerThemeService.cs index 756e4db..857f68a 100644 --- a/GoCardless/Services/PayerThemeService.cs +++ b/GoCardless/Services/PayerThemeService.cs @@ -36,22 +36,18 @@ public PayerThemeService(GoCardlessClient goCardlessClient) /// Creates a new payer theme associated with a creditor. If a creditor /// already has payer themes, this will update the existing payer theme /// linked to the creditor. - /// - /// Unique identifier, beginning with "CR". + /// /// An optional `PayerThemeCreateForCreditorRequest` representing the body for this create_for_creditor request. /// An optional `RequestSettings` allowing you to configure the request /// A single payer theme resource - public Task CreateForCreditorAsync(string identity, PayerThemeCreateForCreditorRequest request = null, RequestSettings customiseRequestMessage = null) + public Task CreateForCreditorAsync(PayerThemeCreateForCreditorRequest request = null, RequestSettings customiseRequestMessage = null) { request = request ?? new PayerThemeCreateForCreditorRequest(); - if (identity == null) throw new ArgumentException(nameof(identity)); var urlParams = new List> - { - new KeyValuePair("identity", identity), - }; + {}; - return _goCardlessClient.ExecuteAsync("POST", "/creditors/:identity/branding/payer_themes", urlParams, request, null, "payer_themes", customiseRequestMessage); + return _goCardlessClient.ExecuteAsync("POST", "/branding/payer_themes", urlParams, request, null, "payer_themes", customiseRequestMessage); } } @@ -87,6 +83,24 @@ public class PayerThemeCreateForCreditorRequest /// [JsonProperty("link_text_colour")] public string LinkTextColour { get; set; } + + /// + /// Linked resources. + /// + [JsonProperty("links")] + public PayerThemeLinks Links { get; set; } + /// + /// Linked resources for a PayerTheme. + /// + public class PayerThemeLinks + { + + /// + /// ID of the creditor the payer theme belongs to + /// + [JsonProperty("creditor")] + public string Creditor { get; set; } + } } /// diff --git a/README.md b/README.md index 3c12664..a082484 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ For full details of the GoCardless API, see the [API docs](https://developer.goc To install `GoCardless`, run the following command in the [Package Manager Console](https://docs.microsoft.com/en-us/nuget/tools/package-manager-console) -`Install-Package GoCardless -Version 6.2.0` +`Install-Package GoCardless -Version 6.3.0` ## Usage