Skip to content

Commit

Permalink
Merge pull request #71 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Changes from gocardless-dotnet-template
  • Loading branch information
vdandugc authored Aug 12, 2021
2 parents e0d5683 + 72f2662 commit c8a596f
Show file tree
Hide file tree
Showing 15 changed files with 1,001 additions and 15 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.9.0</PackageVersion>
<PackageVersion>4.10.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.9.0</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/gocardless/gocardless-dotnet/releases/tag/v4.10.0</PackageReleaseNotes>
<TargetFrameworks>netstandard1.6;netstandard2.0;net46</TargetFrameworks>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
5 changes: 5 additions & 0 deletions GoCardless/GoCardlessClient.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public partial class GoCardlessClient
/// </summary>
public BillingRequestFlowService BillingRequestFlows => new BillingRequestFlowService(this);

/// <summary>
///A service for working with billing request template resources.
/// </summary>
public BillingRequestTemplateService BillingRequestTemplates => new BillingRequestTemplateService(this);

/// <summary>
///A service for working with creditor resources.
/// </summary>
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.9.0");
requestMessage.Headers.Add("User-Agent", "gocardless-dotnet/4.10.0");
requestMessage.Headers.Add("GoCardless-Version", "2015-07-06");
requestMessage.Headers.Add("GoCardless-Client-Version", "4.9.0");
requestMessage.Headers.Add("GoCardless-Client-Version", "4.10.0");
requestMessage.Headers.Add("GoCardless-Client-Library", "gocardless-dotnet");
requestMessage.Headers.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _accessToken);
Expand Down
11 changes: 8 additions & 3 deletions GoCardless/Resources/BankAuthorisation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ namespace GoCardless.Resources
/// UIs
/// (see Billing Request Flows) to ensure we meet regulatory requirements
/// for
/// checkout flows. The exceptions are integrators with the custom payment
/// pages
/// upgrade, who have been audited to check their flows meet requirements.
/// checkout flows.
/// </summary>
public class BankAuthorisation
{
Expand All @@ -33,6 +31,13 @@ public class BankAuthorisation
[JsonProperty("authorisation_type")]
public string AuthorisationType { get; set; }

/// <summary>
/// Fixed [timestamp](#api-usage-time-zones--dates), recording when the
/// user has been authorised.
/// </summary>
[JsonProperty("authorised_at")]
public string AuthorisedAt { get; set; }

/// <summary>
/// Timestamp when the flow was created
/// </summary>
Expand Down
205 changes: 204 additions & 1 deletion GoCardless/Resources/BillingRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,17 @@ namespace GoCardless.Resources
/// <summary>
/// Represents a billing request resource.
///
/// Billing Requests
/// Billing Requests help create resources that require input or action from
/// a
/// customer. An example of required input might be additional customer
/// billing
/// details, while an action would be asking a customer to authorise a
/// payment
/// using their mobile banking app.
///
/// See [Billing Requests:
/// Overview](https://developer.gocardless.com/getting-started/billing-requests/overview/)
/// for how-to's, explanations and tutorials.
/// </summary>
public class BillingRequest
{
Expand Down Expand Up @@ -87,6 +97,20 @@ public class BillingRequest
/// </summary>
public class BillingRequestAction
{
/// <summary>
/// Describes the behaviour of bank authorisations, for the
/// bank_authorisation action
/// </summary>
[JsonProperty("bank_authorisation")]
public BillingRequestActionBankAuthorisation BankAuthorisation { get; set; }

/// <summary>
/// Additional parameters to help complete the collect_customer_details
/// action
/// </summary>
[JsonProperty("collect_customer_details")]
public BillingRequestActionCollectCustomerDetails CollectCustomerDetails { get; set; }

/// <summary>
/// Which other action types this action can complete.
/// </summary>
Expand Down Expand Up @@ -120,6 +144,87 @@ public class BillingRequestAction
public string Type { get; set; }
}

/// <summary>
/// Represents a billing request action bank authorisation resource.
///
/// Describes the behaviour of bank authorisations, for the
/// bank_authorisation action
/// </summary>
public class BillingRequestActionBankAuthorisation
{
/// <summary>
/// Which authorisation adapter will be used to power these
/// authorisations (GoCardless internal use only)
/// </summary>
[JsonProperty("adapter")]
public string Adapter { get; set; }

/// <summary>
/// What type of bank authorisations are supported on this billing
/// request
/// </summary>
[JsonProperty("authorisation_type")]
public string AuthorisationType { get; set; }

/// <summary>
/// Whether an institution is a required field when creating this bank
/// authorisation
/// </summary>
[JsonProperty("requires_institution")]
public bool? RequiresInstitution { get; set; }
}

/// <summary>
/// Which authorisation adapter will be used to power these authorisations (GoCardless internal
/// use only)
/// </summary>
[JsonConverter(typeof(GcStringEnumConverter), (int)Unknown)]
public enum BillingRequestActionBankAuthorisationAdapter {
/// <summary>Unknown status</summary>
[EnumMember(Value = "unknown")]
Unknown = 0,

/// <summary>`adapter` with a value of "open_banking_gateway_pis"</summary>
[EnumMember(Value = "open_banking_gateway_pis")]
OpenBankingGatewayPis,
/// <summary>`adapter` with a value of "plaid_ais"</summary>
[EnumMember(Value = "plaid_ais")]
PlaidAis,
}

/// <summary>
/// What type of bank authorisations are supported on this billing request
/// </summary>
[JsonConverter(typeof(GcStringEnumConverter), (int)Unknown)]
public enum BillingRequestActionBankAuthorisationAuthorisationType {
/// <summary>Unknown status</summary>
[EnumMember(Value = "unknown")]
Unknown = 0,

/// <summary>`authorisation_type` with a value of "payment"</summary>
[EnumMember(Value = "payment")]
Payment,
/// <summary>`authorisation_type` with a value of "mandate"</summary>
[EnumMember(Value = "mandate")]
Mandate,
}

/// <summary>
/// Represents a billing request action collect customer detail resource.
///
/// Additional parameters to help complete the collect_customer_details
/// action
/// </summary>
public class BillingRequestActionCollectCustomerDetails
{
/// <summary>
/// Default customer country code, as determined by scheme and payer
/// location
/// </summary>
[JsonProperty("default_country_code")]
public string DefaultCountryCode { get; set; }
}

/// <summary>
/// Status of the action
/// </summary>
Expand Down Expand Up @@ -158,6 +263,9 @@ public enum BillingRequestActionType {
/// <summary>`type` with a value of "bank_authorisation"</summary>
[EnumMember(Value = "bank_authorisation")]
BankAuthorisation,
/// <summary>`type` with a value of "confirm_payer_details"</summary>
[EnumMember(Value = "confirm_payer_details")]
ConfirmPayerDetails,
}

/// <summary>
Expand Down Expand Up @@ -199,6 +307,32 @@ public class BillingRequestLinks
/// </summary>
[JsonProperty("customer_billing_detail")]
public string CustomerBillingDetail { get; set; }

/// <summary>
/// (Optional) ID of the associated mandate request
/// </summary>
[JsonProperty("mandate_request")]
public string MandateRequest { get; set; }

/// <summary>
/// (Optional) ID of the [mandate](#core-endpoints-mandates) that was
/// created from this mandate request. this mandate request.
/// </summary>
[JsonProperty("mandate_request_mandate")]
public string MandateRequestMandate { get; set; }

/// <summary>
/// (Optional) ID of the associated payment request
/// </summary>
[JsonProperty("payment_request")]
public string PaymentRequest { get; set; }

/// <summary>
/// (Optional) ID of the [payment](#core-endpoints-payments) that was
/// created from this payment request.
/// </summary>
[JsonProperty("payment_request_payment")]
public string PaymentRequestPayment { get; set; }
}

/// <summary>
Expand Down Expand Up @@ -228,6 +362,24 @@ public class BillingRequestMandateRequest
/// </summary>
[JsonProperty("scheme")]
public string Scheme { get; set; }

/// <summary>
/// Verification preference for the mandate. One of:
/// <ul>
/// <li>`minimum`: only verify if absolutely required, such as when
/// part of scheme rules</li>
/// <li>`recommended`: in addition to minimum, use the GoCardless risk
/// engine to decide an appropriate level of verification</li>
/// <li>`when_available`: if verification mechanisms are available,
/// use them</li>
/// <li>`always`: as `when_available`, but fail to create the Billing
/// Request if a mechanism isn't available</li>
/// </ul>
///
/// If not provided, the `recommended` level is chosen.
/// </summary>
[JsonProperty("verify")]
public BillingRequestMandateRequestVerify? Verify { get; set; }
}

