diff --git a/GoCardless/GoCardless.csproj b/GoCardless/GoCardless.csproj index 9dc793c..cac3bb1 100644 --- a/GoCardless/GoCardless.csproj +++ b/GoCardless/GoCardless.csproj @@ -2,7 +2,7 @@ GoCardless - 6.5.0 + 6.6.0 GoCardless Ltd Client for the GoCardless API - a powerful, simple solution for the collection of recurring bank-to-bank payments false @@ -11,7 +11,7 @@ GoCardless Ltd gocardless payments rest api direct debit https://github.com/gocardless/gocardless-dotnet/blob/master/LICENSE.txt - https://github.com/gocardless/gocardless-dotnet/releases/tag/v6.5.0 + https://github.com/gocardless/gocardless-dotnet/releases/tag/v6.6.0 netstandard1.6;netstandard2.0;netstandard2.1;net46;net8.0 True true diff --git a/GoCardless/GoCardlessClient.Generated.cs b/GoCardless/GoCardlessClient.Generated.cs index f40abfe..72619e4 100644 --- a/GoCardless/GoCardlessClient.Generated.cs +++ b/GoCardless/GoCardlessClient.Generated.cs @@ -73,6 +73,11 @@ public partial class GoCardlessClient /// public EventService Events => new EventService(this); + /// + ///A service for working with export resources. + /// + public ExportService Exports => new ExportService(this); + /// ///A service for working with instalment schedule resources. /// diff --git a/GoCardless/GoCardlessClient.cs b/GoCardless/GoCardlessClient.cs index 8561fe1..5884a2b 100644 --- a/GoCardless/GoCardlessClient.cs +++ b/GoCardless/GoCardlessClient.cs @@ -277,11 +277,11 @@ private HttpRequestMessage BuildHttpRequestMessage(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); diff --git a/GoCardless/Resources/BillingRequest.cs b/GoCardless/Resources/BillingRequest.cs index b4916f6..af95abd 100644 --- a/GoCardless/Resources/BillingRequest.cs +++ b/GoCardless/Resources/BillingRequest.cs @@ -831,7 +831,8 @@ public class BillingRequestPaymentRequest /// /// [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. /// [JsonProperty("currency")] public string Currency { get; set; } @@ -871,14 +872,23 @@ public class BillingRequestPaymentRequest [JsonProperty("metadata")] public IDictionary Metadata { get; set; } + /// + /// 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. + /// + /// + [JsonProperty("reference")] + public string Reference { get; set; } + /// /// (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. /// [JsonProperty("scheme")] public string Scheme { get; set; } @@ -1075,9 +1085,7 @@ public class BillingRequestResourcesCustomer public class BillingRequestResourcesCustomerBankAccount { /// - /// 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). diff --git a/GoCardless/Resources/BillingRequestTemplate.cs b/GoCardless/Resources/BillingRequestTemplate.cs index dc745af..db509c1 100644 --- a/GoCardless/Resources/BillingRequestTemplate.cs +++ b/GoCardless/Resources/BillingRequestTemplate.cs @@ -139,7 +139,8 @@ public class BillingRequestTemplate /// /// [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. /// [JsonProperty("payment_request_currency")] public string PaymentRequestCurrency { get; set; } @@ -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. /// [JsonProperty("payment_request_scheme")] public string PaymentRequestScheme { get; set; } diff --git a/GoCardless/Resources/CustomerBankAccount.cs b/GoCardless/Resources/CustomerBankAccount.cs index bd4b8e2..a071659 100644 --- a/GoCardless/Resources/CustomerBankAccount.cs +++ b/GoCardless/Resources/CustomerBankAccount.cs @@ -32,9 +32,7 @@ namespace GoCardless.Resources public class CustomerBankAccount { /// - /// 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). diff --git a/GoCardless/Resources/Event.cs b/GoCardless/Resources/Event.cs index bef1058..1706f7c 100644 --- a/GoCardless/Resources/Event.cs +++ b/GoCardless/Resources/Event.cs @@ -90,6 +90,7 @@ public class Event ///
    ///
  • `billing_requests`
  • ///
  • `creditors`
  • + ///
  • `exports`
  • ///
  • `instalment_schedules`
  • ///
  • `mandates`
  • ///
  • `payer_authorisations`
  • @@ -476,6 +477,7 @@ public class EventLinks ///
      ///
    • `billing_requests`
    • ///
    • `creditors`
    • + ///
    • `exports`
    • ///
    • `instalment_schedules`
    • ///
    • `mandates`
    • ///
    • `payer_authorisations`
    • @@ -498,6 +500,9 @@ public enum EventResourceType { /// `resource_type` with a value of "creditors" [EnumMember(Value = "creditors")] Creditors, + /// `resource_type` with a value of "exports" + [EnumMember(Value = "exports")] + Exports, /// `resource_type` with a value of "instalment_schedules" [EnumMember(Value = "instalment_schedules")] InstalmentSchedules, diff --git a/GoCardless/Resources/Export.cs b/GoCardless/Resources/Export.cs new file mode 100644 index 0000000..9988020 --- /dev/null +++ b/GoCardless/Resources/Export.cs @@ -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 +{ + + /// + /// Represents a export resource. + /// + /// File-based exports of data + /// + public class Export + { + /// + /// Fixed [timestamp](#api-usage-time-zones--dates), recording when this + /// resource was created. + /// + [JsonProperty("created_at")] + public DateTimeOffset? CreatedAt { get; set; } + + /// + /// The currency of the export (if applicable) + /// + [JsonProperty("currency")] + public string Currency { get; set; } + + /// + /// Download url for the export file. Subject to expiry. + /// + [JsonProperty("download_url")] + public string DownloadUrl { get; set; } + + /// + /// The type of the export + /// + [JsonProperty("export_type")] + public ExportExportType? ExportType { get; set; } + + /// + /// Unique identifier, beginning with "EX". + /// + [JsonProperty("id")] + public string Id { get; set; } + } + + /// + /// The type of the export + /// + [JsonConverter(typeof(GcStringEnumConverter), (int)Unknown)] + public enum ExportExportType { + /// Unknown status + [EnumMember(Value = "unknown")] + Unknown = 0, + + /// `export_type` with a value of "payments_index" + [EnumMember(Value = "payments_index")] + PaymentsIndex, + /// `export_type` with a value of "events_index" + [EnumMember(Value = "events_index")] + EventsIndex, + /// `export_type` with a value of "refunds_index" + [EnumMember(Value = "refunds_index")] + RefundsIndex, + /// `export_type` with a value of "payouts_index" + [EnumMember(Value = "payouts_index")] + PayoutsIndex, + /// `export_type` with a value of "customers_index" + [EnumMember(Value = "customers_index")] + CustomersIndex, + /// `export_type` with a value of "subscriptions_index" + [EnumMember(Value = "subscriptions_index")] + SubscriptionsIndex, + /// `export_type` with a value of "payment_events" + [EnumMember(Value = "payment_events")] + PaymentEvents, + /// `export_type` with a value of "subscription_events" + [EnumMember(Value = "subscription_events")] + SubscriptionEvents, + /// `export_type` with a value of "payout_events" + [EnumMember(Value = "payout_events")] + PayoutEvents, + /// `export_type` with a value of "refund_events" + [EnumMember(Value = "refund_events")] + RefundEvents, + /// `export_type` with a value of "mandate_events" + [EnumMember(Value = "mandate_events")] + MandateEvents, + /// `export_type` with a value of "payout_events_breakdown" + [EnumMember(Value = "payout_events_breakdown")] + PayoutEventsBreakdown, + /// `export_type` with a value of "payout_events_reconciliation" + [EnumMember(Value = "payout_events_reconciliation")] + PayoutEventsReconciliation, + /// `export_type` with a value of "payout_transactions_breakdown" + [EnumMember(Value = "payout_transactions_breakdown")] + PayoutTransactionsBreakdown, + /// `export_type` with a value of "payout_transactions_reconciliation" + [EnumMember(Value = "payout_transactions_reconciliation")] + PayoutTransactionsReconciliation, + /// `export_type` with a value of "authorisation_requests" + [EnumMember(Value = "authorisation_requests")] + AuthorisationRequests, + /// `export_type` with a value of "customer_bank_accounts" + [EnumMember(Value = "customer_bank_accounts")] + CustomerBankAccounts, + /// `export_type` with a value of "users" + [EnumMember(Value = "users")] + Users, + /// `export_type` with a value of "organisation_authorisations" + [EnumMember(Value = "organisation_authorisations")] + OrganisationAuthorisations, + /// `export_type` with a value of "gc_invalid_authorisation_requests" + [EnumMember(Value = "gc_invalid_authorisation_requests")] + GcInvalidAuthorisationRequests, + /// `export_type` with a value of "partner_fees" + [EnumMember(Value = "partner_fees")] + PartnerFees, + /// `export_type` with a value of "payments_import_template" + [EnumMember(Value = "payments_import_template")] + PaymentsImportTemplate, + } + +} diff --git a/GoCardless/Resources/PayerAuthorisation.cs b/GoCardless/Resources/PayerAuthorisation.cs index a7cefd9..27eaba7 100644 --- a/GoCardless/Resources/PayerAuthorisation.cs +++ b/GoCardless/Resources/PayerAuthorisation.cs @@ -146,9 +146,7 @@ public class PayerAuthorisation public class PayerAuthorisationBankAccount { /// - /// 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). diff --git a/GoCardless/Services/BillingRequestService.cs b/GoCardless/Services/BillingRequestService.cs index 87e7958..fec7025 100644 --- a/GoCardless/Services/BillingRequestService.cs +++ b/GoCardless/Services/BillingRequestService.cs @@ -777,8 +777,8 @@ public class BillingRequestPaymentRequest /// /// [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. /// [JsonProperty("currency")] public string Currency { get; set; } @@ -835,14 +835,23 @@ public enum BillingRequestFundsSettlement [JsonProperty("metadata")] public IDictionary Metadata { get; set; } + /// + /// 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. + /// + /// + [JsonProperty("reference")] + public string Reference { get; set; } + /// /// (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. /// [JsonProperty("scheme")] public string Scheme { get; set; } @@ -1123,9 +1132,7 @@ public class BillingRequestCollectBankAccountRequest { /// - /// 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). diff --git a/GoCardless/Services/BillingRequestTemplateService.cs b/GoCardless/Services/BillingRequestTemplateService.cs index 26d21f7..a5bafb3 100644 --- a/GoCardless/Services/BillingRequestTemplateService.cs +++ b/GoCardless/Services/BillingRequestTemplateService.cs @@ -356,7 +356,8 @@ public enum BillingRequestTemplateMandateRequestVerify /// /// [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. /// [JsonProperty("payment_request_currency")] public string PaymentRequestCurrency { get; set; } @@ -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. /// [JsonProperty("payment_request_scheme")] public string PaymentRequestScheme { get; set; } @@ -549,7 +550,8 @@ public enum BillingRequestTemplateMandateRequestVerify /// /// [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. /// [JsonProperty("payment_request_currency")] public string PaymentRequestCurrency { get; set; } @@ -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. /// [JsonProperty("payment_request_scheme")] public string PaymentRequestScheme { get; set; } diff --git a/GoCardless/Services/CustomerBankAccountService.cs b/GoCardless/Services/CustomerBankAccountService.cs index 910ff73..e89f37c 100644 --- a/GoCardless/Services/CustomerBankAccountService.cs +++ b/GoCardless/Services/CustomerBankAccountService.cs @@ -220,9 +220,7 @@ public class CustomerBankAccountCreateRequest : IHasIdempotencyKey { /// - /// 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). diff --git a/GoCardless/Services/EventService.cs b/GoCardless/Services/EventService.cs index 6776173..401338c 100644 --- a/GoCardless/Services/EventService.cs +++ b/GoCardless/Services/EventService.cs @@ -190,6 +190,13 @@ public class CreatedAtParam [JsonProperty("creditor")] public string Creditor { get; set; } + /// + /// ID of an export. If specified, this endpoint will return all events + /// for the given export. + /// + [JsonProperty("export")] + public string Export { get; set; } + /// /// Includes linked resources in the response. Must be used with the /// `resource_type` parameter specified. The include should be one of: @@ -319,13 +326,14 @@ public enum EventInclude /// /// Type of resource that you'd like to get all events for. /// Cannot be used together with the `billing_request`, `creditor`, - /// `instalment_schedule`, `mandate`, `payer_authorisation`, `payment`, - /// `payout`, `refund`, `scheme_identifier` or `subscription` + /// `export`,`instalment_schedule`, `mandate`, `payer_authorisation`, + /// `payment`, `payout`, `refund`, `scheme_identifier` or `subscription` /// parameters. /// The type can be one of: ///
        ///
      • `billing_requests`
      • ///
      • `creditors`
      • + ///
      • `exports`
      • ///
      • `instalment_schedules`
      • ///
      • `mandates`
      • ///
      • `payer_authorisations`
      • @@ -342,13 +350,14 @@ public enum EventInclude /// /// Type of resource that you'd like to get all events for. /// Cannot be used together with the `billing_request`, `creditor`, - /// `instalment_schedule`, `mandate`, `payer_authorisation`, `payment`, - /// `payout`, `refund`, `scheme_identifier` or `subscription` + /// `export`,`instalment_schedule`, `mandate`, `payer_authorisation`, + /// `payment`, `payout`, `refund`, `scheme_identifier` or `subscription` /// parameters. /// The type can be one of: ///
          ///
        • `billing_requests`
        • ///
        • `creditors`
        • + ///
        • `exports`
        • ///
        • `instalment_schedules`
        • ///
        • `mandates`
        • ///
        • `payer_authorisations`
        • @@ -369,6 +378,9 @@ public enum EventResourceType /// `resource_type` with a value of "creditors" [EnumMember(Value = "creditors")] Creditors, + /// `resource_type` with a value of "exports" + [EnumMember(Value = "exports")] + Exports, /// `resource_type` with a value of "instalment_schedules" [EnumMember(Value = "instalment_schedules")] InstalmentSchedules, diff --git a/GoCardless/Services/ExportService.cs b/GoCardless/Services/ExportService.cs new file mode 100644 index 0000000..4805b04 --- /dev/null +++ b/GoCardless/Services/ExportService.cs @@ -0,0 +1,171 @@ + + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Threading; +using System.Threading.Tasks; +using GoCardless.Internals; +using GoCardless.Resources; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace GoCardless.Services +{ + /// + /// Service class for working with export resources. + /// + /// File-based exports of data + /// + + public class ExportService + { + private readonly GoCardlessClient _goCardlessClient; + + /// + /// Constructor. Users of this library should not call this. An instance of this + /// class can be accessed through an initialised GoCardlessClient. + /// + public ExportService(GoCardlessClient goCardlessClient) + { + _goCardlessClient = goCardlessClient; + } + + /// + /// Returns a single export. + /// + /// Unique identifier, beginning with "EX". + /// An optional `ExportGetRequest` representing the query parameters for this get request. + /// An optional `RequestSettings` allowing you to configure the request + /// A single export resource + public Task GetAsync(string identity, ExportGetRequest request = null, RequestSettings customiseRequestMessage = null) + { + request = request ?? new ExportGetRequest(); + if (identity == null) throw new ArgumentException(nameof(identity)); + + var urlParams = new List> + { + new KeyValuePair("identity", identity), + }; + + return _goCardlessClient.ExecuteAsync("GET", "/exports/:identity", urlParams, request, null, null, customiseRequestMessage); + } + + /// + /// Returns a list of exports which are available for download. + /// + /// An optional `ExportListRequest` representing the query parameters for this list request. + /// An optional `RequestSettings` allowing you to configure the request + /// A set of export resources + public Task ListAsync(ExportListRequest request = null, RequestSettings customiseRequestMessage = null) + { + request = request ?? new ExportListRequest(); + + var urlParams = new List> + {}; + + return _goCardlessClient.ExecuteAsync("GET", "/exports", urlParams, request, null, null, customiseRequestMessage); + } + + /// + /// Get a lazily enumerated list of exports. + /// This acts like the #list method, but paginates for you automatically. + /// + public IEnumerable All(ExportListRequest request = null, RequestSettings customiseRequestMessage = null) + { + request = request ?? new ExportListRequest(); + + string cursor = null; + do + { + request.After = cursor; + + var result = Task.Run(() => ListAsync(request, customiseRequestMessage)).Result; + foreach (var item in result.Exports) + { + yield return item; + } + cursor = result.Meta?.Cursors?.After; + } while (cursor != null); + } + + /// + /// Get a lazily enumerated list of exports. + /// This acts like the #list method, but paginates for you automatically. + /// + public IEnumerable>> AllAsync(ExportListRequest request = null, RequestSettings customiseRequestMessage = null) + { + request = request ?? new ExportListRequest(); + + return new TaskEnumerable, string>(async after => + { + request.After = after; + var list = await this.ListAsync(request, customiseRequestMessage); + return Tuple.Create(list.Exports, list.Meta?.Cursors?.After); + }); + } + } + + + /// + /// Returns a single export. + /// + public class ExportGetRequest + { + } + + + /// + /// Returns a list of exports which are available for download. + /// + public class ExportListRequest + { + + /// + /// Cursor pointing to the start of the desired set. + /// + [JsonProperty("after")] + public string After { get; set; } + + /// + /// Cursor pointing to the end of the desired set. + /// + [JsonProperty("before")] + public string Before { get; set; } + + /// + /// Number of records to return. + /// + [JsonProperty("limit")] + public int? Limit { get; set; } + } + + /// + /// An API response for a request returning a single export. + /// + public class ExportResponse : ApiResponse + { + /// + /// The export from the response. + /// + [JsonProperty("exports")] + public Export Export { get; private set; } + } + + /// + /// An API response for a request returning a list of exports. + /// + public class ExportListResponse : ApiResponse + { + /// + /// The list of exports from the response. + /// + [JsonProperty("exports")] + public IReadOnlyList Exports { get; private set; } + /// + /// Response metadata (e.g. pagination cursors) + /// + public Meta Meta { get; private set; } + } +} diff --git a/GoCardless/Services/MandateImportEntryService.cs b/GoCardless/Services/MandateImportEntryService.cs index cb99b42..c2c4c00 100644 --- a/GoCardless/Services/MandateImportEntryService.cs +++ b/GoCardless/Services/MandateImportEntryService.cs @@ -202,12 +202,11 @@ public class MandateImportEntryBankAccount { /// - /// 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 - /// 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). + /// 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). /// [JsonProperty("account_holder_name")] public string AccountHolderName { get; set; } @@ -220,6 +219,31 @@ public class MandateImportEntryBankAccount [JsonProperty("account_number")] public string AccountNumber { get; set; } + /// + /// Bank account type. Required for USD-denominated bank accounts. + /// Must not be provided for bank accounts in other currencies. See + /// [local details](#local-bank-details-united-states) for more + /// information. + /// + [JsonProperty("account_type")] + public MandateImportEntryAccountType? AccountType { get; set; } + /// + /// Bank account type. Required for USD-denominated bank accounts. Must + /// not be provided for bank accounts in other currencies. See [local + /// details](#local-bank-details-united-states) for more information. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum MandateImportEntryAccountType + { + + /// `account_type` with a value of "savings" + [EnumMember(Value = "savings")] + Savings, + /// `account_type` with a value of "checking" + [EnumMember(Value = "checking")] + Checking, + } + /// /// Bank code - see [local details](#appendix-local-bank-details) /// for more information. Alternatively you can provide an `iban`. @@ -251,6 +275,13 @@ public class MandateImportEntryBankAccount /// [JsonProperty("iban")] public string Iban { get; set; } + + /// + /// Key-value store of custom data. Up to 3 keys are permitted, with + /// key names up to 50 characters and values up to 500 characters. + /// + [JsonProperty("metadata")] + public IDictionary Metadata { get; set; } } [JsonProperty("customer")] @@ -348,6 +379,13 @@ public class MandateImportEntryCustomer [JsonProperty("language")] public string Language { get; set; } + /// + /// Key-value store of custom data. Up to 3 keys are permitted, with + /// key names up to 50 characters and values up to 500 characters. + /// + [JsonProperty("metadata")] + public IDictionary Metadata { get; set; } + /// /// [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone /// number, including country code. @@ -409,6 +447,13 @@ public class MandateImportEntryLinks public class MandateImportEntryMandate { + /// + /// Key-value store of custom data. Up to 3 keys are permitted, with + /// key names up to 50 characters and values up to 500 characters. + /// + [JsonProperty("metadata")] + public IDictionary Metadata { get; set; } + /// /// Unique reference. Different schemes have different length and /// [character set](#appendix-character-sets) requirements. diff --git a/GoCardless/Services/PayerAuthorisationService.cs b/GoCardless/Services/PayerAuthorisationService.cs index c931790..2eb35a5 100644 --- a/GoCardless/Services/PayerAuthorisationService.cs +++ b/GoCardless/Services/PayerAuthorisationService.cs @@ -252,12 +252,11 @@ public class PayerAuthorisationBankAccount { /// - /// 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 - /// 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). + /// 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). /// [JsonProperty("account_holder_name")] public string AccountHolderName { get; set; } @@ -613,12 +612,11 @@ public class PayerAuthorisationBankAccount { /// - /// 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 - /// 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). + /// 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). /// [JsonProperty("account_holder_name")] public string AccountHolderName { get; set; } diff --git a/README.md b/README.md index 1ad975d..e2192e6 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ For full details of the GoCardless API, see the [API docs](https://developer.goc To install `GoCardless`, run the following command in the [Package Manager Console](https://docs.microsoft.com/en-us/nuget/tools/package-manager-console) -`Install-Package GoCardless -Version 6.5.0` +`Install-Package GoCardless -Version 6.6.0` ## Usage