Skip to content

Commit

Permalink
Merge pull request #134 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Changes from gocardless/gocardless-dotnet-template
  • Loading branch information
KarmanLeung committed Aug 5, 2024
2 parents 36fd9b6 + 61ffcd9 commit 257b502
Show file tree
Hide file tree
Showing 17 changed files with 443 additions and 68 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>6.5.0</PackageVersion>
<PackageVersion>6.6.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/v6.5.0</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/gocardless/gocardless-dotnet/releases/tag/v6.6.0</PackageReleaseNotes>
<TargetFrameworks>netstandard1.6;netstandard2.0;netstandard2.1;net46;net8.0</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 @@ -73,6 +73,11 @@ public partial class GoCardlessClient
/// </summary>
public EventService Events => new EventService(this);

/// <summary>
///A service for working with export resources.
/// </summary>
public ExportService Exports => new ExportService(this);

/// <summary>
///A service for working with instalment schedule 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 @@ -277,11 +277,11 @@ private HttpRequestMessage BuildHttpRequestMessage<T>(string method, string path
runtimeFrameworkInformation = System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion();
#endif

var userAgentInformation = $" gocardless-dotnet/6.5.0 {runtimeFrameworkInformation} {Helpers.CleanupOSDescriptionString(OSRunningOn)}";
var userAgentInformation = $" gocardless-dotnet/6.6.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", "6.5.0");
requestMessage.Headers.Add("GoCardless-Client-Version", "6.6.0");
requestMessage.Headers.Add("GoCardless-Client-Library", "gocardless-dotnet");
requestMessage.Headers.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _accessToken);
Expand Down
24 changes: 16 additions & 8 deletions GoCardless/Resources/BillingRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,8 @@ public class BillingRequestPaymentRequest
/// <summary>
/// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes)
/// currency code. `GBP` and `EUR` supported; `GBP` with your customers
/// in the UK and for `EUR` with your customers in Germany only.
/// in the UK and for `EUR` with your customers in supported Eurozone
/// countries only.
/// </summary>
[JsonProperty("currency")]
public string Currency { get; set; }
Expand Down Expand Up @@ -871,14 +872,23 @@ public class BillingRequestPaymentRequest
[JsonProperty("metadata")]
public IDictionary<string, string> Metadata { get; set; }

/// <summary>
/// A custom payment reference defined by the merchant. It is only
/// available for payments using the Direct Funds settlement model on
/// the Faster Payments scheme.
///
/// </summary>
[JsonProperty("reference")]
public string Reference { get; set; }

