Skip to content

Commit

Permalink
Release 2.15.0
Browse files Browse the repository at this point in the history
* Addition of the customer removal API
* Support account_type in bank account API
  • Loading branch information
gocardless-robot authored and Nick Campbell committed Jul 26, 2019
1 parent 8cc19fd commit 6798e1a
Show file tree
Hide file tree
Showing 16 changed files with 136 additions and 44 deletions.
4 changes: 2 additions & 2 deletions GoCardless/GoCardless.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<PackageId>GoCardless</PackageId>
<PackageVersion>2.13.0</PackageVersion>
<PackageVersion>2.15.0</PackageVersion>
<Authors>GoCardless Ltd</Authors>
<Description>Client for the GoCardless API - a powerful, simple solution for the collection of recurring bank-to-bank payments</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
Expand All @@ -11,7 +11,7 @@
<Copyright>GoCardless Ltd</Copyright>
<PackageTags>gocardless payments rest api direct debit</PackageTags>
<PackageLicenseUrl>https://github.com/gocardless/gocardless-dotnet/blob/master/LICENSE.txt</PackageLicenseUrl>
<PackageReleaseNotes>https://github.com/gocardless/gocardless-dotnet/releases/tag/v2.13.0</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/gocardless/gocardless-dotnet/releases/tag/v2.15.0</PackageReleaseNotes>
<TargetFrameworks>netstandard1.6;netstandard2.0;net452</TargetFrameworks>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
4 changes: 2 additions & 2 deletions GoCardless/GoCardlessClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ private HttpRequestMessage BuildHttpRequestMessage<T>(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);
Expand Down
11 changes: 6 additions & 5 deletions GoCardless/Resources/CreditorBankAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ public class CreditorBankAccount
public string AccountNumberEnding { get; set; }

/// <summary>
/// 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.
/// </summary>
[JsonProperty("account_type")]
public string AccountType { get; set; }
Expand Down Expand Up @@ -106,8 +106,9 @@ public class CreditorBankAccount
}

/// <summary>
/// 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.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum CreditorBankAccountAccountType {
Expand Down
11 changes: 6 additions & 5 deletions GoCardless/Resources/CustomerBankAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public class CustomerBankAccount
public string AccountNumberEnding { get; set; }

/// <summary>
/// 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.
/// </summary>
[JsonProperty("account_type")]
public string AccountType { get; set; }
Expand Down Expand Up @@ -103,8 +103,9 @@ public class CustomerBankAccount
}

/// <summary>
/// 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.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum CustomerBankAccountAccountType {
Expand Down
3 changes: 2 additions & 1 deletion GoCardless/Resources/Mandate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public class Mandate
public DateTimeOffset? CreatedAt { get; set; }

