Skip to content

Commit

Permalink
Merge pull request #86 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Template changes
  • Loading branch information
szastupov committed Jul 8, 2022
2 parents 855e366 + 4bd920c commit 23327c6
Show file tree
Hide file tree
Showing 24 changed files with 387 additions and 29 deletions.
4 changes: 2 additions & 2 deletions GoCardless/GoCardless.csproj
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<PackageId>GoCardless</PackageId>
<PackageVersion>5.4.0</PackageVersion>
<PackageVersion>5.5.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.4.0</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/gocardless/gocardless-dotnet/releases/tag/v5.5.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
Expand Up @@ -277,11 +277,11 @@ private static string GetBaseUrl(Environment env)
runtimeFrameworkInformation = System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion();
#endif

var userAgentInformation = $" gocardless-dotnet/5.4.0 {runtimeFrameworkInformation} {Helpers.CleanupOSDescriptionString(OSRunningOn)}";
var userAgentInformation = $" gocardless-dotnet/5.5.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.4.0");
requestMessage.Headers.Add("GoCardless-Client-Version", "5.5.0");
requestMessage.Headers.Add("GoCardless-Client-Library", "gocardless-dotnet");
requestMessage.Headers.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _accessToken);
Expand Down
3 changes: 3 additions & 0 deletions GoCardless/Resources/BankDetailsLookup.cs
Expand Up @@ -74,5 +74,8 @@ public enum BankDetailsLookupAvailableDebitScheme {
/// <summary>`available_debit_scheme` with a value of "sepa_core"</summary>
[EnumMember(Value = "sepa_core")]
SepaCore,
/// <summary>`available_debit_scheme` with a value of "pay_to"</summary>
[EnumMember(Value = "pay_to")]
PayTo,
}
}
2 changes: 1 addition & 1 deletion GoCardless/Resources/BillingRequest.cs
Expand Up @@ -418,7 +418,7 @@ public class BillingRequestMandateRequest

/// <summary>
/// A Direct Debit scheme. Currently "ach", "bacs", "becs", "becs_nz",
/// "betalingsservice", "pad" and "sepa_core" are supported.
/// "betalingsservice", "pad", "pay_to" and "sepa_core" are supported.
/// </summary>
[JsonProperty("scheme")]
public string Scheme { get; set; }
Expand Down
162 changes: 162 additions & 0 deletions GoCardless/Resources/BillingRequestFlow.cs
Expand Up @@ -89,6 +89,24 @@ public class BillingRequestFlow
[JsonProperty("lock_customer_details")]
public bool? LockCustomerDetails { get; set; }

/// <summary>
/// Bank account information used to prefill the payment page so your
/// customer doesn't have to re-type details you already hold about
/// them. It will be stored unvalidated and the customer will be able to
/// review and amend it before completing the form.
/// </summary>
[JsonProperty("prefilled_bank_account")]
public BillingRequestFlowPrefilledBankAccount PrefilledBankAccount { get; set; }

/// <summary>
/// Customer information used to prefill the payment page so your
/// customer doesn't have to re-type details you already hold about
/// them. It will be stored unvalidated and the customer will be able to
/// review and amend it before completing the form.
/// </summary>
[JsonProperty("prefilled_customer")]
public BillingRequestFlowPrefilledCustomer PrefilledCustomer { get; set; }

/// <summary>
/// URL that the payer can be redirected to after completing the request
/// flow.
Expand Down Expand Up @@ -128,4 +146,148 @@ public class BillingRequestFlowLinks
public string BillingRequest { get; set; }
}

/// <summary>
/// Represents a billing request flow prefilled bank account resource.
///
/// Bank account information used to prefill the payment page so your
/// customer doesn't have to re-type details you already hold about them. It
/// will be stored unvalidated and the customer will be able to review and
/// amend it before completing the form.
/// </summary>
public class BillingRequestFlowPrefilledBankAccount
{
/// <summary>
/// Bank account type 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 BillingRequestFlowPrefilledBankAccountAccountType? AccountType { get; set; }
}

