Skip to content

Commit

Permalink
Changes generated by b5784a31fd40f8d311dedeedc03bad4eecfea337
Browse files Browse the repository at this point in the history
  • Loading branch information
gocardless-robot committed Oct 16, 2019
1 parent 03ebb63 commit 6dcbf87
Show file tree
Hide file tree
Showing 20 changed files with 418 additions and 101 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.16.0</PackageVersion>
<PackageVersion>2.17.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.16.0</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/gocardless/gocardless-dotnet/releases/tag/v2.17.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 @@ -229,9 +229,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.16.0");
requestMessage.Headers.Add("User-Agent", "gocardless-dotnet/2.17.0");
requestMessage.Headers.Add("GoCardless-Version", "2015-07-06");
requestMessage.Headers.Add("GoCardless-Client-Version", "2.16.0");
requestMessage.Headers.Add("GoCardless-Client-Version", "2.17.0");
requestMessage.Headers.Add("GoCardless-Client-Library", "gocardless-dotnet");
requestMessage.Headers.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _accessToken);
Expand Down
54 changes: 49 additions & 5 deletions GoCardless/Resources/Creditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ public class Creditor
public string City { get; set; }

/// <summary>
/// [ISO
/// 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
/// alpha-2 code.
/// [ISO 3166-1 alpha-2
/// code.](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
/// </summary>
[JsonProperty("country_code")]
public string CountryCode { get; set; }
Expand All @@ -67,6 +66,16 @@ public class Creditor
[JsonProperty("created_at")]
public DateTimeOffset? CreatedAt { get; set; }

/// <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", "EUR", "GBP", "NZD", "SEK"
/// and "USD" are supported. Present only if payouts will be (or were)
/// made via foreign exchange.
/// </summary>
[JsonProperty("fx_payout_currency")]
public CreditorFxPayoutCurrency? FxPayoutCurrency { get; set; }

/// <summary>
/// Unique identifier, beginning with "CR".
/// </summary>
Expand Down Expand Up @@ -141,6 +150,41 @@ public class Creditor
public CreditorVerificationStatus? VerificationStatus { get; set; }
}

/// <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",
/// "EUR", "GBP", "NZD", "SEK" and "USD" are supported. Present only if payouts will be (or
/// were) made via foreign exchange.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum CreditorFxPayoutCurrency {

/// <summary>`fx_payout_currency` with a value of "AUD"</summary>
[EnumMember(Value = "AUD")]
AUD,
/// <summary>`fx_payout_currency` with a value of "CAD"</summary>
[EnumMember(Value = "CAD")]
CAD,
/// <summary>`fx_payout_currency` with a value of "DKK"</summary>
[EnumMember(Value = "DKK")]
DKK,
/// <summary>`fx_payout_currency` with a value of "EUR"</summary>
[EnumMember(Value = "EUR")]
EUR,
/// <summary>`fx_payout_currency` with a value of "GBP"</summary>
[EnumMember(Value = "GBP")]
GBP,
/// <summary>`fx_payout_currency` with a value of "NZD"</summary>
[EnumMember(Value = "NZD")]
NZD,
/// <summary>`fx_payout_currency` with a value of "SEK"</summary>
[EnumMember(Value = "SEK")]
SEK,
/// <summary>`fx_payout_currency` with a value of "USD"</summary>
[EnumMember(Value = "USD")]
USD,
}

/// <summary>
/// Resources linked to this Creditor
/// </summary>
Expand Down Expand Up @@ -239,8 +283,8 @@ public class CreditorSchemeIdentifier
public string City { get; set; }

/// <summary>
/// The support [ISO 3166-1 country
/// code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements).
/// [ISO 3166-1 alpha-2
/// code.](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
/// </summary>
[JsonProperty("country_code")]
public string CountryCode { get; set; }
Expand Down
11 changes: 6 additions & 5 deletions GoCardless/Resources/CreditorBankAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ public class CreditorBankAccount
public string BankName { get; set; }

/// <summary>
/// [ISO
/// 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
/// alpha-2 code. Defaults to the country code of the `iban` if
/// supplied, otherwise is required.
/// [ISO 3166-1 alpha-2
/// code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements).
/// Defaults to the country code of the `iban` if supplied, otherwise is
/// required.
/// </summary>
[JsonProperty("country_code")]
public string CountryCode { get; set; }
Expand All @@ -73,7 +73,8 @@ public class CreditorBankAccount

/// <summary>
/// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes)
/// currency code, defaults to national currency of `country_code`.
/// currency code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD",
/// "SEK" and "USD" are supported.
/// </summary>
[JsonProperty("currency")]
public string Currency { get; set; }
Expand Down
5 changes: 2 additions & 3 deletions GoCardless/Resources/Customer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ public class Customer
public string CompanyName { get; set; }