/// <summary>
Expand All @@ -244,6 +396,39 @@ public class BillingRequestMandateRequestLinks
public string Mandate { get; set; }
}

/// <summary>
/// Verification preference for the mandate. One of:
/// <ul>
/// <li>`minimum`: only verify if absolutely required, such as when part of scheme rules</li>
/// <li>`recommended`: in addition to minimum, use the GoCardless risk engine to decide an
/// appropriate level of verification</li>
/// <li>`when_available`: if verification mechanisms are available, use them</li>
/// <li>`always`: as `when_available`, but fail to create the Billing Request if a mechanism
/// isn't available</li>
/// </ul>
///
/// If not provided, the `recommended` level is chosen.
/// </summary>
[JsonConverter(typeof(GcStringEnumConverter), (int)Unknown)]
public enum BillingRequestMandateRequestVerify {
/// <summary>Unknown status</summary>
[EnumMember(Value = "unknown")]
Unknown = 0,

/// <summary>`verify` with a value of "minimum"</summary>
[EnumMember(Value = "minimum")]
Minimum,
/// <summary>`verify` with a value of "recommended"</summary>
[EnumMember(Value = "recommended")]
Recommended,
/// <summary>`verify` with a value of "when_available"</summary>
[EnumMember(Value = "when_available")]
WhenAvailable,
/// <summary>`verify` with a value of "always"</summary>
[EnumMember(Value = "always")]
Always,
}

/// <summary>
/// Represents a billing request payment request resource.
///
Expand All @@ -257,6 +442,15 @@ public class BillingRequestPaymentRequest
[JsonProperty("amount")]
public int? Amount { get; set; }

/// <summary>
/// The amount to be deducted from the payment as an app fee, to be paid
/// to the partner integration which created the billing request, in the
/// lowest denomination for the currency (e.g. pence in GBP, cents in
/// EUR).
/// </summary>
[JsonProperty("app_fee")]
public int? AppFee { get; set; }

/// <summary>
/// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes)
/// currency code. Currently only "GBP" is supported as we only have one
Expand Down Expand Up @@ -579,6 +773,15 @@ public class BillingRequestResourcesCustomerBillingDetail
[JsonProperty("id")]
public string Id { get; set; }

/// <summary>
/// For ACH customers only. Required for ACH customers. A string
/// containing the IP address of the payer to whom the mandate belongs
/// (i.e. as a result of their completion of a mandate setup flow in
/// their browser).
/// </summary>
[JsonProperty("ip_address")]
public string IpAddress { get; set; }

/// <summary>
/// The customer's postal code.
/// </summary>
Expand Down
Loading

0 comments on commit c8a596f

Please sign in to comment.