Skip to content

Commit

Permalink
Merge pull request #108 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Template changes
  • Loading branch information
jessezach authored Oct 26, 2023
2 parents 614ee1f + 10c9a3b commit 07edf8e
Show file tree
Hide file tree
Showing 19 changed files with 231 additions and 111 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.17.1</PackageVersion>
<PackageVersion>5.18.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.17.1</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/gocardless/gocardless-dotnet/releases/tag/v5.18.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.17.1 {runtimeFrameworkInformation} {Helpers.CleanupOSDescriptionString(OSRunningOn)}";
var userAgentInformation = $" gocardless-dotnet/5.18.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.17.1");
requestMessage.Headers.Add("GoCardless-Client-Version", "5.18.0");
requestMessage.Headers.Add("GoCardless-Client-Library", "gocardless-dotnet");
requestMessage.Headers.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _accessToken);
Expand Down
63 changes: 59 additions & 4 deletions GoCardless/Resources/BillingRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,22 @@ public class BillingRequestAction
[JsonProperty("completes_actions")]
public List<string> CompletesActions { get; set; }

/// <summary>
/// Describes whether we inferred the institution from the provided bank
/// account details. One of:
/// - `not_needed`: we won't attempt to infer the institution as it is
/// not needed. Either because it was manually selected or the billing
/// request does not support this feature
/// - `pending`: we are waiting on the bank details in order to infer
/// the institution
/// - `failed`: we weren't able to infer the institution
/// - `success`: we inferred the institution and added it to the
/// resources of a Billing Request
///
/// </summary>
[JsonProperty("institution_guess_status")]
public string InstitutionGuessStatus { get; set; }

/// <summary>
/// Informs you whether the action is required to fulfil the billing
/// request or not.
Expand Down Expand Up @@ -294,6 +310,36 @@ public class BillingRequestActionCollectCustomerDetailsIncompleteFields
public List<string> CustomerBillingDetail { get; set; }
}

/// <summary>
/// Describes whether we inferred the institution from the provided bank account details. One
/// of:
/// - `not_needed`: we won't attempt to infer the institution as it is not needed. Either
/// because it was manually selected or the billing request does not support this feature
/// - `pending`: we are waiting on the bank details in order to infer the institution
/// - `failed`: we weren't able to infer the institution
/// - `success`: we inferred the institution and added it to the resources of a Billing Request
///
/// </summary>
[JsonConverter(typeof(GcStringEnumConverter), (int)Unknown)]
public enum BillingRequestActionInstitutionGuessStatus {
/// <summary>Unknown status</summary>
[EnumMember(Value = "unknown")]
Unknown = 0,

/// <summary>`institution_guess_status` with a value of "not_needed"</summary>
[EnumMember(Value = "not_needed")]
NotNeeded,
/// <summary>`institution_guess_status` with a value of "pending"</summary>
[EnumMember(Value = "pending")]
Pending,
/// <summary>`institution_guess_status` with a value of "failed"</summary>
[EnumMember(Value = "failed")]
Failed,
/// <summary>`institution_guess_status` with a value of "success"</summary>
[EnumMember(Value = "success")]
Success,
}

/// <summary>
/// Status of the action
/// </summary>
Expand Down Expand Up @@ -402,6 +448,12 @@ public class BillingRequestLinks
[JsonProperty("organisation")]
public string Organisation { get; set; }

/// <summary>
/// (Optional) ID of the associated payment provider
/// </summary>
[JsonProperty("payment_provider")]
public string PaymentProvider { get; set; }

/// <summary>
/// (Optional) ID of the associated payment request
/// </summary>
Expand Down Expand Up @@ -568,7 +620,8 @@ public class BillingRequestMandateRequestConstraints
public string EndDate { get; set; }

/// <summary>
/// The maximum amount that can be charged for a single payment
/// The maximum amount that can be charged for a single payment.
/// Required for VRP.
/// </summary>
[JsonProperty("max_amount_per_payment")]
public int? MaxAmountPerPayment { get; set; }
Expand Down Expand Up @@ -612,15 +665,17 @@ public class BillingRequestMandateRequestConstraintPeriodicLimit
public BillingRequestMandateRequestConstraintPeriodicLimitAlignment? Alignment { get; set; }