/// <summary>
/// Bank account type 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(GcStringEnumConverter), (int)Unknown)]
public enum BillingRequestFlowPrefilledBankAccountAccountType {
/// <summary>Unknown status</summary>
[EnumMember(Value = "unknown")]
Unknown = 0,

/// <summary>`account_type` with a value of "savings"</summary>
[EnumMember(Value = "savings")]
Savings,
/// <summary>`account_type` with a value of "checking"</summary>
[EnumMember(Value = "checking")]
Checking,
}

/// <summary>
/// Represents a billing request flow prefilled customer resource.
///
/// Customer information used to prefill the payment page so your customer
/// doesn't have to re-type details you already hold about them. It will be
/// stored unvalidated and the customer will be able to review and amend it
/// before completing the form.
/// </summary>
public class BillingRequestFlowPrefilledCustomer
{
/// <summary>
/// The first line of the customer's address.
/// </summary>
[JsonProperty("address_line1")]
public string AddressLine1 { get; set; }

/// <summary>
/// The second line of the customer's address.
/// </summary>
[JsonProperty("address_line2")]
public string AddressLine2 { get; set; }

/// <summary>
/// The third line of the customer's address.
/// </summary>
[JsonProperty("address_line3")]
public string AddressLine3 { get; set; }

/// <summary>
/// The city of the customer's address.
/// </summary>
[JsonProperty("city")]
public string City { get; set; }

/// <summary>
/// Customer's company name. Company name should only be provided if
/// `given_name` and `family_name` are null.
/// </summary>
[JsonProperty("company_name")]
public string CompanyName { get; set; }

/// <summary>
/// [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; }

/// <summary>
/// For Danish customers only. The civic/company number (CPR or CVR) of
/// the customer.
/// </summary>
[JsonProperty("danish_identity_number")]
public string DanishIdentityNumber { get; set; }

/// <summary>
/// Customer's email address.
/// </summary>
[JsonProperty("email")]
public string Email { get; set; }

/// <summary>
/// Customer's surname.
/// </summary>
[JsonProperty("family_name")]
public string FamilyName { get; set; }

/// <summary>
/// Customer's first name.
/// </summary>
[JsonProperty("given_name")]
public string GivenName { get; set; }

/// <summary>
/// [ISO 639-1](http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
/// code.
/// </summary>
[JsonProperty("language")]
public string Language { get; set; }

/// <summary>
/// For New Zealand customers only.
/// </summary>
[JsonProperty("phone_number")]
public string PhoneNumber { get; set; }

/// <summary>
/// The customer's postal code.
/// </summary>
[JsonProperty("postal_code")]
public string PostalCode { get; set; }

/// <summary>
/// The customer's address region, county or department.
/// </summary>
[JsonProperty("region")]
public string Region { get; set; }

/// <summary>
/// For Swedish customers only. The civic/company number (personnummer,
/// samordningsnummer, or organisationsnummer) of the customer.
/// </summary>
[JsonProperty("swedish_identity_number")]
public string SwedishIdentityNumber { get; set; }
}

}
2 changes: 1 addition & 1 deletion GoCardless/Resources/BillingRequestTemplate.cs
Expand Up @@ -53,7 +53,7 @@ public class BillingRequestTemplate

/// <summary>
/// A Direct Debit scheme. Currently "ach", "bacs", "becs", "becs_nz",
/// "betalingsservice", "pad" and "sepa_core" are supported.
/// "betalingsservice", "pad", "pay_to" and "sepa_core" are supported.
/// </summary>
[JsonProperty("mandate_request_scheme")]
public string MandateRequestScheme { get; set; }
Expand Down
3 changes: 3 additions & 0 deletions GoCardless/Resources/Event.cs
Expand Up @@ -342,6 +342,9 @@ public enum EventDetailsScheme {
/// <summary>`scheme` with a value of "sepa_cor1"</summary>
[EnumMember(Value = "sepa_cor1")]
SepaCor1,
/// <summary>`scheme` with a value of "pay_to"</summary>
[EnumMember(Value = "pay_to")]
PayTo,
}

