Skip to content

Commit

Permalink
Merge pull request #67 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Changes from gocardless-dotnet-template
  • Loading branch information
danwakefield authored Jan 11, 2021
2 parents 6fa562b + 2fbd732 commit 04ee86c
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 27 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>4.5.0</PackageVersion>
<PackageVersion>4.6.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/v4.5.0</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/gocardless/gocardless-dotnet/releases/tag/v4.6.0</PackageReleaseNotes>
<TargetFrameworks>netstandard1.6;netstandard2.0;net46</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 @@ -252,9 +252,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/4.5.0");
requestMessage.Headers.Add("User-Agent", "gocardless-dotnet/4.6.0");
requestMessage.Headers.Add("GoCardless-Version", "2015-07-06");
requestMessage.Headers.Add("GoCardless-Client-Version", "4.5.0");
requestMessage.Headers.Add("GoCardless-Client-Version", "4.6.0");
requestMessage.Headers.Add("GoCardless-Client-Library", "gocardless-dotnet");
requestMessage.Headers.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _accessToken);
Expand Down
5 changes: 2 additions & 3 deletions GoCardless/Resources/Creditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ namespace GoCardless.Resources
/// your organisation will have a single "creditor", but the API also
/// supports collecting payments on behalf of others.
///
/// Please get in touch if you wish to use this endpoint. Currently, for
/// Anti Money Laundering reasons, any creditors you add must be directly
/// related to your organisation.
/// Currently, for Anti Money Laundering reasons, any creditors you add must
/// be directly related to your organisation.
/// </summary>
public class Creditor
{
Expand Down
10 changes: 10 additions & 0 deletions GoCardless/Resources/PayerAuthorisation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ namespace GoCardless.Resources
/// Authorisation is still saved if incomplete data is provided.
/// We return the list of incomplete data in the `incomplete_fields` along
/// with the resources in the body of the response.
/// The bank account details(account_number, bank_code & branch_code) must
/// be sent together rather than splitting across different request for both
/// `create` and `update` endpoints.
/// <br><br>
/// The API is designed to be flexible and allows you to collect
/// information in multiple steps without storing any sensitive data in the
Expand Down Expand Up @@ -149,6 +152,13 @@ public class PayerAuthorisationBankAccount
[JsonProperty("account_number")]
public string AccountNumber { get; set; }

/// <summary>
/// The last few digits of the account number. Currently 4 digits for
/// NZD bank accounts and 2 digits for other currencies.
/// </summary>
[JsonProperty("account_number_ending")]
public string AccountNumberEnding { get; set; }

/// <summary>
/// Account number suffix (only for bank accounts denominated in NZD) -
/// see [local details](#local-bank-details-new-zealand) for more
Expand Down
5 changes: 2 additions & 3 deletions GoCardless/Services/CreditorService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ namespace GoCardless.Services
/// your organisation will have a single "creditor", but the API also
/// supports collecting payments on behalf of others.
///
/// Please get in touch if you wish to use this endpoint. Currently, for
/// Anti Money Laundering reasons, any creditors you add must be directly
/// related to your organisation.
/// Currently, for Anti Money Laundering reasons, any creditors you add must
/// be directly related to your organisation.
/// </summary>

public class CreditorService
Expand Down
50 changes: 34 additions & 16 deletions GoCardless/Services/PayerAuthorisationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ namespace GoCardless.Services
/// Authorisation is still saved if incomplete data is provided.
/// We return the list of incomplete data in the `incomplete_fields` along
/// with the resources in the body of the response.
/// The bank account details(account_number, bank_code & branch_code) must
/// be sent together rather than splitting across different request for both
/// `create` and `update` endpoints.
/// <br><br>
/// The API is designed to be flexible and allows you to collect
/// information in multiple steps without storing any sensitive data in the
Expand Down Expand Up @@ -122,8 +125,8 @@ public Task<PayerAuthorisationResponse> CreateAsync(PayerAuthorisationCreateRequ

/// <summary>
/// Updates a Payer Authorisation. Updates the Payer Authorisation with
/// the request data.Can be invoked as many times as needed. Only fields
/// present in the request will be modified. An empty array of
/// the request data. Can be invoked as many times as needed. Only
/// fields present in the request will be modified. An empty array of
/// incomplete_fields means that the resource is valid. This endpoint
/// has been designed this way so you do not need to save any payer data
/// on your servers or the browser while still being able to implement a
Expand Down Expand Up @@ -151,7 +154,7 @@ public Task<PayerAuthorisationResponse> UpdateAsync(string identity, PayerAuthor

/// <summary>
/// Submits all the data previously pushed to this PayerAuthorisation
/// for verification.This time, a 200 HTTP status is returned if the
/// for verification. This time, a 200 HTTP status is returned if the
/// resource is valid and a 422 error response in case of validation
/// errors. After it is successfully submitted, the Payer Authorisation
/// can no longer be edited.
Expand Down Expand Up @@ -184,7 +187,7 @@ public Task<PayerAuthorisationResponse> SubmitAsync(string identity, PayerAuthor
/// acknowledge the end of the setup process.
/// They might want to make the payers go through some other steps
/// after they go through our flow or make them go through the necessary
/// verification mechanism(upcomming feature).
/// verification mechanism (upcoming feature).
/// </p>
/// </summary>
/// <param name="identity">Unique identifier, beginning with "PA".</param>
Expand Down Expand Up @@ -258,6 +261,13 @@ public class PayerAuthorisationBankAccount
[JsonProperty("account_number")]
public string AccountNumber { get; set; }

/// <summary>
/// The last few digits of the account number. Currently 4 digits
/// for NZD bank accounts and 2 digits for other currencies.
/// </summary>
[JsonProperty("account_number_ending")]
public string AccountNumberEnding { get; set; }

/// <summary>
/// Account number suffix (only for bank accounts denominated in
/// NZD) - see [local details](#local-bank-details-new-zealand) for
Expand Down Expand Up @@ -557,14 +567,14 @@ public enum PayerAuthorisationScheme

/// <summary>
/// Updates a Payer Authorisation. Updates the Payer Authorisation with the
/// request data.Can be invoked as many times as needed. Only fields present
/// in the request will be modified. An empty array of incomplete_fields
/// means that the resource is valid. This endpoint has been designed this
/// way so you do not need to save any payer data on your servers or the
/// browser while still being able to implement a progressive solution, such
/// a multi-step form. <p class="notice"> Note that in order to update the
/// `metadata` attribute values it must be sent completely as it overrides
/// the previously existing values. </p>
/// request data. Can be invoked as many times as needed. Only fields
/// present in the request will be modified. An empty array of
/// incomplete_fields means that the resource is valid. This endpoint has
/// been designed this way so you do not need to save any payer data on your
/// servers or the browser while still being able to implement a progressive
/// solution, such a multi-step form. <p class="notice"> Note that in order
/// to update the `metadata` attribute values it must be sent completely as
/// it overrides the previously existing values. </p>
/// </summary>
public class PayerAuthorisationUpdateRequest
{
Expand Down Expand Up @@ -601,6 +611,13 @@ public class PayerAuthorisationBankAccount
[JsonProperty("account_number")]
public string AccountNumber { get; set; }

/// <summary>
/// The last few digits of the account number. Currently 4 digits
/// for NZD bank accounts and 2 digits for other currencies.
/// </summary>
[JsonProperty("account_number_ending")]
public string AccountNumberEnding { get; set; }

/// <summary>
/// Account number suffix (only for bank accounts denominated in
/// NZD) - see [local details](#local-bank-details-new-zealand) for
Expand Down Expand Up @@ -892,9 +909,10 @@ public enum PayerAuthorisationScheme

/// <summary>
/// Submits all the data previously pushed to this PayerAuthorisation for
/// verification.This time, a 200 HTTP status is returned if the resource is
/// valid and a 422 error response in case of validation errors. After it is
/// successfully submitted, the Payer Authorisation can no longer be edited.
/// verification. This time, a 200 HTTP status is returned if the resource
/// is valid and a 422 error response in case of validation errors. After it
/// is successfully submitted, the Payer Authorisation can no longer be
/// edited.
/// </summary>
public class PayerAuthorisationSubmitRequest
{
Expand All @@ -912,7 +930,7 @@ public class PayerAuthorisationSubmitRequest
/// acknowledge the end of the setup process.
/// They might want to make the payers go through some other steps after
/// they go through our flow or make them go through the necessary
/// verification mechanism(upcomming feature).
/// verification mechanism (upcoming feature).
/// </p>
/// </summary>
public class PayerAuthorisationConfirmRequest
Expand Down
23 changes: 23 additions & 0 deletions GoCardless/Services/PayoutItemService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,29 @@ public class PayoutItemListRequest
[JsonProperty("before")]
public string Before { get; set; }

/// <summary>
/// Boolean value indicating whether the API should return tax data for
/// the cutover period of April to August 2020. Defaults to false.
/// </summary>
[JsonProperty("include_2020_tax_cutover")]
public PayoutItemInclude2020TaxCutover? Include2020TaxCutover { get; set; }

/// <summary>
/// Boolean value indicating whether the API should return tax data for
/// the cutover period of April to August 2020. Defaults to false.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum PayoutItemInclude2020TaxCutover
{

/// <summary>`include2020_tax_cutover` with a value of "true"</summary>
[EnumMember(Value = "true")]
True,
/// <summary>`include2020_tax_cutover` with a value of "false"</summary>
[EnumMember(Value = "false")]
False,
}

/// <summary>
/// Number of records to return.
/// </summary>
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 4.5.0`
`Install-Package GoCardless -Version 4.6.0`


## Usage
Expand Down

0 comments on commit 04ee86c

Please sign in to comment.