From cadb8a58b3666557099cc1509c9e3ed036ec5322 Mon Sep 17 00:00:00 2001 From: Robot Date: Wed, 15 Apr 2020 10:09:40 +0000 Subject: [PATCH 1/4] Update documentation --- GoCardless/Resources/Payment.cs | 5 ++--- GoCardless/Resources/Subscription.cs | 5 ++--- GoCardless/Services/InstalmentScheduleService.cs | 10 ++++------ GoCardless/Services/PaymentService.cs | 10 ++++------ GoCardless/Services/SubscriptionService.cs | 5 ++--- 5 files changed, 14 insertions(+), 21 deletions(-) diff --git a/GoCardless/Resources/Payment.cs b/GoCardless/Resources/Payment.cs index 31fd1df..e48188a 100644 --- a/GoCardless/Resources/Payment.cs +++ b/GoCardless/Resources/Payment.cs @@ -113,9 +113,8 @@ public class Payment public string Reference { get; set; } /// - /// On failure, automatically retry the payment using [Optimise Smart - /// Payment Retries](#optimise-smart-payment-retries). Default is - /// `false`. + /// On failure, automatically retry the payment using [intelligent + /// retries](#success-intelligent-retries). Default is `false`. /// [JsonProperty("retry_if_possible")] public bool? RetryIfPossible { get; set; } diff --git a/GoCardless/Resources/Subscription.cs b/GoCardless/Resources/Subscription.cs index 1b9a733..70383d8 100644 --- a/GoCardless/Resources/Subscription.cs +++ b/GoCardless/Resources/Subscription.cs @@ -206,9 +206,8 @@ public class Subscription public string PaymentReference { get; set; } /// - /// On failure, automatically retry payments using [Optimise Smart - /// Payment Retries](#optimise-smart-payment-retries). Default is - /// `false`. + /// On failure, automatically retry payments using [intelligent + /// retries](#success-intelligent-retries). Default is `false`. /// [JsonProperty("retry_if_possible")] public bool? RetryIfPossible { get; set; } diff --git a/GoCardless/Services/InstalmentScheduleService.cs b/GoCardless/Services/InstalmentScheduleService.cs index ae88a85..ec01423 100644 --- a/GoCardless/Services/InstalmentScheduleService.cs +++ b/GoCardless/Services/InstalmentScheduleService.cs @@ -388,9 +388,8 @@ public class InstalmentScheduleLinks public string PaymentReference { get; set; } /// - /// On failure, automatically retry payments using [Optimise Smart - /// Payment - /// Retries](#optimise-smart-payment-retries). Default is `false`. + /// On failure, automatically retry payments using [intelligent + /// retries](#success-intelligent-retries). Default is `false`. /// [JsonProperty("retry_if_possible")] public bool? RetryIfPossible { get; set; } @@ -617,9 +616,8 @@ public class InstalmentScheduleLinks public string PaymentReference { get; set; } /// - /// On failure, automatically retry payments using [Optimise Smart - /// Payment - /// Retries](#optimise-smart-payment-retries). Default is `false`. + /// On failure, automatically retry payments using [intelligent + /// retries](#success-intelligent-retries). Default is `false`. /// [JsonProperty("retry_if_possible")] public bool? RetryIfPossible { get; set; } diff --git a/GoCardless/Services/PaymentService.cs b/GoCardless/Services/PaymentService.cs index 35f1874..86ae89c 100644 --- a/GoCardless/Services/PaymentService.cs +++ b/GoCardless/Services/PaymentService.cs @@ -348,9 +348,8 @@ public class PaymentLinks public string Reference { get; set; } /// - /// On failure, automatically retry the payment using [Optimise Smart - /// Payment Retries](#optimise-smart-payment-retries). Default is - /// `false`. + /// On failure, automatically retry the payment using [intelligent + /// retries](#success-intelligent-retries). Default is `false`. /// [JsonProperty("retry_if_possible")] public bool? RetryIfPossible { get; set; } @@ -633,9 +632,8 @@ public class PaymentUpdateRequest public IDictionary Metadata { get; set; } /// - /// On failure, automatically retry the payment using [Optimise Smart - /// Payment Retries](#optimise-smart-payment-retries). Default is - /// `false`. + /// On failure, automatically retry the payment using [intelligent + /// retries](#success-intelligent-retries). Default is `false`. /// [JsonProperty("retry_if_possible")] public bool? RetryIfPossible { get; set; } diff --git a/GoCardless/Services/SubscriptionService.cs b/GoCardless/Services/SubscriptionService.cs index 766122f..99aa8db 100644 --- a/GoCardless/Services/SubscriptionService.cs +++ b/GoCardless/Services/SubscriptionService.cs @@ -546,9 +546,8 @@ public enum SubscriptionMonth public string PaymentReference { get; set; } /// - /// On failure, automatically retry payments using [Optimise Smart - /// Payment Retries](#optimise-smart-payment-retries). Default is - /// `false`. + /// On failure, automatically retry payments using [intelligent + /// retries](#success-intelligent-retries). Default is `false`. /// [JsonProperty("retry_if_possible")] public bool? RetryIfPossible { get; set; } From 11beaeed8a856a0640e016bdd5207b7063bfb841 Mon Sep 17 00:00:00 2001 From: Robot Date: Wed, 15 Apr 2020 17:03:04 +0000 Subject: [PATCH 2/4] Update subscriptions documentation --- GoCardless/Services/SubscriptionService.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/GoCardless/Services/SubscriptionService.cs b/GoCardless/Services/SubscriptionService.cs index 99aa8db..73bc328 100644 --- a/GoCardless/Services/SubscriptionService.cs +++ b/GoCardless/Services/SubscriptionService.cs @@ -289,6 +289,8 @@ public Task PauseAsync(string identity, SubscriptionPauseR /// Resume a subscription object. /// Payments will start to be created again based on the subscriptions /// recurrence rules. + /// The `charge_date` on the next payment will be the same as the + /// subscriptions `earliest_charge_date_after_resume` /// /// This fails with: /// @@ -301,9 +303,6 @@ public Task PauseAsync(string identity, SubscriptionPauseR /// /// - `subscription_not_paused` if the subscription is not paused. /// - /// - `subscription_already_scheduled_to_resume` if a subscription - /// already has a scheduled resume date. - /// /// /// Unique identifier, beginning with "SB". /// An optional `SubscriptionResumeRequest` representing the body for this resume request. @@ -842,6 +841,8 @@ public class SubscriptionPauseRequest /// Resume a subscription object. /// Payments will start to be created again based on the subscriptions /// recurrence rules. + /// The `charge_date` on the next payment will be the same as the + /// subscriptions `earliest_charge_date_after_resume` /// /// This fails with: /// @@ -854,9 +855,6 @@ public class SubscriptionPauseRequest /// /// - `subscription_not_paused` if the subscription is not paused. /// - /// - `subscription_already_scheduled_to_resume` if a subscription already - /// has a scheduled resume date. - /// /// public class SubscriptionResumeRequest { From e1db62faace61f4eeb17731538d84f31ffbce810 Mon Sep 17 00:00:00 2001 From: Robot Date: Mon, 20 Apr 2020 12:58:27 +0000 Subject: [PATCH 3/4] Add metadata to payouts, and also add an update payout route --- GoCardless/Resources/Payout.cs | 7 +++++ GoCardless/Services/PayoutService.cs | 42 ++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/GoCardless/Resources/Payout.cs b/GoCardless/Resources/Payout.cs index 6b9a4b8..3990190 100644 --- a/GoCardless/Resources/Payout.cs +++ b/GoCardless/Resources/Payout.cs @@ -89,6 +89,13 @@ public class Payout [JsonProperty("links")] public PayoutLinks Links { get; set; } + /// + /// Key-value store of custom data. Up to 3 keys are permitted, with key + /// names up to 50 characters and values up to 500 characters. + /// + [JsonProperty("metadata")] + public IDictionary Metadata { get; set; } + /// /// Whether a payout contains merchant revenue or partner fees. /// diff --git a/GoCardless/Services/PayoutService.cs b/GoCardless/Services/PayoutService.cs index 31f20df..ae4f0e8 100644 --- a/GoCardless/Services/PayoutService.cs +++ b/GoCardless/Services/PayoutService.cs @@ -113,6 +113,26 @@ public Task GetAsync(string identity, PayoutGetRequest request = return _goCardlessClient.ExecuteAsync("GET", "/payouts/:identity", urlParams, request, null, null, customiseRequestMessage); } + + /// + /// Updates a payout object. This accepts only the metadata parameter. + /// + /// Unique identifier, beginning with "PO". + /// An optional `PayoutUpdateRequest` representing the body for this update request. + /// An optional `RequestSettings` allowing you to configure the request + /// A single payout resource + public Task UpdateAsync(string identity, PayoutUpdateRequest request = null, RequestSettings customiseRequestMessage = null) + { + request = request ?? new PayoutUpdateRequest(); + if (identity == null) throw new ArgumentException(nameof(identity)); + + var urlParams = new List> + { + new KeyValuePair("identity", identity), + }; + + return _goCardlessClient.ExecuteAsync("PUT", "/payouts/:identity", urlParams, request, null, "payouts", customiseRequestMessage); + } } @@ -232,6 +252,13 @@ public enum PayoutCurrency [JsonProperty("limit")] public int? Limit { get; set; } + /// + /// Key-value store of custom data. Up to 3 keys are permitted, with key + /// names up to 50 characters and values up to 500 characters. + /// + [JsonProperty("metadata")] + public IDictionary Metadata { get; set; } + /// /// Whether a payout contains merchant revenue or partner fees. /// @@ -308,6 +335,21 @@ public class PayoutGetRequest { } + + /// + /// Updates a payout object. This accepts only the metadata parameter. + /// + public class PayoutUpdateRequest + { + + /// + /// Key-value store of custom data. Up to 3 keys are permitted, with key + /// names up to 50 characters and values up to 500 characters. + /// + [JsonProperty("metadata")] + public IDictionary Metadata { get; set; } + } + /// /// An API response for a request returning a single payout. /// From a874c4206dbc2e9b60b6fb827e8c5d9a1a172d0e Mon Sep 17 00:00:00 2001 From: Robot Date: Mon, 20 Apr 2020 13:35:18 +0000 Subject: [PATCH 4/4] Bump minor version to 3.6.0 --- GoCardless/GoCardless.csproj | 4 ++-- GoCardless/GoCardlessClient.cs | 4 ++-- README.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/GoCardless/GoCardless.csproj b/GoCardless/GoCardless.csproj index ff6f39c..ab26fd7 100644 --- a/GoCardless/GoCardless.csproj +++ b/GoCardless/GoCardless.csproj @@ -2,7 +2,7 @@ GoCardless - 3.5.2 + 3.6.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/v3.5.2 + https://github.com/gocardless/gocardless-dotnet/releases/tag/v3.6.0 netstandard1.6;netstandard2.0;net46 True true diff --git a/GoCardless/GoCardlessClient.cs b/GoCardless/GoCardlessClient.cs index e138f86..e4885f8 100644 --- a/GoCardless/GoCardlessClient.cs +++ b/GoCardless/GoCardlessClient.cs @@ -252,9 +252,9 @@ private HttpRequestMessage BuildHttpRequestMessage(string method, string path var httpMethod = new HttpMethod(method); var requestMessage = new HttpRequestMessage(httpMethod, new Uri(_baseUrl, path)); - requestMessage.Headers.Add("User-Agent", "gocardless-dotnet/3.5.2"); + requestMessage.Headers.Add("User-Agent", "gocardless-dotnet/3.6.0"); requestMessage.Headers.Add("GoCardless-Version", "2015-07-06"); - requestMessage.Headers.Add("GoCardless-Client-Version", "3.5.2"); + requestMessage.Headers.Add("GoCardless-Client-Version", "3.6.0"); requestMessage.Headers.Add("GoCardless-Client-Library", "gocardless-dotnet"); requestMessage.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _accessToken); diff --git a/README.md b/README.md index d4e23af..ac6baed 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 3.5.2` +`Install-Package GoCardless -Version 3.6.0` ## Usage