/// <summary>
Expand Down
6 changes: 6 additions & 0 deletions GoCardless/Resources/Mandate.cs
Expand Up @@ -89,6 +89,8 @@ public class Mandate
/// bank but has not been processed yet</li>
/// <li>`active`: the mandate has been successfully set up by the
/// customer's bank</li>
/// <li>`suspended_by_payer`: the mandate has been suspended by
/// payer</li>
/// <li>`failed`: the mandate could not be created</li>
/// <li>`cancelled`: the mandate has been cancelled</li>
/// <li>`expired`: the mandate has expired due to dormancy</li>
Expand Down Expand Up @@ -144,6 +146,7 @@ public class MandateLinks
/// <li>`submitted`: the mandate has been submitted to the customer's bank but has not been
/// processed yet</li>
/// <li>`active`: the mandate has been successfully set up by the customer's bank</li>
/// <li>`suspended_by_payer`: the mandate has been suspended by payer</li>
/// <li>`failed`: the mandate could not be created</li>
/// <li>`cancelled`: the mandate has been cancelled</li>
/// <li>`expired`: the mandate has expired due to dormancy</li>
Expand Down Expand Up @@ -185,6 +188,9 @@ public enum MandateStatus {
/// <summary>`status` with a value of "blocked"</summary>
[EnumMember(Value = "blocked")]
Blocked,
/// <summary>`status` with a value of "suspended_by_payer"</summary>
[EnumMember(Value = "suspended_by_payer")]
SuspendedByPayer,
}

}
3 changes: 3 additions & 0 deletions GoCardless/Resources/MandateImport.cs
Expand Up @@ -132,6 +132,9 @@ public enum MandateImportScheme {
/// <summary>`scheme` with a value of "sepa_core"</summary>
[EnumMember(Value = "sepa_core")]
SepaCore,
/// <summary>`scheme` with a value of "pay_to"</summary>
[EnumMember(Value = "pay_to")]
PayTo,
}

/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions GoCardless/Resources/PayerAuthorisation.cs
Expand Up @@ -499,6 +499,9 @@ public enum PayerAuthorisationMandateScheme {
/// <summary>`scheme` with a value of "sepa_core"</summary>
[EnumMember(Value = "sepa_core")]
SepaCore,
/// <summary>`scheme` with a value of "pay_to"</summary>
[EnumMember(Value = "pay_to")]
PayTo,
}

/// <summary>
Expand Down
6 changes: 3 additions & 3 deletions GoCardless/Resources/Payment.cs
Expand Up @@ -103,9 +103,9 @@ public class Payment
/// 30 characters<br /> <strong>BECS NZ</strong> - 12 characters<br />
/// <strong>Betalingsservice</strong> - 30 characters<br />
/// <strong>PAD</strong> - scheme doesn't offer references<br />
/// <strong>SEPA</strong> - 140 characters<br /> Note that this
/// reference must be unique (for each merchant) for the BECS scheme as
/// it is a scheme requirement. <p
/// <strong>PayTo</strong> - 18 characters<br /> <strong>SEPA</strong> -
/// 140 characters<br /> Note that this reference must be unique (for
/// each merchant) for the BECS scheme as it is a scheme requirement. <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
3 changes: 3 additions & 0 deletions GoCardless/Resources/RedirectFlow.cs
Expand Up @@ -216,6 +216,9 @@ public enum RedirectFlowScheme {
/// <summary>`scheme` with a value of "sepa_core"</summary>
[EnumMember(Value = "sepa_core")]
SepaCore,
/// <summary>`scheme` with a value of "pay_to"</summary>
[EnumMember(Value = "pay_to")]
PayTo,
}

}
6 changes: 3 additions & 3 deletions GoCardless/Resources/Refund.cs
Expand Up @@ -76,9 +76,9 @@ public class Refund
/// 30 characters<br /> <strong>BECS NZ</strong> - 12 characters<br />
/// <strong>Betalingsservice</strong> - 30 characters<br />
/// <strong>PAD</strong> - scheme doesn't offer references<br />
/// <strong>SEPA</strong> - 140 characters<br /> Note that this
/// reference must be unique (for each merchant) for the BECS scheme as
/// it is a scheme requirement. <p
/// <strong>PayTo</strong> - 18 characters<br /> <strong>SEPA</strong> -
/// 140 characters<br /> Note that this reference must be unique (for
/// each merchant) for the BECS scheme as it is a scheme requirement. <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

0 comments on commit 23327c6

Please sign in to comment.