/// <summary>
/// (Optional) A scheme used for Open Banking payments. Currently
/// `faster_payments` is supported in the UK (GBP) and
/// `sepa_credit_transfer` and `sepa_instant_credit_transfer` are
/// supported in Germany (EUR). In Germany, `sepa_credit_transfer` is
/// used as the default. Please be aware that
/// `sepa_instant_credit_transfer` may incur an additional fee for your
/// customer.
/// supported in supported Eurozone countries (EUR). For Eurozone
/// countries, `sepa_credit_transfer` is used as the default. Please be
/// aware that `sepa_instant_credit_transfer` may incur an additional
/// fee for your customer.
/// </summary>
[JsonProperty("scheme")]
public string Scheme { get; set; }
Expand Down Expand Up @@ -1075,9 +1085,7 @@ public class BillingRequestResourcesCustomer
public class BillingRequestResourcesCustomerBankAccount
{
/// <summary>
/// Name of the account holder, as known by the bank. Usually this is
/// the same as the name stored with the linked
/// [creditor](#core-endpoints-creditors). This field will be
/// Name of the account holder, as known by the bank. This field will be
/// transliterated, upcased and truncated to 18 characters. This field
/// is required unless the request includes a [customer bank account
/// token](#javascript-flow-customer-bank-account-tokens).
Expand Down
11 changes: 6 additions & 5 deletions GoCardless/Resources/BillingRequestTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ public class BillingRequestTemplate
/// <summary>
/// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes)
/// currency code. `GBP` and `EUR` supported; `GBP` with your customers
/// in the UK and for `EUR` with your customers in Germany only.
/// in the UK and for `EUR` with your customers in supported Eurozone
/// countries only.
/// </summary>
[JsonProperty("payment_request_currency")]
public string PaymentRequestCurrency { get; set; }
Expand All @@ -164,10 +165,10 @@ public class BillingRequestTemplate
/// (Optional) A scheme used for Open Banking payments. Currently
/// `faster_payments` is supported in the UK (GBP) and
/// `sepa_credit_transfer` and `sepa_instant_credit_transfer` are
/// supported in Germany (EUR). In Germany, `sepa_credit_transfer` is
/// used as the default. Please be aware that
/// `sepa_instant_credit_transfer` may incur an additional fee for your
/// customer.
/// supported in supported Eurozone countries (EUR). For Eurozone
/// countries, `sepa_credit_transfer` is used as the default. Please be
/// aware that `sepa_instant_credit_transfer` may incur an additional
/// fee for your customer.
/// </summary>
[JsonProperty("payment_request_scheme")]
public string PaymentRequestScheme { get; set; }
Expand Down
4 changes: 1 addition & 3 deletions GoCardless/Resources/CustomerBankAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ namespace GoCardless.Resources
public class CustomerBankAccount
{
/// <summary>
/// Name of the account holder, as known by the bank. Usually this is
/// the same as the name stored with the linked
/// [creditor](#core-endpoints-creditors). This field will be
/// Name of the account holder, as known by the bank. This field will be
/// transliterated, upcased and truncated to 18 characters. This field
/// is required unless the request includes a [customer bank account
/// token](#javascript-flow-customer-bank-account-tokens).
Expand Down
5 changes: 5 additions & 0 deletions GoCardless/Resources/Event.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public class Event
/// <ul>
/// <li>`billing_requests`</li>
/// <li>`creditors`</li>
/// <li>`exports`</li>
/// <li>`instalment_schedules`</li>
/// <li>`mandates`</li>
/// <li>`payer_authorisations`</li>
Expand Down Expand Up @@ -476,6 +477,7 @@ public class EventLinks
/// <ul>
/// <li>`billing_requests`</li>
/// <li>`creditors`</li>
/// <li>`exports`</li>
/// <li>`instalment_schedules`</li>
/// <li>`mandates`</li>
/// <li>`payer_authorisations`</li>
Expand All @@ -498,6 +500,9 @@ public enum EventResourceType {
/// <summary>`resource_type` with a value of "creditors"</summary>
[EnumMember(Value = "creditors")]
Creditors,
/// <summary>`resource_type` with a value of "exports"</summary>
[EnumMember(Value = "exports")]
Exports,
/// <summary>`resource_type` with a value of "instalment_schedules"</summary>
[EnumMember(Value = "instalment_schedules")]
InstalmentSchedules,
Expand Down
127 changes: 127 additions & 0 deletions GoCardless/Resources/Export.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using GoCardless.Internals;

namespace GoCardless.Resources
{

/// <summary>
/// Represents a export resource.
///
/// File-based exports of data
/// </summary>
public class Export
{
/// <summary>
/// Fixed [timestamp](#api-usage-time-zones--dates), recording when this
/// resource was created.
/// </summary>
[JsonProperty("created_at")]
public DateTimeOffset? CreatedAt { get; set; }

/// <summary>
/// The currency of the export (if applicable)
/// </summary>
[JsonProperty("currency")]
public string Currency { get; set; }

/// <summary>
/// Download url for the export file. Subject to expiry.
/// </summary>
[JsonProperty("download_url")]
public string DownloadUrl { get; set; }

/// <summary>
/// The type of the export
/// </summary>
[JsonProperty("export_type")]
public ExportExportType? ExportType { get; set; }

/// <summary>
/// Unique identifier, beginning with "EX".
/// </summary>
[JsonProperty("id")]
public string Id { get; set; }
}

/// <summary>
/// The type of the export
/// </summary>
[JsonConverter(typeof(GcStringEnumConverter), (int)Unknown)]
public enum ExportExportType {
/// <summary>Unknown status</summary>
[EnumMember(Value = "unknown")]
Unknown = 0,

/// <summary>`export_type` with a value of "payments_index"</summary>
[EnumMember(Value = "payments_index")]
PaymentsIndex,
/// <summary>`export_type` with a value of "events_index"</summary>
[EnumMember(Value = "events_index")]
EventsIndex,
/// <summary>`export_type` with a value of "refunds_index"</summary>
[EnumMember(Value = "refunds_index")]
RefundsIndex,
/// <summary>`export_type` with a value of "payouts_index"</summary>
[EnumMember(Value = "payouts_index")]
PayoutsIndex,
/// <summary>`export_type` with a value of "customers_index"</summary>
[EnumMember(Value = "customers_index")]
CustomersIndex,
/// <summary>`export_type` with a value of "subscriptions_index"</summary>
[EnumMember(Value = "subscriptions_index")]
SubscriptionsIndex,
/// <summary>`export_type` with a value of "payment_events"</summary>
[EnumMember(Value = "payment_events")]
PaymentEvents,
/// <summary>`export_type` with a value of "subscription_events"</summary>
[EnumMember(Value = "subscription_events")]
SubscriptionEvents,
/// <summary>`export_type` with a value of "payout_events"</summary>
[EnumMember(Value = "payout_events")]
PayoutEvents,
/// <summary>`export_type` with a value of "refund_events"</summary>
[EnumMember(Value = "refund_events")]
RefundEvents,
/// <summary>`export_type` with a value of "mandate_events"</summary>
[EnumMember(Value = "mandate_events")]
MandateEvents,
/// <summary>`export_type` with a value of "payout_events_breakdown"</summary>
[EnumMember(Value = "payout_events_breakdown")]
PayoutEventsBreakdown,
/// <summary>`export_type` with a value of "payout_events_reconciliation"</summary>
[EnumMember(Value = "payout_events_reconciliation")]
PayoutEventsReconciliation,
/// <summary>`export_type` with a value of "payout_transactions_breakdown"</summary>
[EnumMember(Value = "payout_transactions_breakdown")]
PayoutTransactionsBreakdown,
/// <summary>`export_type` with a value of "payout_transactions_reconciliation"</summary>
[EnumMember(Value = "payout_transactions_reconciliation")]
PayoutTransactionsReconciliation,
/// <summary>`export_type` with a value of "authorisation_requests"</summary>
[EnumMember(Value = "authorisation_requests")]
AuthorisationRequests,
/// <summary>`export_type` with a value of "customer_bank_accounts"</summary>
[EnumMember(Value = "customer_bank_accounts")]
CustomerBankAccounts,
/// <summary>`export_type` with a value of "users"</summary>
[EnumMember(Value = "users")]
Users,
/// <summary>`export_type` with a value of "organisation_authorisations"</summary>
[EnumMember(Value = "organisation_authorisations")]
OrganisationAuthorisations,
/// <summary>`export_type` with a value of "gc_invalid_authorisation_requests"</summary>
[EnumMember(Value = "gc_invalid_authorisation_requests")]
GcInvalidAuthorisationRequests,
/// <summary>`export_type` with a value of "partner_fees"</summary>
[EnumMember(Value = "partner_fees")]
PartnerFees,
/// <summary>`export_type` with a value of "payments_import_template"</summary>
[EnumMember(Value = "payments_import_template")]
PaymentsImportTemplate,
}

}
4 changes: 1 addition & 3 deletions GoCardless/Resources/PayerAuthorisation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ public class PayerAuthorisation
public class PayerAuthorisationBankAccount
{
/// <summary>
/// Name of the account holder, as known by the bank. Usually this is
/// the same as the name stored with the linked
/// [creditor](#core-endpoints-creditors). This field will be
/// Name of the account holder, as known by the bank. This field will be
/// transliterated, upcased and truncated to 18 characters. This field
/// is required unless the request includes a [customer bank account
/// token](#javascript-flow-customer-bank-account-tokens).
Expand Down
25 changes: 16 additions & 9 deletions GoCardless/Services/BillingRequestService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,8 @@ public class BillingRequestPaymentRequest
/// <summary>
/// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes)
/// currency code. `GBP` and `EUR` supported; `GBP` with your
/// customers in the UK and for `EUR` with your customers in Germany
/// only.
/// customers in the UK and for `EUR` with your customers in
/// supported Eurozone countries only.
/// </summary>
[JsonProperty("currency")]
public string Currency { get; set; }
Expand Down Expand Up @@ -835,14 +835,23 @@ public enum BillingRequestFundsSettlement
[JsonProperty("metadata")]
public IDictionary<String, String> Metadata { get; set; }

/// <summary>
/// A custom payment reference defined by the merchant. It is only
/// available for payments using the Direct Funds settlement model
/// on the Faster Payments scheme.
///
/// </summary>
[JsonProperty("reference")]
public string Reference { get; set; }

/// <summary>
/// (Optional) A scheme used for Open Banking payments. Currently
/// `faster_payments` is supported in the UK (GBP) and
/// `sepa_credit_transfer` and `sepa_instant_credit_transfer` are
/// supported in Germany (EUR). In Germany, `sepa_credit_transfer`
/// is used as the default. Please be aware that
/// `sepa_instant_credit_transfer` may incur an additional fee for
/// your customer.
/// supported in supported Eurozone countries (EUR). For Eurozone
/// countries, `sepa_credit_transfer` is used as the default. Please
/// be aware that `sepa_instant_credit_transfer` may incur an
/// additional fee for your customer.
/// </summary>
[JsonProperty("scheme")]
public string Scheme { get; set; }
Expand Down Expand Up @@ -1123,9 +1132,7 @@ public class BillingRequestCollectBankAccountRequest
{

/// <summary>
/// Name of the account holder, as known by the bank. Usually this is
/// the same as the name stored with the linked
/// [creditor](#core-endpoints-creditors). This field will be
/// Name of the account holder, as known by the bank. This field will be
/// transliterated, upcased and truncated to 18 characters. This field
/// is required unless the request includes a [customer bank account
/// token](#javascript-flow-customer-bank-account-tokens).
Expand Down
22 changes: 12 additions & 10 deletions GoCardless/Services/BillingRequestTemplateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ public enum BillingRequestTemplateMandateRequestVerify
/// <summary>
/// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes)
/// currency code. `GBP` and `EUR` supported; `GBP` with your customers
/// in the UK and for `EUR` with your customers in Germany only.
/// in the UK and for `EUR` with your customers in supported Eurozone
/// countries only.
/// </summary>
[JsonProperty("payment_request_currency")]
public string PaymentRequestCurrency { get; set; }
Expand All @@ -381,10 +382,10 @@ public enum BillingRequestTemplateMandateRequestVerify
/// (Optional) A scheme used for Open Banking payments. Currently
/// `faster_payments` is supported in the UK (GBP) and
/// `sepa_credit_transfer` and `sepa_instant_credit_transfer` are
/// supported in Germany (EUR). In Germany, `sepa_credit_transfer` is
/// used as the default. Please be aware that
/// `sepa_instant_credit_transfer` may incur an additional fee for your
/// customer.
/// supported in supported Eurozone countries (EUR). For Eurozone
/// countries, `sepa_credit_transfer` is used as the default. Please be
/// aware that `sepa_instant_credit_transfer` may incur an additional
/// fee for your customer.
/// </summary>
[JsonProperty("payment_request_scheme")]
public string PaymentRequestScheme { get; set; }
Expand Down Expand Up @@ -549,7 +550,8 @@ public enum BillingRequestTemplateMandateRequestVerify
/// <summary>
/// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes)
/// currency code. `GBP` and `EUR` supported; `GBP` with your customers
/// in the UK and for `EUR` with your customers in Germany only.
/// in the UK and for `EUR` with your customers in supported Eurozone
/// countries only.
/// </summary>
[JsonProperty("payment_request_currency")]
public string PaymentRequestCurrency { get; set; }
Expand All @@ -574,10 +576,10 @@ public enum BillingRequestTemplateMandateRequestVerify
/// (Optional) A scheme used for Open Banking payments. Currently
/// `faster_payments` is supported in the UK (GBP) and
/// `sepa_credit_transfer` and `sepa_instant_credit_transfer` are
/// supported in Germany (EUR). In Germany, `sepa_credit_transfer` is
/// used as the default. Please be aware that
/// `sepa_instant_credit_transfer` may incur an additional fee for your
/// customer.
/// supported in supported Eurozone countries (EUR). For Eurozone
/// countries, `sepa_credit_transfer` is used as the default. Please be
/// aware that `sepa_instant_credit_transfer` may incur an additional
/// fee for your customer.
/// </summary>
[JsonProperty("payment_request_scheme")]
public string PaymentRequestScheme { get; set; }
Expand Down
Loading

0 comments on commit 257b502

Please sign in to comment.