Skip to content

Commit

Permalink
Merge pull request #93 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Bump to v5.8.0
  • Loading branch information
opsz2 authored Dec 12, 2022
2 parents e4a6e24 + a4fafae commit 7c98a54
Show file tree
Hide file tree
Showing 40 changed files with 1,848 additions and 1,312 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.7.0</PackageVersion>
<PackageVersion>5.8.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.7.0</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/gocardless/gocardless-dotnet/releases/tag/v5.8.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.7.0 {runtimeFrameworkInformation} {Helpers.CleanupOSDescriptionString(OSRunningOn)}";
var userAgentInformation = $" gocardless-dotnet/5.8.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.7.0");
requestMessage.Headers.Add("GoCardless-Client-Version", "5.8.0");
requestMessage.Headers.Add("GoCardless-Client-Library", "gocardless-dotnet");
requestMessage.Headers.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _accessToken);
Expand Down
11 changes: 7 additions & 4 deletions GoCardless/Resources/BankDetailsLookup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class BankDetailsLookup
}

/// <summary>
/// A Direct Debit scheme for this bank account.
/// A bank payment scheme for this bank account.
/// </summary>
[JsonConverter(typeof(GcStringEnumConverter), (int)Unknown)]
public enum BankDetailsLookupAvailableDebitScheme {
Expand All @@ -68,14 +68,17 @@ public enum BankDetailsLookupAvailableDebitScheme {
/// <summary>`available_debit_scheme` with a value of "betalingsservice"</summary>
[EnumMember(Value = "betalingsservice")]
Betalingsservice,
/// <summary>`available_debit_scheme` with a value of "faster_payments"</summary>
[EnumMember(Value = "faster_payments")]
FasterPayments,
/// <summary>`available_debit_scheme` with a value of "pad"</summary>
[EnumMember(Value = "pad")]
Pad,
/// <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,
/// <summary>`available_debit_scheme` with a value of "sepa_core"</summary>
[EnumMember(Value = "sepa_core")]
SepaCore,
}
}
167 changes: 163 additions & 4 deletions GoCardless/Resources/BillingRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ public enum BillingRequestActionType {
/// <summary>`type` with a value of "choose_currency"</summary>
[EnumMember(Value = "choose_currency")]
ChooseCurrency,
/// <summary>`type` with a value of "collect_amount"</summary>
[EnumMember(Value = "collect_amount")]
CollectAmount,
/// <summary>`type` with a value of "collect_customer_details"</summary>
[EnumMember(Value = "collect_customer_details")]
CollectCustomerDetails,
Expand Down Expand Up @@ -396,13 +399,28 @@ public class BillingRequestLinks
/// </summary>
public class BillingRequestMandateRequest
{
/// <summary>
/// Constraints that will apply to the mandate_request. (Optional)
/// Specifically for PayTo and VRP.
/// </summary>
[JsonProperty("constraints")]
public BillingRequestMandateRequestConstraints Constraints { get; set; }

/// <summary>
/// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes)
/// currency code.
/// </summary>
[JsonProperty("currency")]
public string Currency { get; set; }

/// <summary>
/// A human-readable description of the payment and/or mandate. This
/// will be displayed to the payer when authorising the billing request.
///
/// </summary>
[JsonProperty("description")]
public string Description { get; set; }

/// <summary>
/// Resources linked to this BillingRequestMandateRequest.
/// </summary>
Expand All @@ -417,8 +435,11 @@ public class BillingRequestMandateRequest
public IDictionary<string, string> Metadata { get; set; }

/// <summary>
/// A Direct Debit scheme. Currently "ach", "bacs", "becs", "becs_nz",
/// "betalingsservice", "pad", "pay_to" and "sepa_core" are supported.
/// A bank payment scheme. Currently "ach", "autogiro", "bacs", "becs",
/// "becs_nz", "betalingsservice", "faster_payments", "pad", "pay_to"
/// and "sepa_core" are supported. Optional for mandate only requests -
/// if left blank, the payer will be able to select the currency/scheme
/// to pay with from a list of your available schemes.
/// </summary>
[JsonProperty("scheme")]
public string Scheme { get; set; }
Expand Down Expand Up @@ -456,6 +477,144 @@ public class BillingRequestMandateRequest
public BillingRequestMandateRequestVerify? Verify { get; set; }
}

/// <summary>
/// Represents a billing request mandate request constraint resource.
///
/// Constraints that will apply to the mandate_request. (Optional)
/// Specifically for PayTo and VRP.
/// </summary>
public class BillingRequestMandateRequestConstraints
{
/// <summary>
/// The latest date at which payments can be taken, must occur after
/// start_date if present
///
/// This is an optional field and if it is not supplied the agreement
/// will be considered open and
/// will not have an end date. Keep in mind the end date must take into
/// account how long it will
/// take the user to set up this agreement via the BillingRequest.
///
/// </summary>
[JsonProperty("end_date")]
public string EndDate { get; set; }

/// <summary>
/// The maximum amount that can be charged for a single payment
/// </summary>
[JsonProperty("max_amount_per_payment")]
public int? MaxAmountPerPayment { get; set; }

/// <summary>
/// List of periodic limits and constraints which apply to them
/// </summary>
[JsonProperty("periodic_limits")]
public List<BillingRequestMandateRequestConstraintPeriodicLimit> PeriodicLimits { get; set; }

/// <summary>
/// The date from which payments can be taken.
///
/// This is an optional field and if it is not supplied the start date
/// will be set to the day
/// authorisation happens.
///
/// </summary>
[JsonProperty("start_date")]
public string StartDate { get; set; }
}

/// <summary>
/// List of periodic limits and constraints which apply to them
/// </summary>
public class BillingRequestMandateRequestConstraintPeriodicLimit
{
/// <summary>
/// The alignment of the period.
///
/// `calendar` - this will finish on the end of the current period. For
/// example this will expire on the Monday for the current week or the
/// January for the next year.
///
/// `creation_date` - this will finish on the next instance of the
/// current period. For example Monthly it will expire on the same day
/// of the next month, or yearly the same day of the next year.
///
/// </summary>
[JsonProperty("alignment")]
public BillingRequestMandateRequestConstraintPeriodicLimitAlignment? Alignment { get; set; }

/// <summary>
/// The maximum number of payments that can be collected in this
/// periodic limit
/// </summary>
[JsonProperty("max_payments")]
public int? MaxPayments { get; set; }

/// <summary>
/// The maximum total amount that can be charged for all payments in
/// this periodic limit
/// </summary>
[JsonProperty("max_total_amount")]
public int? MaxTotalAmount { get; set; }

/// <summary>
/// The repeating period for this mandate
/// </summary>
[JsonProperty("period")]
public BillingRequestMandateRequestConstraintPeriodicLimitPeriod? Period { get; set; }
}

/// <summary>
/// The alignment of the period.
///
/// `calendar` - this will finish on the end of the current period. For example this will expire
/// on the Monday for the current week or the January for the next year.
///
/// `creation_date` - this will finish on the next instance of the current period. For example
/// Monthly it will expire on the same day of the next month, or yearly the same day of the next
/// year.
///
/// </summary>
[JsonConverter(typeof(GcStringEnumConverter), (int)Unknown)]
public enum BillingRequestMandateRequestConstraintPeriodicLimitAlignment {
/// <summary>Unknown status</summary>
[EnumMember(Value = "unknown")]
Unknown = 0,

/// <summary>`alignment` with a value of "calendar"</summary>
[EnumMember(Value = "calendar")]
Calendar,
/// <summary>`alignment` with a value of "creation_date"</summary>
[EnumMember(Value = "creation_date")]
CreationDate,
}

/// <summary>
/// The repeating period for this mandate
/// </summary>
[JsonConverter(typeof(GcStringEnumConverter), (int)Unknown)]
public enum BillingRequestMandateRequestConstraintPeriodicLimitPeriod {
/// <summary>Unknown status</summary>
[EnumMember(Value = "unknown")]
Unknown = 0,

/// <summary>`period` with a value of "day"</summary>
[EnumMember(Value = "day")]
Day,
/// <summary>`period` with a value of "week"</summary>
[EnumMember(Value = "week")]
Week,
/// <summary>`period` with a value of "month"</summary>
[EnumMember(Value = "month")]
Month,
/// <summary>`period` with a value of "year"</summary>
[EnumMember(Value = "year")]
Year,
/// <summary>`period` with a value of "flexible"</summary>
[EnumMember(Value = "flexible")]
Flexible,
}

/// <summary>
/// Resources linked to this BillingRequestMandateRequest
/// </summary>
Expand Down Expand Up @@ -544,8 +703,8 @@ public class BillingRequestPaymentRequest
public string Currency { get; set; }

/// <summary>
/// A human-readable description of the payment. This will be displayed
/// to the payer when authorising the billing request.
/// A human-readable description of the payment and/or mandate. This
/// will be displayed to the payer when authorising the billing request.
///
/// </summary>
[JsonProperty("description")]
Expand Down
27 changes: 18 additions & 9 deletions GoCardless/Resources/BillingRequestFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ public class BillingRequestFlow
[JsonProperty("id")]
public string Id { get; set; }

/// <summary>
/// Sets the default language of the Billing Request Flow and the
/// customer. [ISO
/// 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code.
/// </summary>
[JsonProperty("language")]
public string Language { get; set; }

/// <summary>
/// Resources linked to this BillingRequestFlow.
/// </summary>
Expand All @@ -67,7 +75,11 @@ public class BillingRequestFlow
/// <summary>
/// If true, the payer will not be able to change their bank account
/// within the flow. If the bank_account details are collected as part
/// of bank_authorisation then GC will set this value to true mid flow
/// of bank_authorisation then GC will set this value to true mid flow.
///
/// You can only lock bank account if these have already been completed
/// as a part of the billing request.
///
/// </summary>
[JsonProperty("lock_bank_account")]
public bool? LockBankAccount { get; set; }
Expand All @@ -84,7 +96,11 @@ public class BillingRequestFlow
/// <summary>
/// If true, the payer will not be able to edit their customer details
/// within the flow. If the customer details are collected as part of
/// bank_authorisation then GC will set this value to true mid flow
/// bank_authorisation then GC will set this value to true mid flow.
///
/// You can only lock customer details if these have already been
/// completed as a part of the billing request.
///
/// </summary>
[JsonProperty("lock_customer_details")]
public bool? LockCustomerDetails { get; set; }
Expand Down Expand Up @@ -257,13 +273,6 @@ public class BillingRequestFlowPrefilledCustomer
[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>
/// The customer's postal code.
/// </summary>
Expand Down
19 changes: 15 additions & 4 deletions GoCardless/Resources/BillingRequestTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ public class BillingRequestTemplate
[JsonProperty("mandate_request_currency")]
public string MandateRequestCurrency { get; set; }

/// <summary>
/// A human-readable description of the payment and/or mandate. This
/// will be displayed to the payer when authorising the billing request.
///
/// </summary>
[JsonProperty("mandate_request_description")]
public string MandateRequestDescription { get; set; }

/// <summary>
/// Key-value store of custom data that will be applied to the mandate
/// created when this request is fulfilled. Up to 3 keys are permitted,
Expand All @@ -52,8 +60,11 @@ public class BillingRequestTemplate
public IDictionary<string, string> MandateRequestMetadata { get; set; }

/// <summary>
/// A Direct Debit scheme. Currently "ach", "bacs", "becs", "becs_nz",
/// "betalingsservice", "pad", "pay_to" and "sepa_core" are supported.
/// A bank payment scheme. Currently "ach", "autogiro", "bacs", "becs",
/// "becs_nz", "betalingsservice", "faster_payments", "pad", "pay_to"
/// and "sepa_core" are supported. Optional for mandate only requests -
/// if left blank, the payer will be able to select the currency/scheme
/// to pay with from a list of your available schemes.
/// </summary>
[JsonProperty("mandate_request_scheme")]
public string MandateRequestScheme { get; set; }
Expand Down Expand Up @@ -120,8 +131,8 @@ public class BillingRequestTemplate
public string PaymentRequestCurrency { get; set; }

/// <summary>
/// A human-readable description of the payment. This will be displayed
/// to the payer when authorising the billing request.
/// A human-readable description of the payment and/or mandate. This
/// will be displayed to the payer when authorising the billing request.
///
/// </summary>
[JsonProperty("payment_request_description")]
Expand Down
Loading

0 comments on commit 7c98a54

Please sign in to comment.