Skip to content

Commit

Permalink
Merge pull request #84 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Changes from gocardless-dotnet-template
  • Loading branch information
Yusuf B authored Jun 29, 2022
2 parents 15136fb + 2795c9f commit 855e366
Show file tree
Hide file tree
Showing 16 changed files with 219 additions and 22 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.3.0</PackageVersion>
<PackageVersion>5.4.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.3.0</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/gocardless/gocardless-dotnet/releases/tag/v5.4.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.3.0 {runtimeFrameworkInformation} {Helpers.CleanupOSDescriptionString(OSRunningOn)}";
var userAgentInformation = $" gocardless-dotnet/5.4.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.3.0");
requestMessage.Headers.Add("GoCardless-Client-Version", "5.4.0");
requestMessage.Headers.Add("GoCardless-Client-Library", "gocardless-dotnet");
requestMessage.Headers.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _accessToken);
Expand Down
46 changes: 44 additions & 2 deletions GoCardless/Resources/BillingRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ public class BillingRequest
public DateTimeOffset? CreatedAt { get; set; }

/// <summary>
/// If true, this billing request can fallback from instant payment to
/// direct debit.
/// (Optional) If true, this billing request can fallback from instant
/// payment to direct debit.
/// Should not be set if GoCardless payment intelligence feature is
/// used.
///
/// See [Billing Requests: Retain customers with
/// Fallbacks](https://developer.gocardless.com/getting-started/billing-requests/retain-customers-with-fallbacks/)
/// for more information.
/// </summary>
[JsonProperty("fallback_enabled")]
public bool? FallbackEnabled { get; set; }
Expand Down Expand Up @@ -88,6 +94,8 @@ public class BillingRequest
/// <ul>
/// <li>`pending`: the billing request is pending and can be used</li>
/// <li>`ready_to_fulfil`: the billing request is ready to fulfil</li>
/// <li>`fulfilling`: the billing request is currently undergoing
/// fulfilment</li>
/// <li>`fulfilled`: the billing request has been fulfilled and a
/// payment created</li>
/// <li>`cancelled`: the billing request has been cancelled and cannot
Expand All @@ -104,6 +112,12 @@ public class BillingRequest
/// </summary>
public class BillingRequestAction
{
/// <summary>
/// List of currencies the current mandate supports
/// </summary>
[JsonProperty("available_currencies")]
public List<string> AvailableCurrencies { get; set; }

/// <summary>
/// Describes the behaviour of bank authorisations, for the
/// bank_authorisation action
Expand Down Expand Up @@ -151,6 +165,21 @@ public class BillingRequestAction
public string Type { get; set; }
}

/// <summary>
/// Represents a billing request action available currency resource.
///
/// List of currencies the current mandate supports
/// </summary>
public class BillingRequestActionAvailableCurrencies
{
/// <summary>
/// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes)
/// currency code.
/// </summary>
[JsonProperty("currency")]
public string Currency { get; set; }
}

/// <summary>
/// Represents a billing request action bank authorisation resource.
///
Expand Down Expand Up @@ -203,6 +232,9 @@ public enum BillingRequestActionBankAuthorisationAdapter {
/// <summary>`adapter` with a value of "bankid_ais"</summary>
[EnumMember(Value = "bankid_ais")]
BankidAis,
/// <summary>`adapter` with a value of "bank_pay_recurring"</summary>
[EnumMember(Value = "bank_pay_recurring")]
BankPayRecurring,
}

/// <summary>
Expand Down Expand Up @@ -337,6 +369,12 @@ public class BillingRequestLinks
[JsonProperty("mandate_request_mandate")]
public string MandateRequestMandate { get; set; }

/// <summary>
/// ID of the associated organisation.
/// </summary>
[JsonProperty("organisation")]
public string Organisation { get; set; }