/// <summary>
/// The maximum number of payments that can be collected in this
/// periodic limit
/// (Optional) 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
/// this periodic limit.
/// Required for VRP.
///
/// </summary>
[JsonProperty("max_total_amount")]
public int? MaxTotalAmount { get; set; }
Expand Down
31 changes: 31 additions & 0 deletions GoCardless/Resources/CreditorBankAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ public class CreditorBankAccount
/// </summary>
[JsonProperty("metadata")]
public IDictionary<string, string> Metadata { get; set; }

/// <summary>
/// Verification status of the Bank Account. Can be one of `pending`,
/// `in_review` or `successful`
/// </summary>
[JsonProperty("verification_status")]
public CreditorBankAccountVerificationStatus? VerificationStatus { get; set; }
}

/// <summary>
Expand Down Expand Up @@ -139,4 +146,28 @@ public class CreditorBankAccountLinks
public string Creditor { get; set; }
}

/// <summary>
/// Verification status of the Bank Account. Can be one of `pending`, `in_review` or
/// `successful`
/// </summary>
[JsonConverter(typeof(GcStringEnumConverter), (int)Unknown)]
public enum CreditorBankAccountVerificationStatus {
/// <summary>Unknown status</summary>
[EnumMember(Value = "unknown")]
Unknown = 0,

/// <summary>`verification_status` with a value of "pending"</summary>
[EnumMember(Value = "pending")]
Pending,
/// <summary>`verification_status` with a value of "in_review"</summary>
[EnumMember(Value = "in_review")]
InReview,
/// <summary>`verification_status` with a value of "successful"</summary>
[EnumMember(Value = "successful")]
Successful,
/// <summary>`verification_status` with a value of "could_not_verify"</summary>
[EnumMember(Value = "could_not_verify")]
CouldNotVerify,
}

}
20 changes: 17 additions & 3 deletions GoCardless/Resources/Event.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,27 @@ public class Event
public EventLinks Links { get; set; }

/// <summary>
/// If the `details[origin]` is `api`, this will contain any metadata
/// you specified when triggering this event. In other cases it will be
/// an empty object.
/// The metadata that was passed when making the API request that
/// triggered the event
/// (for instance, cancelling a mandate).
///
/// This field will only be populated if the `details[origin]` field is
/// `api` otherwise it will be an empty object.
///
/// </summary>
[JsonProperty("metadata")]
public IDictionary<string, string> Metadata { get; set; }

/// <summary>
/// The metadata of the resource that the event is for. For example,
/// this field will have the same
/// value of the `mandate[metadata]` field on the response you would
/// receive from performing a GET request on a mandate.
///
/// </summary>
[JsonProperty("resource_metadata")]
public IDictionary<string, string> ResourceMetadata { get; set; }

/// <summary>
/// The resource type for this event. One of:
/// <ul>
Expand Down
36 changes: 36 additions & 0 deletions GoCardless/Resources/Mandate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@ public class Mandate
[JsonProperty("created_at")]
public DateTimeOffset? CreatedAt { get; set; }

/// <summary>
/// This field will decide how GoCardless handles settlement of funds
/// from the customer.
///
/// - `managed` will be moved through GoCardless' account, batched, and
/// payed out.
/// - `direct` will be a direct transfer from the payer's account to the
/// merchant where
/// invoicing will be handled separately.
///
/// </summary>
[JsonProperty("funds_settlement")]
public MandateFundsSettlement? FundsSettlement { get; set; }

/// <summary>
/// Unique identifier, beginning with "MD". Note that this prefix may
/// not apply to mandates created before 2016.
Expand Down Expand Up @@ -246,6 +260,28 @@ public enum MandateConsentParameterPeriodPeriod {
Flexible,
}

/// <summary>
/// This field will decide how GoCardless handles settlement of funds from the customer.
///
/// - `managed` will be moved through GoCardless' account, batched, and payed out.
/// - `direct` will be a direct transfer from the payer's account to the merchant where
/// invoicing will be handled separately.
///
/// </summary>
[JsonConverter(typeof(GcStringEnumConverter), (int)Unknown)]
public enum MandateFundsSettlement {
/// <summary>Unknown status</summary>
[EnumMember(Value = "unknown")]
Unknown = 0,

/// <summary>`funds_settlement` with a value of "managed"</summary>
[EnumMember(Value = "managed")]
Managed,
/// <summary>`funds_settlement` with a value of "direct"</summary>
[EnumMember(Value = "direct")]
Direct,
}

