diff --git a/GoCardless/GoCardless.csproj b/GoCardless/GoCardless.csproj index b1df481..9ae0e64 100644 --- a/GoCardless/GoCardless.csproj +++ b/GoCardless/GoCardless.csproj @@ -2,7 +2,7 @@ GoCardless - 2.13.0 + 2.15.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/v2.13.0 + https://github.com/gocardless/gocardless-dotnet/releases/tag/v2.15.0 netstandard1.6;netstandard2.0;net452 True true diff --git a/GoCardless/GoCardlessClient.cs b/GoCardless/GoCardlessClient.cs index 8536e47..1281ff1 100644 --- a/GoCardless/GoCardlessClient.cs +++ b/GoCardless/GoCardlessClient.cs @@ -228,9 +228,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/2.13.0"); + requestMessage.Headers.Add("User-Agent", "gocardless-dotnet/2.15.0"); requestMessage.Headers.Add("GoCardless-Version", "2015-07-06"); - requestMessage.Headers.Add("GoCardless-Client-Version", "2.13.0"); + requestMessage.Headers.Add("GoCardless-Client-Version", "2.15.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 0362ce0..c9a9fa2 100644 --- a/GoCardless/Resources/CreditorBankAccount.cs +++ b/GoCardless/Resources/CreditorBankAccount.cs @@ -42,9 +42,9 @@ public class CreditorBankAccount public string AccountNumberEnding { get; set; } /// - /// Bank account type. Only required for USD denominated bank accounts - - /// see [local details](#local-bank-details-united-states) for more - /// information. + /// 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 information. /// [JsonProperty("account_type")] public string AccountType { get; set; } @@ -106,8 +106,9 @@ public class CreditorBankAccount } /// - /// Bank account type. Only required for USD denominated bank accounts - see [local - /// details](#local-bank-details-united-states) for more information. + /// 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 information. /// [JsonConverter(typeof(StringEnumConverter))] public enum CreditorBankAccountAccountType { diff --git a/GoCardless/Resources/CustomerBankAccount.cs b/GoCardless/Resources/CustomerBankAccount.cs index fcc6737..3cf97d9 100644 --- a/GoCardless/Resources/CustomerBankAccount.cs +++ b/GoCardless/Resources/CustomerBankAccount.cs @@ -39,9 +39,9 @@ public class CustomerBankAccount public string AccountNumberEnding { get; set; } /// - /// Bank account type. Only required for USD denominated bank accounts - - /// see [local details](#local-bank-details-united-states) for more - /// information. + /// 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 information. /// [JsonProperty("account_type")] public string AccountType { get; set; } @@ -103,8 +103,9 @@ public class CustomerBankAccount } /// - /// Bank account type. Only required for USD denominated bank accounts - see [local - /// details](#local-bank-details-united-states) for more information. + /// 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 information. /// [JsonConverter(typeof(StringEnumConverter))] public enum CustomerBankAccountAccountType { diff --git a/GoCardless/Resources/Mandate.cs b/GoCardless/Resources/Mandate.cs index 60318bf..c11915a 100644 --- a/GoCardless/Resources/Mandate.cs +++ b/GoCardless/Resources/Mandate.cs @@ -26,7 +26,8 @@ public class Mandate public DateTimeOffset? CreatedAt { get; set; } /// - /// Unique identifier, beginning with "MD". + /// Unique identifier, beginning with "MD". Note that this prefix may + /// not apply to mandates created before 2016. /// [JsonProperty("id")] public string Id { get; set; } diff --git a/GoCardless/Resources/PayoutItem.cs b/GoCardless/Resources/PayoutItem.cs index 5be64ac..5556f87 100644 --- a/GoCardless/Resources/PayoutItem.cs +++ b/GoCardless/Resources/PayoutItem.cs @@ -70,6 +70,8 @@ public class PayoutItem /// customer. ///
  • `refund` (debit): private beta A refund sent to a /// customer, not linked to a payment.
  • + ///
  • `refund_funds_returned` (credit): The refund could not be sent + /// to the customer, and the funds have been returned to you.
  • ///
  • `gocardless_fee` (credit/debit): The fees that GoCardless /// charged for a payment. In the case of a payment failure or /// chargeback, these will appear as credits.
  • @@ -94,7 +96,8 @@ public class PayoutItem public class PayoutItemLinks { /// - /// Unique identifier, beginning with "MD". + /// Unique identifier, beginning with "MD". Note that this prefix may + /// not apply to mandates created before 2016. /// [JsonProperty("mandate")] public string Mandate { get; set; } @@ -115,6 +118,8 @@ public class PayoutItemLinks ///
  • `payment_refunded` (debit): The payment has been refunded to the customer.
  • ///
  • `refund` (debit): private beta A refund sent to a customer, not linked to a /// payment.
  • + ///
  • `refund_funds_returned` (credit): The refund could not be sent to the customer, and the + /// funds have been returned to you.
  • ///
  • `gocardless_fee` (credit/debit): The fees that GoCardless charged for a payment. In the /// case of a payment failure or chargeback, these will appear as credits.
  • ///
  • `app_fee` (credit/debit): The optional fees that a partner may have taken for a payment. diff --git a/GoCardless/Services/CreditorBankAccountService.cs b/GoCardless/Services/CreditorBankAccountService.cs index 3e8bb5f..42229e8 100644 --- a/GoCardless/Services/CreditorBankAccountService.cs +++ b/GoCardless/Services/CreditorBankAccountService.cs @@ -188,17 +188,17 @@ public class CreditorBankAccountCreateRequest : IHasIdempotencyKey public string AccountNumber { get; set; } /// - /// Bank account type. Only required for USD denominated bank accounts - - /// see [local details](#local-bank-details-united-states) for more - /// information. + /// 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 information. /// [JsonProperty("account_type")] public string AccountType { get; set; } /// - /// Bank account type. Only required for USD denominated bank accounts - - /// see [local details](#local-bank-details-united-states) for more - /// information. + /// 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 information. /// [JsonConverter(typeof(StringEnumConverter))] public enum CreditorBankAccountAccountType diff --git a/GoCardless/Services/CustomerBankAccountService.cs b/GoCardless/Services/CustomerBankAccountService.cs index 88916cb..d022a91 100644 --- a/GoCardless/Services/CustomerBankAccountService.cs +++ b/GoCardless/Services/CustomerBankAccountService.cs @@ -230,17 +230,17 @@ public class CustomerBankAccountCreateRequest : IHasIdempotencyKey public string AccountNumber { get; set; } /// - /// Bank account type. Only required for USD denominated bank accounts - - /// see [local details](#local-bank-details-united-states) for more - /// information. + /// 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 information. /// [JsonProperty("account_type")] public string AccountType { get; set; } /// - /// Bank account type. Only required for USD denominated bank accounts - - /// see [local details](#local-bank-details-united-states) for more - /// information. + /// 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 information. /// [JsonConverter(typeof(StringEnumConverter))] public enum CustomerBankAccountAccountType diff --git a/GoCardless/Services/CustomerNotificationService.cs b/GoCardless/Services/CustomerNotificationService.cs index 5456dcc..e7b86ac 100644 --- a/GoCardless/Services/CustomerNotificationService.cs +++ b/GoCardless/Services/CustomerNotificationService.cs @@ -55,7 +55,7 @@ public CustomerNotificationService(GoCardlessClient goCardlessClient) /// notify has passed, /// this endpoint will return an `already_actioned` error and you should /// not take - /// further action. + /// further action. This endpoint takes no additional parameters. /// /// /// The id of the notification. @@ -85,7 +85,7 @@ public Task HandleAsync(string identity, CustomerN /// has passed, /// this endpoint will return an `already_actioned` error and you should not /// take - /// further action. + /// further action. This endpoint takes no additional parameters. /// /// public class CustomerNotificationHandleRequest diff --git a/GoCardless/Services/CustomerService.cs b/GoCardless/Services/CustomerService.cs index 88c99d1..902bfb9 100644 --- a/GoCardless/Services/CustomerService.cs +++ b/GoCardless/Services/CustomerService.cs @@ -146,6 +146,34 @@ public Task UpdateAsync(string identity, CustomerUpdateRequest return _goCardlessClient.ExecuteAsync("PUT", "/customers/:identity", urlParams, request, null, "customers", customiseRequestMessage); } + + /// + /// Removed customers will not appear in search results or lists of + /// customers (in our API + /// or exports), and it will not be possible to load an individually + /// removed customer by + /// ID. + /// + ///

    The action of removing a + /// customer cannot be + /// reversed, so please use with care.

    + ///
    + /// Unique identifier, beginning with "CU". + /// An optional `CustomerRemoveRequest` representing the body for this remove request. + /// An optional `RequestSettings` allowing you to configure the request + /// A single customer resource + public Task RemoveAsync(string identity, CustomerRemoveRequest request = null, RequestSettings customiseRequestMessage = null) + { + request = request ?? new CustomerRemoveRequest(); + if (identity == null) throw new ArgumentException(nameof(identity)); + + var urlParams = new List> + { + new KeyValuePair("identity", identity), + }; + + return _goCardlessClient.ExecuteAsync("DELETE", "/customers/:identity", urlParams, request, null, null, customiseRequestMessage); + } } @@ -482,6 +510,22 @@ public class CustomerUpdateRequest public string SwedishIdentityNumber { get; set; } } + + /// + /// Removed customers will not appear in search results or lists of + /// customers (in our API + /// or exports), and it will not be possible to load an individually removed + /// customer by + /// ID. + /// + ///

    The action of removing a customer + /// cannot be + /// reversed, so please use with care.

    + ///
    + public class CustomerRemoveRequest + { + } + /// /// An API response for a request returning a single customer. /// diff --git a/GoCardless/Services/MandatePdfService.cs b/GoCardless/Services/MandatePdfService.cs index fb7cd3b..243016a 100644 --- a/GoCardless/Services/MandatePdfService.cs +++ b/GoCardless/Services/MandatePdfService.cs @@ -160,17 +160,17 @@ public class MandatePdfCreateRequest public string AccountNumber { get; set; } /// - /// Bank account type. Only required for USD denominated bank accounts - - /// see [local details](#local-bank-details-united-states) for more - /// information. + /// 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 information. /// [JsonProperty("account_type")] public string AccountType { get; set; } /// - /// Bank account type. Only required for USD denominated bank accounts - - /// see [local details](#local-bank-details-united-states) for more - /// information. + /// 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 information. /// [JsonConverter(typeof(StringEnumConverter))] public enum MandatePdfAccountType diff --git a/GoCardless/Services/MandateService.cs b/GoCardless/Services/MandateService.cs index 69879a5..d9bd92d 100644 --- a/GoCardless/Services/MandateService.cs +++ b/GoCardless/Services/MandateService.cs @@ -110,7 +110,7 @@ public IEnumerable>> AllAsync(MandateListRequest req /// /// Retrieves the details of an existing mandate. /// - /// Unique identifier, beginning with "MD". + /// Unique identifier, beginning with "MD". Note that this prefix may not apply to mandates created before 2016. /// An optional `MandateGetRequest` representing the query parameters for this get request. /// An optional `RequestSettings` allowing you to configure the request /// A single mandate resource @@ -130,7 +130,7 @@ public Task GetAsync(string identity, MandateGetRequest request /// /// Updates a mandate object. This accepts only the metadata parameter. /// - /// Unique identifier, beginning with "MD". + /// Unique identifier, beginning with "MD". Note that this prefix may not apply to mandates created before 2016. /// An optional `MandateUpdateRequest` representing the body for this update request. /// An optional `RequestSettings` allowing you to configure the request /// A single mandate resource @@ -155,7 +155,7 @@ public Task UpdateAsync(string identity, MandateUpdateRequest r /// This will fail with a `cancellation_failed` error if the mandate is /// already cancelled. /// - /// Unique identifier, beginning with "MD". + /// Unique identifier, beginning with "MD". Note that this prefix may not apply to mandates created before 2016. /// An optional `MandateCancelRequest` representing the body for this cancel request. /// An optional `RequestSettings` allowing you to configure the request /// A single mandate resource @@ -186,7 +186,7 @@ public Task CancelAsync(string identity, MandateCancelRequest r /// /// Mandates can be resubmitted up to 3 times. /// - /// Unique identifier, beginning with "MD". + /// Unique identifier, beginning with "MD". Note that this prefix may not apply to mandates created before 2016. /// An optional `MandateReinstateRequest` representing the body for this reinstate request. /// An optional `RequestSettings` allowing you to configure the request /// A single mandate resource diff --git a/GoCardless/Services/PaymentService.cs b/GoCardless/Services/PaymentService.cs index 475d527..673f421 100644 --- a/GoCardless/Services/PaymentService.cs +++ b/GoCardless/Services/PaymentService.cs @@ -373,6 +373,43 @@ public class PaymentListRequest [JsonProperty("before")] public string Before { get; set; } + [JsonProperty("charge_date")] + public PaymentChargeDate ChargeDate { get; set; } + /// + /// + /// + public class PaymentChargeDate + { + + /// + /// Limit to records where the payment was or will be collected from + /// the customer's bank account after the specified date. + /// + [JsonProperty("gt")] + public string Gt { get; set; } + + /// + /// Limit to records where the payment was or will be collected from + /// the customer's bank account on or after the specified date. + /// + [JsonProperty("gte")] + public string Gte { get; set; } + + /// + /// Limit to records where the payment was or will be collected from + /// the customer's bank account before the specified date. + /// + [JsonProperty("lt")] + public string Lt { get; set; } + + /// + /// Limit to records where the payment was or will be collected from + /// the customer's bank account on or before the specified date. + /// + [JsonProperty("lte")] + public string Lte { get; set; } + } + /// /// Limit to records created within certain times. /// @@ -473,7 +510,8 @@ public enum PaymentCurrency public int? Limit { get; set; } /// - /// Unique identifier, beginning with "MD". + /// Unique identifier, beginning with "MD". Note that this prefix may + /// not apply to mandates created before 2016. /// [JsonProperty("mandate")] public string Mandate { get; set; } diff --git a/GoCardless/Services/RefundService.cs b/GoCardless/Services/RefundService.cs index 1e3505f..65281cc 100644 --- a/GoCardless/Services/RefundService.cs +++ b/GoCardless/Services/RefundService.cs @@ -315,7 +315,8 @@ public class CreatedAtParam public int? Limit { get; set; } /// - /// Unique identifier, beginning with "MD". + /// Unique identifier, beginning with "MD". Note that this prefix may + /// not apply to mandates created before 2016. /// [JsonProperty("mandate")] public string Mandate { get; set; } diff --git a/GoCardless/Services/SubscriptionService.cs b/GoCardless/Services/SubscriptionService.cs index 9e04c4c..8a6bcaf 100644 --- a/GoCardless/Services/SubscriptionService.cs +++ b/GoCardless/Services/SubscriptionService.cs @@ -521,7 +521,8 @@ public class CreatedAtParam public int? Limit { get; set; } /// - /// Unique identifier, beginning with "MD". + /// Unique identifier, beginning with "MD". Note that this prefix may + /// not apply to mandates created before 2016. /// [JsonProperty("mandate")] public string Mandate { get; set; } diff --git a/README.md b/README.md index 1967894..3efb848 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 2.13.0` +`Install-Package GoCardless -Version 2.15.0` ## Usage