/// <summary>
/// [ISO
/// 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
/// alpha-2 code.
/// [ISO 3166-1 alpha-2
/// code.](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
/// </summary>
[JsonProperty("country_code")]
public string CountryCode { get; set; }
Expand Down
17 changes: 9 additions & 8 deletions GoCardless/Resources/CustomerBankAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ namespace GoCardless.Resources
public class CustomerBankAccount
{
/// <summary>
/// Name of the account holder, as known by the bank. Usually this
/// matches the name of the linked
/// [customer](#core-endpoints-customers). This field will be
/// Name of the account holder, as known by the bank. Usually this is
/// the same as the name stored with the linked
/// [creditor](#core-endpoints-creditors). This field will be
/// transliterated, upcased and truncated to 18 characters.
/// </summary>
[JsonProperty("account_holder_name")]
Expand All @@ -53,10 +53,10 @@ public class CustomerBankAccount
public string BankName { get; set; }

/// <summary>
/// [ISO
/// 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
/// alpha-2 code. Defaults to the country code of the `iban` if
/// supplied, otherwise is required.
/// [ISO 3166-1 alpha-2
/// code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements).
/// Defaults to the country code of the `iban` if supplied, otherwise is
/// required.
/// </summary>
[JsonProperty("country_code")]
public string CountryCode { get; set; }
Expand All @@ -70,7 +70,8 @@ public class CustomerBankAccount

/// <summary>
/// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes)
/// currency code, defaults to national currency of `country_code`.
/// currency code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD",
/// "SEK" and "USD" are supported.
/// </summary>
[JsonProperty("currency")]
public string Currency { get; set; }
Expand Down
95 changes: 89 additions & 6 deletions GoCardless/Resources/Payment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ public class Payment
[JsonProperty("description")]
public string Description { get; set; }

/// <summary>
///
/// </summary>
[JsonProperty("fx")]
public PaymentFx Fx { get; set; }

/// <summary>
/// Unique identifier, beginning with "PM".
/// </summary>
Expand All @@ -88,12 +94,15 @@ public class Payment
public IDictionary<string, string> Metadata { get; set; }

/// <summary>
/// An optional payment reference that will appear on your customer's
/// bank statement. For Bacs payments this can be up to 10 characters,
/// for SEPA payments the limit is 140 characters, for Autogiro payments
/// the limit is 11 characters, for Betalingsservice or BECS payments
/// the limit is 30 characters and for BECS NZ or PAD the limit is 12
/// characters. <p
/// An optional reference that will appear on your customer's bank
/// statement. The character limit for this reference is dependent on
/// the scheme.<br /> <strong>ACH</strong> - 10 characters<br />
/// <strong>Autogiro</strong> - 11 characters<br />
/// <strong>Bacs</strong> - 10 characters<br /> <strong>BECS</strong> -
/// 30 characters<br /> <strong>BECS NZ</strong> - 12 characters<br />
/// <strong>Betalingsservice</strong> - 30 characters<br />
/// <strong>PAD</strong> - 12 characters<br /> <strong>SEPA</strong> -
/// 140 characters <p
/// class='restricted-notice'><strong>Restricted</strong>: You can only
/// specify a payment reference for Bacs payments (that is, when
/// collecting from the UK) if you're on the <a
Expand Down Expand Up @@ -160,6 +169,80 @@ public enum PaymentCurrency {
USD,
}

public class PaymentFx
{
/// <summary>
/// Estimated rate that will be used in the foreign exchange of the
/// `amount` into the `fx_currency`.
/// This will vary based on the prevailing market rate until the moment
/// that it is paid out.
/// Present only before a resource is paid out.
/// </summary>
[JsonProperty("estimated_exchange_rate")]
public decimal? EstimatedExchangeRate { get; set; }

/// <summary>
/// Rate used in the foreign exchange of the `amount` into the
/// `fx_currency`.
/// Present only after a resource is paid out.
/// </summary>
[JsonProperty("exchange_rate")]
public decimal? ExchangeRate { get; set; }

/// <summary>
/// Amount that was paid out in the `fx_currency` after foreign
/// exchange.
/// Present only after the resource has been paid out.
/// </summary>
[JsonProperty("fx_amount")]
public int? FxAmount { get; set; }

/// <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", "EUR", "GBP", "NZD", "SEK"
/// and "USD" are supported. Present only if payouts will be (or were)
/// made via foreign exchange.
/// </summary>
[JsonProperty("fx_currency")]
public PaymentFxFxCurrency? FxCurrency { get; set; }
}

/// <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",
/// "EUR", "GBP", "NZD", "SEK" and "USD" are supported. Present only if payouts will be (or
/// were) made via foreign exchange.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum PaymentFxFxCurrency {

/// <summary>`fx_currency` with a value of "AUD"</summary>
[EnumMember(Value = "AUD")]
AUD,
/// <summary>`fx_currency` with a value of "CAD"</summary>
[EnumMember(Value = "CAD")]
CAD,
/// <summary>`fx_currency` with a value of "DKK"</summary>
[EnumMember(Value = "DKK")]
DKK,
/// <summary>`fx_currency` with a value of "EUR"</summary>
[EnumMember(Value = "EUR")]
EUR,
/// <summary>`fx_currency` with a value of "GBP"</summary>
[EnumMember(Value = "GBP")]
GBP,
/// <summary>`fx_currency` with a value of "NZD"</summary>
[EnumMember(Value = "NZD")]
NZD,
/// <summary>`fx_currency` with a value of "SEK"</summary>
[EnumMember(Value = "SEK")]
SEK,
/// <summary>`fx_currency` with a value of "USD"</summary>
[EnumMember(Value = "USD")]
USD,
}

/// <summary>
/// Resources linked to this Payment
/// </summary>
Expand Down
Loading

0 comments on commit 6dcbf87

Please sign in to comment.