/// <summary>
/// (Optional) ID of the associated payment request
/// </summary>
Expand Down Expand Up @@ -876,6 +914,7 @@ public class BillingRequestResourcesCustomerBillingDetail
/// <ul>
/// <li>`pending`: the billing request is pending and can be used</li>
/// <li>`ready_to_fulfil`: the billing request is ready to fulfil</li>
/// <li>`fulfilling`: the billing request is currently undergoing fulfilment</li>
/// <li>`fulfilled`: the billing request has been fulfilled and a payment created</li>
/// <li>`cancelled`: the billing request has been cancelled and cannot be used</li>
/// </ul>
Expand All @@ -892,6 +931,9 @@ public enum BillingRequestStatus {
/// <summary>`status` with a value of "ready_to_fulfil"</summary>
[EnumMember(Value = "ready_to_fulfil")]
ReadyToFulfil,
/// <summary>`status` with a value of "fulfilling"</summary>
[EnumMember(Value = "fulfilling")]
Fulfilling,
/// <summary>`status` with a value of "fulfilled"</summary>
[EnumMember(Value = "fulfilled")]
Fulfilled,
Expand Down
9 changes: 9 additions & 0 deletions GoCardless/Resources/BillingRequestFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ public class BillingRequestFlow
[JsonProperty("lock_bank_account")]
public bool? LockBankAccount { get; set; }

/// <summary>
/// If true, the payer will not be able to change their currency/scheme
/// manually within the flow. Note that this only applies to the mandate
/// only flows - currency/scheme can never be changed when there is a
/// specified subscription or payment.
/// </summary>
[JsonProperty("lock_currency")]
public bool? LockCurrency { get; set; }

/// <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
Expand Down
3 changes: 3 additions & 0 deletions GoCardless/Resources/Creditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,9 @@ public enum CreditorSchemeIdentifierScheme {
/// <summary>`scheme` with a value of "sepa_instant_credit_transfer"</summary>
[EnumMember(Value = "sepa_instant_credit_transfer")]
SepaInstantCreditTransfer,
/// <summary>`scheme` with a value of "pay_to"</summary>
[EnumMember(Value = "pay_to")]
PayTo,
}

/// <summary>
Expand Down
7 changes: 7 additions & 0 deletions GoCardless/Resources/CustomerBankAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ namespace GoCardless.Resources
/// bank account. You may wish to handle this by updating the existing
/// record instead, the ID of which will be provided as
/// `links[customer_bank_account]` in the error response.
///
/// _Note:_ To ensure the customer's bank accounts are valid, verify them
/// first
/// using
///
/// [bank_details_lookups](#bank-details-lookups-perform-a-bank-details-lookup),
/// before proceeding with creating the accounts
/// </summary>
public class CustomerBankAccount
{
Expand Down
6 changes: 4 additions & 2 deletions GoCardless/Resources/Event.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ namespace GoCardless.Resources
///
/// Events are stored for all webhooks. An event refers to a resource which
/// has been updated, for example a payment which has been collected, or a
/// mandate which has been transferred. See [here](#event-actions) for a
/// complete list of event types.
/// mandate which has been transferred. Event creation is an asynchronous
/// process, so it can take some time between an action occurring and its
/// corresponding event getting included in API responses. See
/// [here](#event-actions) for a complete list of event types.
/// </summary>
public class Event
{
Expand Down
8 changes: 8 additions & 0 deletions GoCardless/Resources/Institution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ namespace GoCardless.Resources
/// </summary>
public class Institution
{
/// <summary>
/// Flag to show if the institution supports redirection to its
/// authorisation flow or if a provider's one is being used. The bank
/// authorisation screen on the UI is visible based on this property.
/// </summary>
[JsonProperty("bank_redirect")]
public bool? BankRedirect { get; set; }

/// <summary>
/// [ISO
/// 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
Expand Down
9 changes: 4 additions & 5 deletions GoCardless/Resources/ScenarioSimulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,10 @@ public class ScenarioSimulator
/// The refund must start in `pending_submission`.</li>
/// <li>`payout_bounced`: Transitions a payout to `bounced`. It must
/// start in the `paid` state.</li>
/// <li>`billing_request_fulfilled`: Authorises the billing request,
/// fulfils it, and moves the associated payment to `failed`. The
/// billing request must be in the `pending` state, with all actions
/// completed except for `bank_authorisation`. Only billing requests
/// with a `payment_request` are supported.</li>
/// <li>`billing_request_fulfilled`: Authorises the billing request, and
/// then fulfils it. The billing request must be in the `pending` state,
/// with all actions completed except for `bank_authorisation`. Only
/// billing requests with a `payment_request` are supported.</li>
/// <li>`billing_request_fulfilled_and_payment_failed`: Authorises the
/// billing request, fulfils it, and moves the associated payment to
/// `failed`. The billing request must be in the `pending` state, with
Expand Down
19 changes: 19 additions & 0 deletions GoCardless/Services/BankDetailsLookupService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ public BankDetailsLookupService(GoCardlessClient goCardlessClient)
/// Bank account details may be supplied using [local
/// details](#appendix-local-bank-details) or an IBAN.
///
/// _ACH scheme_ For compliance reasons, an extra validation step is
/// done using
/// a third-party provider to make sure the customer's bank account can
/// accept
/// Direct Debit. If a bank account is discovered to be closed or
/// invalid, the
/// customer is requested to adjust the account number/routing number
/// and
/// succeed in this check to continue with the flow.
///
/// _Note:_ Usage of this endpoint is monitored. If your organisation
/// relies on GoCardless for
/// modulus or reachability checking but not for payment collection,
Expand Down Expand Up @@ -84,6 +94,15 @@ public Task<BankDetailsLookupResponse> CreateAsync(BankDetailsLookupCreateReques
/// Bank account details may be supplied using [local
/// details](#appendix-local-bank-details) or an IBAN.
///
/// _ACH scheme_ For compliance reasons, an extra validation step is done
/// using
/// a third-party provider to make sure the customer's bank account can
/// accept
/// Direct Debit. If a bank account is discovered to be closed or invalid,
/// the
/// customer is requested to adjust the account number/routing number and
/// succeed in this check to continue with the flow.
///
/// _Note:_ Usage of this endpoint is monitored. If your organisation relies
/// on GoCardless for
/// modulus or reachability checking but not for payment collection, please
Expand Down
9 changes: 9 additions & 0 deletions GoCardless/Services/BillingRequestFlowService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ public class BillingRequestFlowLinks
[JsonProperty("lock_bank_account")]
public bool? LockBankAccount { get; set; }

/// <summary>
/// If true, the payer will not be able to change their currency/scheme
/// manually within the flow. Note that this only applies to the mandate
/// only flows - currency/scheme can never be changed when there is a
/// specified subscription or payment.
/// </summary>
[JsonProperty("lock_currency")]
public bool? LockCurrency { get; set; }

/// <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
Expand Down
Loading

0 comments on commit 855e366

Please sign in to comment.