diff --git a/GoCardless/GoCardless.csproj b/GoCardless/GoCardless.csproj index 3e383b8..eee94bf 100644 --- a/GoCardless/GoCardless.csproj +++ b/GoCardless/GoCardless.csproj @@ -2,7 +2,7 @@ GoCardless - 3.7.0 + 4.0.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.7.0 + https://github.com/gocardless/gocardless-dotnet/releases/tag/v4.0.0 netstandard1.6;netstandard2.0;net46 True true diff --git a/GoCardless/GoCardlessClient.cs b/GoCardless/GoCardlessClient.cs index 40c6876..29420ad 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.7.0"); + requestMessage.Headers.Add("User-Agent", "gocardless-dotnet/4.0.0"); requestMessage.Headers.Add("GoCardless-Version", "2015-07-06"); - requestMessage.Headers.Add("GoCardless-Client-Version", "3.7.0"); + requestMessage.Headers.Add("GoCardless-Client-Version", "4.0.0"); requestMessage.Headers.Add("GoCardless-Client-Library", "gocardless-dotnet"); requestMessage.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _accessToken); diff --git a/GoCardless/Resources/CreditorBankAccount.cs b/GoCardless/Resources/CreditorBankAccount.cs index 85a4744..33097fd 100644 --- a/GoCardless/Resources/CreditorBankAccount.cs +++ b/GoCardless/Resources/CreditorBankAccount.cs @@ -47,7 +47,7 @@ public class CreditorBankAccount /// details](#local-bank-details-united-states) for more information. /// [JsonProperty("account_type")] - public string AccountType { get; set; } + public CreditorBankAccountAccountType? AccountType { get; set; } /// /// Name of bank, taken from the bank details. diff --git a/GoCardless/Resources/Customer.cs b/GoCardless/Resources/Customer.cs index a2295a0..d0498f4 100644 --- a/GoCardless/Resources/Customer.cs +++ b/GoCardless/Resources/Customer.cs @@ -133,9 +133,9 @@ public class Customer /// /// The customer's address region, county or department. For US - /// customers a 2 letter state code ([ISO - /// 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) e.g CA) is - /// required. + /// customers a 2 letter + /// [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state + /// code is required (e.g. `CA` for California). /// [JsonProperty("region")] public string Region { get; set; } diff --git a/GoCardless/Resources/CustomerBankAccount.cs b/GoCardless/Resources/CustomerBankAccount.cs index 2323fe8..f989843 100644 --- a/GoCardless/Resources/CustomerBankAccount.cs +++ b/GoCardless/Resources/CustomerBankAccount.cs @@ -45,7 +45,7 @@ public class CustomerBankAccount /// details](#local-bank-details-united-states) for more information. /// [JsonProperty("account_type")] - public string AccountType { get; set; } + public CustomerBankAccountAccountType? AccountType { get; set; } /// /// Name of bank, taken from the bank details. diff --git a/GoCardless/Services/CreditorBankAccountService.cs b/GoCardless/Services/CreditorBankAccountService.cs index e1ad54d..91b316e 100644 --- a/GoCardless/Services/CreditorBankAccountService.cs +++ b/GoCardless/Services/CreditorBankAccountService.cs @@ -192,7 +192,7 @@ public class CreditorBankAccountCreateRequest : IHasIdempotencyKey /// details](#local-bank-details-united-states) for more information. /// [JsonProperty("account_type")] - public string AccountType { get; set; } + public CreditorBankAccountAccountType? AccountType { get; set; } /// /// Bank account type. Required for USD-denominated bank accounts. Must diff --git a/GoCardless/Services/CustomerBankAccountService.cs b/GoCardless/Services/CustomerBankAccountService.cs index 65f6317..f48760f 100644 --- a/GoCardless/Services/CustomerBankAccountService.cs +++ b/GoCardless/Services/CustomerBankAccountService.cs @@ -235,7 +235,7 @@ public class CustomerBankAccountCreateRequest : IHasIdempotencyKey /// details](#local-bank-details-united-states) for more information. /// [JsonProperty("account_type")] - public string AccountType { get; set; } + public CustomerBankAccountAccountType? AccountType { get; set; } /// /// Bank account type. Required for USD-denominated bank accounts. Must diff --git a/GoCardless/Services/CustomerService.cs b/GoCardless/Services/CustomerService.cs index bb97a21..c80e39b 100644 --- a/GoCardless/Services/CustomerService.cs +++ b/GoCardless/Services/CustomerService.cs @@ -285,9 +285,9 @@ public class CustomerCreateRequest : IHasIdempotencyKey /// /// The customer's address region, county or department. For US - /// customers a 2 letter state code ([ISO - /// 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) e.g CA) is - /// required. + /// customers a 2 letter + /// [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state + /// code is required (e.g. `CA` for California). /// [JsonProperty("region")] public string Region { get; set; } @@ -535,9 +535,9 @@ public class CustomerUpdateRequest /// /// The customer's address region, county or department. For US - /// customers a 2 letter state code ([ISO - /// 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) e.g CA) is - /// required. + /// customers a 2 letter + /// [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state + /// code is required (e.g. `CA` for California). /// [JsonProperty("region")] public string Region { get; set; } diff --git a/GoCardless/Services/InstalmentScheduleService.cs b/GoCardless/Services/InstalmentScheduleService.cs index ec01423..ad3544b 100644 --- a/GoCardless/Services/InstalmentScheduleService.cs +++ b/GoCardless/Services/InstalmentScheduleService.cs @@ -189,6 +189,27 @@ public Task GetAsync(string identity, InstalmentSche return _goCardlessClient.ExecuteAsync("GET", "/instalment_schedules/:identity", urlParams, request, null, null, customiseRequestMessage); } + /// + /// Updates an instalment schedule. This accepts only the metadata + /// parameter. + /// + /// Unique identifier, beginning with "IS". + /// An optional `InstalmentScheduleUpdateRequest` representing the body for this update request. + /// An optional `RequestSettings` allowing you to configure the request + /// A single instalment schedule resource + public Task UpdateAsync(string identity, InstalmentScheduleUpdateRequest request = null, RequestSettings customiseRequestMessage = null) + { + request = request ?? new InstalmentScheduleUpdateRequest(); + if (identity == null) throw new ArgumentException(nameof(identity)); + + var urlParams = new List> + { + new KeyValuePair("identity", identity), + }; + + return _goCardlessClient.ExecuteAsync("PUT", "/instalment_schedules/:identity", urlParams, request, null, "instalment_schedules", customiseRequestMessage); + } + /// /// Immediately cancels an instalment schedule; no further payments will /// be collected for it. @@ -770,6 +791,22 @@ public class InstalmentScheduleGetRequest } + /// + /// Updates an instalment schedule. This accepts only the metadata + /// parameter. + /// + public class InstalmentScheduleUpdateRequest + { + + /// + /// 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; } + } + + /// /// Immediately cancels an instalment schedule; no further payments will be /// collected for it. diff --git a/GoCardless/Services/MandateImportEntryService.cs b/GoCardless/Services/MandateImportEntryService.cs index 36d486e..e8a6f1e 100644 --- a/GoCardless/Services/MandateImportEntryService.cs +++ b/GoCardless/Services/MandateImportEntryService.cs @@ -363,9 +363,9 @@ public class MandateImportEntryCustomer /// /// The customer's address region, county or department. For US - /// customers a 2 letter state code ([ISO - /// 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) e.g CA) - /// is required. + /// customers a 2 letter + /// [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) + /// state code is required (e.g. `CA` for California). /// [JsonProperty("region")] public string Region { get; set; } diff --git a/GoCardless/Services/MandatePdfService.cs b/GoCardless/Services/MandatePdfService.cs index 19e7248..ec22898 100644 --- a/GoCardless/Services/MandatePdfService.cs +++ b/GoCardless/Services/MandatePdfService.cs @@ -165,7 +165,7 @@ public class MandatePdfCreateRequest /// details](#local-bank-details-united-states) for more information. /// [JsonProperty("account_type")] - public string AccountType { get; set; } + public MandatePdfAccountType? AccountType { get; set; } /// /// Bank account type. Required for USD-denominated bank accounts. Must @@ -303,9 +303,9 @@ public class MandatePdfLinks /// /// The customer's address region, county or department. For US - /// customers a 2 letter state code ([ISO - /// 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) e.g CA) is - /// required. + /// customers a 2 letter + /// [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state + /// code is required (e.g. `CA` for California). /// [JsonProperty("region")] public string Region { get; set; } diff --git a/GoCardless/Services/RedirectFlowService.cs b/GoCardless/Services/RedirectFlowService.cs index c4cf7ed..2f4474c 100644 --- a/GoCardless/Services/RedirectFlowService.cs +++ b/GoCardless/Services/RedirectFlowService.cs @@ -192,16 +192,16 @@ public class RedirectFlowPrefilledBankAccount { /// - /// Bank account type. Required for USD-denominated bank accounts. - /// Must not be provided for bank accounts in other currencies. See - /// [local details](#local-bank-details-united-states) for more + /// Bank account type for USD-denominated bank accounts. Must not be + /// provided for bank accounts in other currencies. See [local + /// details](#local-bank-details-united-states) for more /// information. /// [JsonProperty("account_type")] - public string AccountType { get; set; } + public RedirectFlowAccountType? AccountType { get; set; } /// - /// Bank account type. Required for USD-denominated bank accounts. Must - /// not be provided for bank accounts in other currencies. See [local + /// Bank account type for USD-denominated bank accounts. Must not be + /// provided for bank accounts in other currencies. See [local /// details](#local-bank-details-united-states) for more information. /// [JsonConverter(typeof(StringEnumConverter))] diff --git a/README.md b/README.md index aef5d25..c6a5f5a 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.7.0` +`Install-Package GoCardless -Version 4.0.0` ## Usage