/// <summary>
/// Unique identifier, beginning with "MD".
/// Unique identifier, beginning with "MD". Note that this prefix may
/// not apply to mandates created before 2016.
/// </summary>
[JsonProperty("id")]
public string Id { get; set; }
Expand Down
7 changes: 6 additions & 1 deletion GoCardless/Resources/PayoutItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ public class PayoutItem
/// customer.</li>
/// <li>`refund` (debit): <em>private beta</em> A refund sent to a
/// customer, not linked to a payment.</li>
/// <li>`refund_funds_returned` (credit): The refund could not be sent
/// to the customer, and the funds have been returned to you.</li>
/// <li>`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.</li>
Expand All @@ -94,7 +96,8 @@ public class PayoutItem
public class PayoutItemLinks
{
/// <summary>
/// Unique identifier, beginning with "MD".
/// Unique identifier, beginning with "MD". Note that this prefix may
/// not apply to mandates created before 2016.
/// </summary>
[JsonProperty("mandate")]
public string Mandate { get; set; }
Expand All @@ -115,6 +118,8 @@ public class PayoutItemLinks
/// <li>`payment_refunded` (debit): The payment has been refunded to the customer.</li>
/// <li>`refund` (debit): <em>private beta</em> A refund sent to a customer, not linked to a
/// payment.</li>
/// <li>`refund_funds_returned` (credit): The refund could not be sent to the customer, and the
/// funds have been returned to you.</li>
/// <li>`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.</li>
/// <li>`app_fee` (credit/debit): The optional fees that a partner may have taken for a payment.
Expand Down
12 changes: 6 additions & 6 deletions GoCardless/Services/CreditorBankAccountService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,17 @@ public class CreditorBankAccountCreateRequest : IHasIdempotencyKey
public string AccountNumber { get; set; }

/// <summary>
/// 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.
/// </summary>
[JsonProperty("account_type")]
public string AccountType { get; set; }

/// <summary>
/// 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.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum CreditorBankAccountAccountType
Expand Down
12 changes: 6 additions & 6 deletions GoCardless/Services/CustomerBankAccountService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,17 @@ public class CustomerBankAccountCreateRequest : IHasIdempotencyKey
public string AccountNumber { get; set; }

/// <summary>
/// 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.
/// </summary>
[JsonProperty("account_type")]
public string AccountType { get; set; }

/// <summary>
/// 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.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum CustomerBankAccountAccountType
Expand Down
4 changes: 2 additions & 2 deletions GoCardless/Services/CustomerNotificationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
/// </summary>
/// <param name="identity">The id of the notification.</param>
Expand Down Expand Up @@ -85,7 +85,7 @@ public Task<CustomerNotificationResponse> 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.
///
/// </summary>
public class CustomerNotificationHandleRequest
Expand Down
44 changes: 44 additions & 0 deletions GoCardless/Services/CustomerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,34 @@ public Task<CustomerResponse> UpdateAsync(string identity, CustomerUpdateRequest

return _goCardlessClient.ExecuteAsync<CustomerResponse>("PUT", "/customers/:identity", urlParams, request, null, "customers", customiseRequestMessage);
}

/// <summary>
/// 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.
///
/// <p class="restricted-notice"><strong>The action of removing a
/// customer cannot be
/// reversed, so please use with care.</strong></p>
/// </summary>
/// <param name="identity">Unique identifier, beginning with "CU".</param>
/// <param name="request">An optional `CustomerRemoveRequest` representing the body for this remove request.</param>
/// <param name="customiseRequestMessage">An optional `RequestSettings` allowing you to configure the request</param>
/// <returns>A single customer resource</returns>
public Task<CustomerResponse> 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<KeyValuePair<string, object>>
{
new KeyValuePair<string, object>("identity", identity),
};

return _goCardlessClient.ExecuteAsync<CustomerResponse>("DELETE", "/customers/:identity", urlParams, request, null, null, customiseRequestMessage);
}
}


Expand Down Expand Up @@ -482,6 +510,22 @@ public class CustomerUpdateRequest
public string SwedishIdentityNumber { get; set; }
}


/// <summary>
/// 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.
///
/// <p class="restricted-notice"><strong>The action of removing a customer
/// cannot be
/// reversed, so please use with care.</strong></p>
/// </summary>
public class CustomerRemoveRequest
{
}

/// <summary>
/// An API response for a request returning a single customer.
/// </summary>
Expand Down
12 changes: 6 additions & 6 deletions GoCardless/Services/MandatePdfService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,17 @@ public class MandatePdfCreateRequest
public string AccountNumber { get; set; }

/// <summary>
/// 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.
/// </summary>
[JsonProperty("account_type")]
public string AccountType { get; set; }

