Skip to content

Commit

Permalink
Merge pull request #94 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Bump to 5.9.0
  • Loading branch information
amaraliou authored Dec 13, 2022
2 parents 7c98a54 + 5365954 commit 5ce8496
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 5 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>5.8.0</PackageVersion>
<PackageVersion>5.9.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/v5.8.0</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/gocardless/gocardless-dotnet/releases/tag/v5.9.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 @@ -277,11 +277,11 @@ private HttpRequestMessage BuildHttpRequestMessage<T>(string method, string path
runtimeFrameworkInformation = System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion();
#endif

var userAgentInformation = $" gocardless-dotnet/5.8.0 {runtimeFrameworkInformation} {Helpers.CleanupOSDescriptionString(OSRunningOn)}";
var userAgentInformation = $" gocardless-dotnet/5.9.0 {runtimeFrameworkInformation} {Helpers.CleanupOSDescriptionString(OSRunningOn)}";

requestMessage.Headers.Add("User-Agent", userAgentInformation);
requestMessage.Headers.Add("GoCardless-Version", "2015-07-06");
requestMessage.Headers.Add("GoCardless-Client-Version", "5.8.0");
requestMessage.Headers.Add("GoCardless-Client-Version", "5.9.0");
requestMessage.Headers.Add("GoCardless-Client-Library", "gocardless-dotnet");
requestMessage.Headers.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _accessToken);
Expand Down
34 changes: 34 additions & 0 deletions GoCardless/Resources/Creditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ public class Creditor
[JsonProperty("created_at")]
public DateTimeOffset? CreatedAt { get; set; }

/// <summary>
/// The type of business of the creditor. Currently, `individual`,
/// `company`, `charity`, `partnership`, and `trust` are supported.
/// </summary>
[JsonProperty("creditor_type")]
public CreditorCreditorType? CreditorType { get; set; }

/// <summary>
/// Boolean value indicating whether creditor has the [Custom Payment
/// Pages](https://hub.gocardless.com/s/article/Custom-payment-pages)
Expand Down Expand Up @@ -183,6 +190,33 @@ public class Creditor
public CreditorVerificationStatus? VerificationStatus { get; set; }
}

/// <summary>
/// The type of business of the creditor. Currently, `individual`, `company`, `charity`,
/// `partnership`, and `trust` are supported.
/// </summary>
[JsonConverter(typeof(GcStringEnumConverter), (int)Unknown)]
public enum CreditorCreditorType {
/// <summary>Unknown status</summary>
[EnumMember(Value = "unknown")]
Unknown = 0,

/// <summary>`creditor_type` with a value of "company"</summary>
[EnumMember(Value = "company")]
Company,
/// <summary>`creditor_type` with a value of "individual"</summary>
[EnumMember(Value = "individual")]
Individual,
/// <summary>`creditor_type` with a value of "charity"</summary>
[EnumMember(Value = "charity")]
Charity,
/// <summary>`creditor_type` with a value of "partnership"</summary>
[EnumMember(Value = "partnership")]
Partnership,
/// <summary>`creditor_type` with a value of "trust"</summary>
[EnumMember(Value = "trust")]
Trust,
}

/// <summary>
/// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) code for the currency in
/// which amounts will be paid out (after foreign exchange). Currently "AUD", "CAD", "DKK",
Expand Down
32 changes: 32 additions & 0 deletions GoCardless/Services/CreditorService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,38 @@ public class CreditorCreateRequest : IHasIdempotencyKey
[JsonProperty("country_code")]
public string CountryCode { get; set; }

/// <summary>
/// The type of business of the creditor. Currently, `individual`,
/// `company`, `charity`, `partnership`, and `trust` are supported.
/// </summary>
[JsonProperty("creditor_type")]
public CreditorCreditorType? CreditorType { get; set; }

/// <summary>
/// The type of business of the creditor. Currently, `individual`,
/// `company`, `charity`, `partnership`, and `trust` are supported.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum CreditorCreditorType
{

/// <summary>`creditor_type` with a value of "company"</summary>
[EnumMember(Value = "company")]
Company,
/// <summary>`creditor_type` with a value of "individual"</summary>
[EnumMember(Value = "individual")]
Individual,
/// <summary>`creditor_type` with a value of "charity"</summary>
[EnumMember(Value = "charity")]
Charity,
/// <summary>`creditor_type` with a value of "partnership"</summary>
[EnumMember(Value = "partnership")]
Partnership,
/// <summary>`creditor_type` with a value of "trust"</summary>
[EnumMember(Value = "trust")]
Trust,
}

/// <summary>
/// Linked resources.
/// </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 5.8.0`
`Install-Package GoCardless -Version 5.9.0`


## Usage
Expand Down

0 comments on commit 5ce8496

Please sign in to comment.