/// <summary>
/// Resources linked to this Mandate
/// </summary>
Expand Down
20 changes: 20 additions & 0 deletions GoCardless/Resources/MandateImport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ public class MandateImport
[JsonProperty("id")]
public string Id { get; set; }

/// <summary>
/// Resources linked to this MandateImport.
/// </summary>
[JsonProperty("links")]
public MandateImportLinks Links { get; set; }

/// <summary>
/// The scheme of the mandates to be imported.<br>All mandates in a
/// single mandate
Expand Down Expand Up @@ -98,6 +104,20 @@ public class MandateImport
public MandateImportStatus? Status { get; set; }
}

/// <summary>
/// Represents a mandate import link resource.
///
/// Related resources
/// </summary>
public class MandateImportLinks
{
/// <summary>
/// ID of the associated creditor.
/// </summary>
[JsonProperty("creditor")]
public string Creditor { get; set; }
}

/// <summary>
/// The scheme of the mandates to be imported.<br>All mandates in a single mandate
/// import must be for the same scheme.
Expand Down
19 changes: 0 additions & 19 deletions GoCardless/Resources/NegativeBalanceLimit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ namespace GoCardless.Resources
/// </summary>
public class NegativeBalanceLimit
{
/// <summary>
/// Whether or not this limit is currently active
/// </summary>
[JsonProperty("active")]
public bool? Active { get; set; }

/// <summary>
/// The limit amount in pence (e.g. 10000 for a -100 GBP limit).
/// </summary>
Expand Down Expand Up @@ -57,19 +51,6 @@ public class NegativeBalanceLimit
/// </summary>
[JsonProperty("links")]
public NegativeBalanceLimitLinks Links { get; set; }

/// <summary>
/// the reason this limit was created
/// </summary>
[JsonProperty("reason")]
public string Reason { get; set; }

/// <summary>
/// Fixed [timestamp](#api-usage-time-zones--dates), recording when this
/// limit was last updated.
/// </summary>
[JsonProperty("updated_at")]
public string UpdatedAt { get; set; }
}

/// <summary>
Expand Down
7 changes: 3 additions & 4 deletions GoCardless/Resources/RedirectFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ namespace GoCardless.Resources
/// Represents a redirect flow resource.
///
/// <p class="deprecated-notice"><strong>Deprecated</strong>: Redirect Flows
/// are our legacy APIs for setting up
/// mandates and will no longer be supported in the future. We strongly
/// recommend using the
/// [Billing Request flow](#billing-requests) instead.</p>
/// are legacy APIs and cannot be used by new integrators.
/// The [Billing Request flow](#billing-requests) API should be used for
/// your payment flows.</p>
///
/// Redirect flows enable you to use GoCardless' [hosted payment
/// pages](https://pay-sandbox.gocardless.com/AL000000AKFPFF) to set up
Expand Down
4 changes: 2 additions & 2 deletions GoCardless/Resources/ScenarioSimulator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ public class ScenarioSimulator
/// through `transferred` and resubmits it to the banks, can be caused
/// be the UK's Current Account Switching Service (CASS) or when a
/// customer contacts GoCardless to change their bank details. It must
/// start in the `pending_submission` state. Only compatible with Bacs,
/// SEPA and Autogiro mandates.</li>
/// start in the `pending_submission` state. Only compatible with Bacs
/// mandates.</li>
/// <li>`mandate_suspended_by_payer`: Transitions a mandate to
/// `suspended_by_payer`, as if payer has suspended the mandate after it
/// has been setup successfully. It must start in the `activated` state.
Expand Down
11 changes: 7 additions & 4 deletions GoCardless/Services/BillingRequestService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,8 @@ public class BillingRequestConstraints
public string EndDate { get; set; }

/// <summary>
/// The maximum amount that can be charged for a single payment
/// The maximum amount that can be charged for a single payment.
/// Required for VRP.
/// </summary>
[JsonProperty("max_amount_per_payment")]
public int? MaxAmountPerPayment { get; set; }
Expand Down Expand Up @@ -554,15 +555,17 @@ public enum BillingRequestAlignment
}

/// <summary>
/// The maximum number of payments that can be collected in this
/// periodic limit
/// (Optional) 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
/// this periodic limit.
/// Required for VRP.
///
/// </summary>
[JsonProperty("max_total_amount")]
public int? MaxTotalAmount { get; set; }
Expand Down
Loading

0 comments on commit 07edf8e

Please sign in to comment.