/// <summary>
/// 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.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum MandatePdfAccountType
Expand Down
8 changes: 4 additions & 4 deletions GoCardless/Services/MandateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public IEnumerable<Task<IReadOnlyList<Mandate>>> AllAsync(MandateListRequest req
/// <summary>
/// Retrieves the details of an existing mandate.
/// </summary>
/// <param name="identity">Unique identifier, beginning with "MD".</param>
/// <param name="identity">Unique identifier, beginning with "MD". Note that this prefix may not apply to mandates created before 2016.</param>
/// <param name="request">An optional `MandateGetRequest` representing the query parameters for this get request.</param>
/// <param name="customiseRequestMessage">An optional `RequestSettings` allowing you to configure the request</param>
/// <returns>A single mandate resource</returns>
Expand All @@ -130,7 +130,7 @@ public Task<MandateResponse> GetAsync(string identity, MandateGetRequest request
/// <summary>
/// Updates a mandate object. This accepts only the metadata parameter.
/// </summary>
/// <param name="identity">Unique identifier, beginning with "MD".</param>
/// <param name="identity">Unique identifier, beginning with "MD". Note that this prefix may not apply to mandates created before 2016.</param>
/// <param name="request">An optional `MandateUpdateRequest` representing the body for this update request.</param>
/// <param name="customiseRequestMessage">An optional `RequestSettings` allowing you to configure the request</param>
/// <returns>A single mandate resource</returns>
Expand All @@ -155,7 +155,7 @@ public Task<MandateResponse> UpdateAsync(string identity, MandateUpdateRequest r
/// This will fail with a `cancellation_failed` error if the mandate is
/// already cancelled.
/// </summary>
/// <param name="identity">Unique identifier, beginning with "MD".</param>
/// <param name="identity">Unique identifier, beginning with "MD". Note that this prefix may not apply to mandates created before 2016.</param>
/// <param name="request">An optional `MandateCancelRequest` representing the body for this cancel request.</param>
/// <param name="customiseRequestMessage">An optional `RequestSettings` allowing you to configure the request</param>
/// <returns>A single mandate resource</returns>
Expand Down Expand Up @@ -186,7 +186,7 @@ public Task<MandateResponse> CancelAsync(string identity, MandateCancelRequest r
///
/// Mandates can be resubmitted up to 3 times.
/// </summary>
/// <param name="identity">Unique identifier, beginning with "MD".</param>
/// <param name="identity">Unique identifier, beginning with "MD". Note that this prefix may not apply to mandates created before 2016.</param>
/// <param name="request">An optional `MandateReinstateRequest` representing the body for this reinstate request.</param>
/// <param name="customiseRequestMessage">An optional `RequestSettings` allowing you to configure the request</param>
/// <returns>A single mandate resource</returns>
Expand Down
40 changes: 39 additions & 1 deletion GoCardless/Services/PaymentService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,43 @@ public class PaymentListRequest
[JsonProperty("before")]
public string Before { get; set; }

[JsonProperty("charge_date")]
public PaymentChargeDate ChargeDate { get; set; }
/// <summary>
///
/// </summary>
public class PaymentChargeDate
{

/// <summary>
/// Limit to records where the payment was or will be collected from
/// the customer's bank account after the specified date.
/// </summary>
[JsonProperty("gt")]
public string Gt { get; set; }

/// <summary>
/// Limit to records where the payment was or will be collected from
/// the customer's bank account on or after the specified date.
/// </summary>
[JsonProperty("gte")]
public string Gte { get; set; }

/// <summary>
/// Limit to records where the payment was or will be collected from
/// the customer's bank account before the specified date.
/// </summary>
[JsonProperty("lt")]
public string Lt { get; set; }

/// <summary>
/// Limit to records where the payment was or will be collected from
/// the customer's bank account on or before the specified date.
/// </summary>
[JsonProperty("lte")]
public string Lte { get; set; }
}

/// <summary>
/// Limit to records created within certain times.
/// </summary>
Expand Down Expand Up @@ -473,7 +510,8 @@ public enum PaymentCurrency
public int? Limit { get; set; }

/// <summary>
/// Unique identifier, beginning with "MD".
/// Unique identifier, beginning with "MD". Note that this prefix may
/// not apply to mandates created before 2016.
/// </summary>
[JsonProperty("mandate")]
public string Mandate { get; set; }
Expand Down
3 changes: 2 additions & 1 deletion GoCardless/Services/RefundService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ public class CreatedAtParam
public int? Limit { get; set; }

/// <summary>
/// Unique identifier, beginning with "MD".
/// Unique identifier, beginning with "MD". Note that this prefix may
/// not apply to mandates created before 2016.
/// </summary>
[JsonProperty("mandate")]
public string Mandate { get; set; }
Expand Down
3 changes: 2 additions & 1 deletion GoCardless/Services/SubscriptionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,8 @@ public class CreatedAtParam
public int? Limit { get; set; }

/// <summary>
/// Unique identifier, beginning with "MD".
/// Unique identifier, beginning with "MD". Note that this prefix may
/// not apply to mandates created before 2016.
/// </summary>
[JsonProperty("mandate")]
public string Mandate { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6798e1a

Please sign in to comment.