From 4f902a44ee8c2a45313ba117d5061b5ae2d8c981 Mon Sep 17 00:00:00 2001
From: Robot
Date: Tue, 28 Jan 2020 11:59:50 +0000
Subject: [PATCH 1/2] Changes generated by
9f2c72d6fb3ff0d72c24ee168a257d4313065f73
---
GoCardless/GoCardlessClient.Generated.cs | 5 +
GoCardless/Resources/Creditor.cs | 7 +
GoCardless/Resources/CreditorBankAccount.cs | 3 +-
GoCardless/Resources/Customer.cs | 9 +-
GoCardless/Resources/CustomerBankAccount.cs | 3 +-
GoCardless/Resources/CustomerNotification.cs | 6 +
GoCardless/Resources/Event.cs | 19 +
GoCardless/Resources/InstalmentSchedule.cs | 211 ++++++++
GoCardless/Resources/Mandate.cs | 4 +-
GoCardless/Resources/Payment.cs | 17 +-
GoCardless/Resources/Payout.cs | 21 +-
GoCardless/Resources/PayoutItem.cs | 9 +
GoCardless/Resources/Refund.cs | 64 ++-
GoCardless/Services/CreditorService.cs | 7 +
GoCardless/Services/CustomerService.cs | 61 ++-
GoCardless/Services/EventService.cs | 16 +-
.../Services/InstalmentScheduleService.cs | 504 ++++++++++++++++++
.../Services/MandateImportEntryService.cs | 9 +-
GoCardless/Services/MandatePdfService.cs | 9 +-
GoCardless/Services/PaymentService.cs | 4 +-
GoCardless/Services/PayoutService.cs | 12 +-
GoCardless/Services/RefundService.cs | 4 +-
22 files changed, 958 insertions(+), 46 deletions(-)
create mode 100644 GoCardless/Resources/InstalmentSchedule.cs
create mode 100644 GoCardless/Services/InstalmentScheduleService.cs
diff --git a/GoCardless/GoCardlessClient.Generated.cs b/GoCardless/GoCardlessClient.Generated.cs
index 2d49821..69dbaac 100644
--- a/GoCardless/GoCardlessClient.Generated.cs
+++ b/GoCardless/GoCardlessClient.Generated.cs
@@ -43,6 +43,11 @@ public partial class GoCardlessClient
///
public EventService Events => new EventService(this);
+ ///
+ ///A service for working with instalment schedule resources.
+ ///
+ public InstalmentScheduleService InstalmentSchedules => new InstalmentScheduleService(this);
+
///
///A service for working with mandate resources.
///
diff --git a/GoCardless/Resources/Creditor.cs b/GoCardless/Resources/Creditor.cs
index c9b56d7..c8e3682 100644
--- a/GoCardless/Resources/Creditor.cs
+++ b/GoCardless/Resources/Creditor.cs
@@ -238,6 +238,13 @@ public class CreditorLinks
///
[JsonProperty("default_sek_payout_account")]
public string DefaultSekPayoutAccount { get; set; }
+
+ ///
+ /// ID of the [bank account](#core-endpoints-creditor-bank-accounts)
+ /// which is set up to receive payouts in USD.
+ ///
+ [JsonProperty("default_usd_payout_account")]
+ public string DefaultUsdPayoutAccount { get; set; }
}
///
diff --git a/GoCardless/Resources/CreditorBankAccount.cs b/GoCardless/Resources/CreditorBankAccount.cs
index ff037fd..3ece3b1 100644
--- a/GoCardless/Resources/CreditorBankAccount.cs
+++ b/GoCardless/Resources/CreditorBankAccount.cs
@@ -36,7 +36,8 @@ public class CreditorBankAccount
public string AccountHolderName { get; set; }
///
- /// Last two digits of account number.
+ /// The last few digits of the account number. Currently 4 digits for
+ /// NZD bank accounts and 2 digits for other currencies.
///
[JsonProperty("account_number_ending")]
public string AccountNumberEnding { get; set; }
diff --git a/GoCardless/Resources/Customer.cs b/GoCardless/Resources/Customer.cs
index cc8b030..a2295a0 100644
--- a/GoCardless/Resources/Customer.cs
+++ b/GoCardless/Resources/Customer.cs
@@ -120,9 +120,7 @@ public class Customer
///
/// [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone
- /// number, including country code. Required for New Zealand customers
- /// only. Must be supplied if the customer's bank account is denominated
- /// in New Zealand Dollars (NZD).
+ /// number, including country code.
///
[JsonProperty("phone_number")]
public string PhoneNumber { get; set; }
@@ -134,7 +132,10 @@ public class Customer
public string PostalCode { get; set; }
///
- /// The customer's address region, county or department.
+ /// The customer's address region, county or department. For US
+ /// customers a 2 letter state code ([ISO
+ /// 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) e.g CA) is
+ /// required.
///
[JsonProperty("region")]
public string Region { get; set; }
diff --git a/GoCardless/Resources/CustomerBankAccount.cs b/GoCardless/Resources/CustomerBankAccount.cs
index 14607a8..2323fe8 100644
--- a/GoCardless/Resources/CustomerBankAccount.cs
+++ b/GoCardless/Resources/CustomerBankAccount.cs
@@ -33,7 +33,8 @@ public class CustomerBankAccount
public string AccountHolderName { get; set; }
///
- /// Last two digits of account number.
+ /// The last few digits of the account number. Currently 4 digits for
+ /// NZD bank accounts and 2 digits for other currencies.
///
[JsonProperty("account_number_ending")]
public string AccountNumberEnding { get; set; }
diff --git a/GoCardless/Resources/CustomerNotification.cs b/GoCardless/Resources/CustomerNotification.cs
index 3198489..9c17b42 100644
--- a/GoCardless/Resources/CustomerNotification.cs
+++ b/GoCardless/Resources/CustomerNotification.cs
@@ -141,6 +141,12 @@ public enum CustomerNotificationType {
/// `type` with a value of "subscription_created"
[EnumMember(Value = "subscription_created")]
SubscriptionCreated,
+ /// `type` with a value of "instalment_schedule_created"
+ [EnumMember(Value = "instalment_schedule_created")]
+ InstalmentScheduleCreated,
+ /// `type` with a value of "instalment_schedule_cancelled"
+ [EnumMember(Value = "instalment_schedule_cancelled")]
+ InstalmentScheduleCancelled,
}
}
diff --git a/GoCardless/Resources/Event.cs b/GoCardless/Resources/Event.cs
index 4531c1d..a320835 100644
--- a/GoCardless/Resources/Event.cs
+++ b/GoCardless/Resources/Event.cs
@@ -74,6 +74,7 @@ public class Event
/// `payouts`
/// `refunds`
/// `subscriptions`
+ /// `instalment_schedules`
///
///
[JsonProperty("resource_type")]
@@ -130,6 +131,12 @@ public enum EventCustomerNotificationType {
/// `type` with a value of "subscription_created"
[EnumMember(Value = "subscription_created")]
SubscriptionCreated,
+ /// `type` with a value of "instalment_schedule_created"
+ [EnumMember(Value = "instalment_schedule_created")]
+ InstalmentScheduleCreated,
+ /// `type` with a value of "instalment_schedule_cancelled"
+ [EnumMember(Value = "instalment_schedule_cancelled")]
+ InstalmentScheduleCancelled,
}
public class EventDetails
@@ -246,6 +253,14 @@ public enum EventDetailsScheme {
///
public class EventLinks
{
+ ///
+ /// If `resource_type` is `instalment_schedule`, this is the ID of the
+ /// [instalment schedule](#core-endpoints-instalment-schedules) which
+ /// has been updated.
+ ///
+ [JsonProperty("instalment_schedule")]
+ public string InstalmentSchedule { get; set; }
+
///
/// If `resource_type` is `mandates`, this is the ID of the
/// [mandate](#core-endpoints-mandates) which has been updated.
@@ -335,6 +350,7 @@ public class EventLinks
/// `payouts`
/// `refunds`
/// `subscriptions`
+ /// `instalment_schedules`
///
///
[JsonConverter(typeof(StringEnumConverter))]
@@ -355,6 +371,9 @@ public enum EventResourceType {
/// `resource_type` with a value of "subscriptions"
[EnumMember(Value = "subscriptions")]
Subscriptions,
+ /// `resource_type` with a value of "instalment_schedules"
+ [EnumMember(Value = "instalment_schedules")]
+ InstalmentSchedules,
}
}
diff --git a/GoCardless/Resources/InstalmentSchedule.cs b/GoCardless/Resources/InstalmentSchedule.cs
new file mode 100644
index 0000000..8e1d3a8
--- /dev/null
+++ b/GoCardless/Resources/InstalmentSchedule.cs
@@ -0,0 +1,211 @@
+using System;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Converters;
+
+namespace GoCardless.Resources
+{
+
+ ///
+ /// Represents a instalment schedule resource.
+ ///
+ /// Instalment schedules are objects which represent a collection of related
+ /// payments, with the
+ /// intention to collect the `total_amount` specified. The API supports both
+ /// schedule-based
+ /// creation (similar to subscriptions) as well as explicit selection of
+ /// differing payment
+ /// amounts and charge dates.
+ ///
+ /// Unlike subscriptions, the payments are created immediately, so the
+ /// instalment schedule
+ /// cannot be modified once submitted and instead can only be cancelled
+ /// (which will cancel
+ /// any of the payments which have not yet been submitted).
+ ///
+ /// Customers will receive a single notification about the complete schedule
+ /// of collection.
+ ///
+ ///
+ public class InstalmentSchedule
+ {
+ ///
+ /// Fixed [timestamp](#api-usage-time-zones--dates), recording when this
+ /// resource was created.
+ ///
+ [JsonProperty("created_at")]
+ public DateTimeOffset? CreatedAt { get; set; }
+
+ ///
+ /// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes)
+ /// currency code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD",
+ /// "SEK" and "USD" are supported.
+ ///
+ [JsonProperty("currency")]
+ public InstalmentScheduleCurrency? Currency { get; set; }
+
+ ///
+ /// Unique identifier, beginning with "IS".
+ ///
+ [JsonProperty("id")]
+ public string Id { get; set; }
+
+ ///
+ /// Resources linked to this InstalmentSchedule.
+ ///
+ [JsonProperty("links")]
+ public InstalmentScheduleLinks Links { 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; }
+
+ ///
+ /// Name of the instalment schedule, up to 100 chars. This name will
+ /// also be
+ /// copied to the payments of the instalment schedule if you use
+ /// schedule-based creation.
+ ///
+ ///
+ [JsonProperty("name")]
+ public string Name { get; set; }
+
+ ///
+ /// If the status is `creation_failed`, this property will be populated
+ /// with validation
+ /// failures from the individual payments, arranged by the index of the
+ /// payment that
+ /// failed.
+ ///
+ ///
+ [JsonProperty("payment_errors")]
+ public IDictionary PaymentErrors { get; set; }
+
+ ///
+ /// One of:
+ ///
+ /// - `pending`: we're waiting for GC to create the payments
+ /// - `active`: the payments have been created, and the schedule is
+ /// active
+ /// - `creation_failed`: payment creation failed
+ /// - `completed`: we have passed the date of the final payment and
+ /// all payments have been collected
+ /// - `cancelled`: the schedule has been cancelled
+ /// - `errored`: one or more payments have failed
+ ///
+ ///
+ [JsonProperty("status")]
+ public InstalmentScheduleStatus? Status { get; set; }
+
+ ///
+ /// The total amount of the instalment schedule, defined as the sum of
+ /// all individual
+ /// payments. If the requested payment amounts do not sum up correctly,
+ /// a validation
+ /// error will be returned.
+ ///
+ ///
+ [JsonProperty("total_amount")]
+ public int? TotalAmount { get; set; }
+ }
+
+ ///
+ /// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently
+ /// "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported.
+ ///
+ [JsonConverter(typeof(StringEnumConverter))]
+ public enum InstalmentScheduleCurrency {
+
+ /// `currency` with a value of "AUD"
+ [EnumMember(Value = "AUD")]
+ AUD,
+ /// `currency` with a value of "CAD"
+ [EnumMember(Value = "CAD")]
+ CAD,
+ /// `currency` with a value of "DKK"
+ [EnumMember(Value = "DKK")]
+ DKK,
+ /// `currency` with a value of "EUR"
+ [EnumMember(Value = "EUR")]
+ EUR,
+ /// `currency` with a value of "GBP"
+ [EnumMember(Value = "GBP")]
+ GBP,
+ /// `currency` with a value of "NZD"
+ [EnumMember(Value = "NZD")]
+ NZD,
+ /// `currency` with a value of "SEK"
+ [EnumMember(Value = "SEK")]
+ SEK,
+ /// `currency` with a value of "USD"
+ [EnumMember(Value = "USD")]
+ USD,
+ }
+
+ ///
+ /// Represents a instalment schedule link resource.
+ ///
+ /// Links to associated objects
+ ///
+ public class InstalmentScheduleLinks
+ {
+ ///
+ /// ID of the associated [customer](#core-endpoints-customers).
+ ///
+ [JsonProperty("customer")]
+ public string Customer { get; set; }
+
+ ///
+ /// ID of the associated [mandate](#core-endpoints-mandates) which the
+ /// instalment schedule will create payments against.
+ ///
+ [JsonProperty("mandate")]
+ public string Mandate { get; set; }
+
+ ///
+ /// Array of IDs of the associated [payments](#core-endpoints-payments)
+ ///
+ [JsonProperty("payments")]
+ public List Payments { get; set; }
+ }
+
+ ///
+ /// One of:
+ ///
+ /// - `pending`: we're waiting for GC to create the payments
+ /// - `active`: the payments have been created, and the schedule is active
+ /// - `creation_failed`: payment creation failed
+ /// - `completed`: we have passed the date of the final payment and all payments have been
+ /// collected
+ /// - `cancelled`: the schedule has been cancelled
+ /// - `errored`: one or more payments have failed
+ ///
+ ///
+ [JsonConverter(typeof(StringEnumConverter))]
+ public enum InstalmentScheduleStatus {
+
+ /// `status` with a value of "pending"
+ [EnumMember(Value = "pending")]
+ Pending,
+ /// `status` with a value of "active"
+ [EnumMember(Value = "active")]
+ Active,
+ /// `status` with a value of "creation_failed"
+ [EnumMember(Value = "creation_failed")]
+ CreationFailed,
+ /// `status` with a value of "completed"
+ [EnumMember(Value = "completed")]
+ Completed,
+ /// `status` with a value of "cancelled"
+ [EnumMember(Value = "cancelled")]
+ Cancelled,
+ /// `status` with a value of "errored"
+ [EnumMember(Value = "errored")]
+ Errored,
+ }
+
+}
diff --git a/GoCardless/Resources/Mandate.cs b/GoCardless/Resources/Mandate.cs
index c11915a..2bf39be 100644
--- a/GoCardless/Resources/Mandate.cs
+++ b/GoCardless/Resources/Mandate.cs
@@ -46,8 +46,8 @@ public class Mandate
public IDictionary Metadata { get; set; }
///
- /// The earliest date a newly created payment for this mandate could be
- /// charged.
+ /// The earliest date that can be used as a `charge_date` on any newly
+ /// created payment for this mandate. This value will change over time.
///
[JsonProperty("next_possible_charge_date")]
public string NextPossibleChargeDate { get; set; }
diff --git a/GoCardless/Resources/Payment.cs b/GoCardless/Resources/Payment.cs
index 80c0de4..856ac8a 100644
--- a/GoCardless/Resources/Payment.cs
+++ b/GoCardless/Resources/Payment.cs
@@ -106,8 +106,8 @@ public class Payment
/// class='restricted-notice'>Restricted: You can only
/// specify a payment reference for Bacs payments (that is, when
/// collecting from the UK) if you're on the GoCardless Plus or Pro
- /// packages.
+ /// href='https://gocardless.com/pricing'>GoCardless Plus, Pro or
+ /// Enterprise packages.
///
[JsonProperty("reference")]
public string Reference { get; set; }
@@ -176,7 +176,7 @@ public class PaymentFx
/// `amount` into the `fx_currency`.
/// This will vary based on the prevailing market rate until the moment
/// that it is paid out.
- /// Present only before a resource is paid out. Has upto 10 decimal
+ /// Present only before a resource is paid out. Has up to 10 decimal
/// places.
///
[JsonProperty("estimated_exchange_rate")]
@@ -185,7 +185,7 @@ public class PaymentFx
///
/// Rate used in the foreign exchange of the `amount` into the
/// `fx_currency`.
- /// Present only after a resource is paid out. Has upto 10 decimal
+ /// Present only after a resource is paid out. Has up to 10 decimal
/// places.
///
[JsonProperty("exchange_rate")]
@@ -257,6 +257,15 @@ public class PaymentLinks
[JsonProperty("creditor")]
public string Creditor { get; set; }
+ ///
+ /// ID of [instalment_schedule](#core-endpoints-instalment-schedules)
+ /// from which this payment was created.
**Note**: this property
+ /// will only be present if this payment is part of an instalment
+ /// schedule.
+ ///
+ [JsonProperty("instalment_schedule")]
+ public string InstalmentSchedule { get; set; }
+
///
/// ID of the [mandate](#core-endpoints-mandates) against which this
/// payment should be collected.
diff --git a/GoCardless/Resources/Payout.cs b/GoCardless/Resources/Payout.cs
index 713ee54..6b9a4b8 100644
--- a/GoCardless/Resources/Payout.cs
+++ b/GoCardless/Resources/Payout.cs
@@ -12,8 +12,9 @@ namespace GoCardless.Resources
///
/// Payouts represent transfers from GoCardless to a
/// [creditor](#core-endpoints-creditors). Each payout contains the funds
- /// collected from one or many [payments](#core-endpoints-payments). Payouts
- /// are created automatically after a payment has been successfully
+ /// collected from one or many [payments](#core-endpoints-payments). All the
+ /// payments in a payout will have been collected in the same currency.
+ /// Payouts are created automatically after a payment has been successfully
/// collected.
///
public class Payout
@@ -59,8 +60,10 @@ public class Payout
///
/// For each `late_failure_settled` or `chargeback_settled` action, we
/// refund the transaction fees in a payout. This means that a payout
- /// can have a negative `deducted_fees`. This field is calculated as
- /// `GoCardless fees + app fees - refunded fees`
+ /// can have a negative `deducted_fees` value.
+ ///
+ /// This field is calculated as `(GoCardless fees + app fees + surcharge
+ /// fees) - (refunded fees)`
///
/// If the merchant is invoiced for fees separately from the payout,
/// then `deducted_fees` will be 0.
@@ -104,6 +107,8 @@ public class Payout
/// `pending`: the payout has been created, but not yet sent to the
/// banks
/// `paid`: the payout has been sent to the banks
+ /// `bounced`: the payout bounced when sent, the payout can be
+ /// retried.
///
///
[JsonProperty("status")]
@@ -150,7 +155,7 @@ public class PayoutFx
/// `amount` into the `fx_currency`.
/// This will vary based on the prevailing market rate until the moment
/// that it is paid out.
- /// Present only before a resource is paid out. Has upto 10 decimal
+ /// Present only before a resource is paid out. Has up to 10 decimal
/// places.
///
[JsonProperty("estimated_exchange_rate")]
@@ -159,7 +164,7 @@ public class PayoutFx
///
/// Rate used in the foreign exchange of the `amount` into the
/// `fx_currency`.
- /// Present only after a resource is paid out. Has upto 10 decimal
+ /// Present only after a resource is paid out. Has up to 10 decimal
/// places.
///
[JsonProperty("exchange_rate")]
@@ -258,6 +263,7 @@ public enum PayoutPayoutType {
///
/// - `pending`: the payout has been created, but not yet sent to the banks
/// - `paid`: the payout has been sent to the banks
+ /// - `bounced`: the payout bounced when sent, the payout can be retried.
///
///
[JsonConverter(typeof(StringEnumConverter))]
@@ -269,6 +275,9 @@ public enum PayoutStatus {
/// `status` with a value of "paid"
[EnumMember(Value = "paid")]
Paid,
+ /// `status` with a value of "bounced"
+ [EnumMember(Value = "bounced")]
+ Bounced,
}
}
diff --git a/GoCardless/Resources/PayoutItem.cs b/GoCardless/Resources/PayoutItem.cs
index 5556f87..2ffdd5f 100644
--- a/GoCardless/Resources/PayoutItem.cs
+++ b/GoCardless/Resources/PayoutItem.cs
@@ -83,6 +83,9 @@ public class PayoutItem
/// their users take payments. Only shown in partner payouts. In the
/// case of a payment failure or chargeback, these will appear as
/// credits.
+ /// `surcharge_fee` (credit/debit): GoCardless deducted a surcharge
+ /// fee as the payment failed or was charged back, or refunded a
+ /// surcharge fee as the bank or customer cancelled the chargeback.
///
///
///
@@ -127,6 +130,9 @@ public class PayoutItemLinks
/// `revenue_share` (credit/debit): A share of the fees that GoCardless collected which some
/// partner integrations receive when their users take payments. Only shown in partner payouts.
/// In the case of a payment failure or chargeback, these will appear as credits.
+ /// `surcharge_fee` (credit/debit): GoCardless deducted a surcharge fee as the payment
+ /// failed or was charged back, or refunded a surcharge fee as the bank or customer cancelled
+ /// the chargeback.
///
///
///
@@ -157,6 +163,9 @@ public enum PayoutItemType {
/// `type` with a value of "revenue_share"
[EnumMember(Value = "revenue_share")]
RevenueShare,
+ /// `type` with a value of "surcharge_fee"
+ [EnumMember(Value = "surcharge_fee")]
+ SurchargeFee,
}
}
diff --git a/GoCardless/Resources/Refund.cs b/GoCardless/Resources/Refund.cs
index 9bf4913..69041e3 100644
--- a/GoCardless/Resources/Refund.cs
+++ b/GoCardless/Resources/Refund.cs
@@ -79,11 +79,28 @@ public class Refund
/// class='restricted-notice'>Restricted: You can only
/// specify a payment reference for Bacs payments (that is, when
/// collecting from the UK) if you're on the GoCardless Plus or Pro
- /// packages.
+ /// href='https://gocardless.com/pricing'>GoCardless Plus, Pro or
+ /// Enterprise packages.
///
[JsonProperty("reference")]
public string Reference { get; set; }
+
+ ///
+ /// One of:
+ ///
+ /// - `created`: the refund has been created
+ /// - `pending_submission`: the refund has been created, but not yet
+ /// submitted to the banks
+ /// - `submitted`: the refund has been submitted to the banks
+ /// - `paid`: the refund has been included in a
+ /// [payout](#core-endpoints-payouts)
+ /// - `cancelled`: the refund has been cancelled
+ /// - `bounced`: the refund has failed to be paid
+ /// - `funds_returned`: the refund has had its funds returned
+ ///
+ ///
+ [JsonProperty("status")]
+ public RefundStatus? Status { get; set; }
}
public class RefundFx
@@ -93,7 +110,7 @@ public class RefundFx
/// `amount` into the `fx_currency`.
/// This will vary based on the prevailing market rate until the moment
/// that it is paid out.
- /// Present only before a resource is paid out. Has upto 10 decimal
+ /// Present only before a resource is paid out. Has up to 10 decimal
/// places.
///
[JsonProperty("estimated_exchange_rate")]
@@ -102,7 +119,7 @@ public class RefundFx
///
/// Rate used in the foreign exchange of the `amount` into the
/// `fx_currency`.
- /// Present only after a resource is paid out. Has upto 10 decimal
+ /// Present only after a resource is paid out. Has up to 10 decimal
/// places.
///
[JsonProperty("exchange_rate")]
@@ -182,4 +199,43 @@ public class RefundLinks
public string Payment { get; set; }
}
+ ///
+ /// One of:
+ ///
+ /// - `created`: the refund has been created
+ /// - `pending_submission`: the refund has been created, but not yet submitted to the
+ /// banks
+ /// - `submitted`: the refund has been submitted to the banks
+ /// - `paid`: the refund has been included in a [payout](#core-endpoints-payouts)
+ /// - `cancelled`: the refund has been cancelled
+ /// - `bounced`: the refund has failed to be paid
+ /// - `funds_returned`: the refund has had its funds returned
+ ///
+ ///
+ [JsonConverter(typeof(StringEnumConverter))]
+ public enum RefundStatus {
+
+ /// `status` with a value of "created"
+ [EnumMember(Value = "created")]
+ Created,
+ /// `status` with a value of "pending_submission"
+ [EnumMember(Value = "pending_submission")]
+ PendingSubmission,
+ /// `status` with a value of "submitted"
+ [EnumMember(Value = "submitted")]
+ Submitted,
+ /// `status` with a value of "paid"
+ [EnumMember(Value = "paid")]
+ Paid,
+ /// `status` with a value of "cancelled"
+ [EnumMember(Value = "cancelled")]
+ Cancelled,
+ /// `status` with a value of "bounced"
+ [EnumMember(Value = "bounced")]
+ Bounced,
+ /// `status` with a value of "funds_returned"
+ [EnumMember(Value = "funds_returned")]
+ FundsReturned,
+ }
+
}
diff --git a/GoCardless/Services/CreditorService.cs b/GoCardless/Services/CreditorService.cs
index 16c6852..29b9eb3 100644
--- a/GoCardless/Services/CreditorService.cs
+++ b/GoCardless/Services/CreditorService.cs
@@ -392,6 +392,13 @@ public class CreditorLinks
///
[JsonProperty("default_sek_payout_account")]
public string DefaultSekPayoutAccount { get; set; }
+
+ ///
+ /// ID of the [bank account](#core-endpoints-creditor-bank-accounts)
+ /// which is set up to receive payouts in USD.
+ ///
+ [JsonProperty("default_usd_payout_account")]
+ public string DefaultUsdPayoutAccount { get; set; }
}
///
diff --git a/GoCardless/Services/CustomerService.cs b/GoCardless/Services/CustomerService.cs
index f76ac2a..8a55337 100644
--- a/GoCardless/Services/CustomerService.cs
+++ b/GoCardless/Services/CustomerService.cs
@@ -273,9 +273,7 @@ public class CustomerCreateRequest : IHasIdempotencyKey
///
/// [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone
- /// number, including country code. Required for New Zealand customers
- /// only. Must be supplied if the customer's bank account is denominated
- /// in New Zealand Dollars (NZD).
+ /// number, including country code.
///
[JsonProperty("phone_number")]
public string PhoneNumber { get; set; }
@@ -287,7 +285,10 @@ public class CustomerCreateRequest : IHasIdempotencyKey
public string PostalCode { get; set; }
///
- /// The customer's address region, county or department.
+ /// The customer's address region, county or department. For US
+ /// customers a 2 letter state code ([ISO
+ /// 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) e.g CA) is
+ /// required.
///
[JsonProperty("region")]
public string Region { get; set; }
@@ -366,6 +367,49 @@ public class CreatedAtParam
public DateTimeOffset? LessThanOrEqual { get; set; }
}
+ ///
+ /// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes)
+ /// currency code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD",
+ /// "SEK" and "USD" are supported.
+ ///
+ [JsonProperty("currency")]
+ public CustomerCurrency? Currency { get; set; }
+
+ ///
+ /// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes)
+ /// currency code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD",
+ /// "SEK" and "USD" are supported.
+ ///
+ [JsonConverter(typeof(StringEnumConverter))]
+ public enum CustomerCurrency
+ {
+
+ /// `currency` with a value of "AUD"
+ [EnumMember(Value = "AUD")]
+ AUD,
+ /// `currency` with a value of "CAD"
+ [EnumMember(Value = "CAD")]
+ CAD,
+ /// `currency` with a value of "DKK"
+ [EnumMember(Value = "DKK")]
+ DKK,
+ /// `currency` with a value of "EUR"
+ [EnumMember(Value = "EUR")]
+ EUR,
+ /// `currency` with a value of "GBP"
+ [EnumMember(Value = "GBP")]
+ GBP,
+ /// `currency` with a value of "NZD"
+ [EnumMember(Value = "NZD")]
+ NZD,
+ /// `currency` with a value of "SEK"
+ [EnumMember(Value = "SEK")]
+ SEK,
+ /// `currency` with a value of "USD"
+ [EnumMember(Value = "USD")]
+ USD,
+ }
+
///
/// Number of records to return.
///
@@ -479,9 +523,7 @@ public class CustomerUpdateRequest
///
/// [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone
- /// number, including country code. Required for New Zealand customers
- /// only. Must be supplied if the customer's bank account is denominated
- /// in New Zealand Dollars (NZD).
+ /// number, including country code.
///
[JsonProperty("phone_number")]
public string PhoneNumber { get; set; }
@@ -493,7 +535,10 @@ public class CustomerUpdateRequest
public string PostalCode { get; set; }
///
- /// The customer's address region, county or department.
+ /// The customer's address region, county or department. For US
+ /// customers a 2 letter state code ([ISO
+ /// 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) e.g CA) is
+ /// required.
///
[JsonProperty("region")]
public string Region { get; set; }
diff --git a/GoCardless/Services/EventService.cs b/GoCardless/Services/EventService.cs
index 4ae69da..682be3d 100644
--- a/GoCardless/Services/EventService.cs
+++ b/GoCardless/Services/EventService.cs
@@ -181,6 +181,7 @@ public class CreatedAtParam
/// `payout`
/// `refund`
/// `subscription`
+ /// `instalment_schedule`
///
///
[JsonProperty("include")]
@@ -195,6 +196,7 @@ public class CreatedAtParam
/// `payout`
/// `refund`
/// `subscription`
+ /// `instalment_schedule`
///
///
[JsonConverter(typeof(StringEnumConverter))]
@@ -216,6 +218,9 @@ public enum EventInclude
/// `include` with a value of "subscription"
[EnumMember(Value = "subscription")]
Subscription,
+ /// `include` with a value of "instalment_schedule"
+ [EnumMember(Value = "instalment_schedule")]
+ InstalmentSchedule,
}
///
@@ -262,12 +267,14 @@ public enum EventInclude
///
/// Type of resource that you'd like to get all events for. Cannot be
/// used together with the `payment`, `mandate`, `subscription`,
- /// `refund` or `payout` parameter. The type can be one of:
+ /// `instalment_schedule`, `refund` or `payout` parameter. The type can
+ /// be one of:
///
/// - `payments`
/// - `mandates`
/// - `payouts`
/// - `subscriptions`
+ /// - `instalment_schedules`
/// - `refunds`
///
///
@@ -277,12 +284,14 @@ public enum EventInclude
///
/// Type of resource that you'd like to get all events for. Cannot be
/// used together with the `payment`, `mandate`, `subscription`,
- /// `refund` or `payout` parameter. The type can be one of:
+ /// `instalment_schedule`, `refund` or `payout` parameter. The type can
+ /// be one of:
///
/// - `payments`
/// - `mandates`
/// - `payouts`
/// - `subscriptions`
+ /// - `instalment_schedules`
/// - `refunds`
///
///
@@ -305,6 +314,9 @@ public enum EventResourceType
/// `resource_type` with a value of "subscriptions"
[EnumMember(Value = "subscriptions")]
Subscriptions,
+ /// `resource_type` with a value of "instalment_schedules"
+ [EnumMember(Value = "instalment_schedules")]
+ InstalmentSchedules,
}
///
diff --git a/GoCardless/Services/InstalmentScheduleService.cs b/GoCardless/Services/InstalmentScheduleService.cs
new file mode 100644
index 0000000..0e78371
--- /dev/null
+++ b/GoCardless/Services/InstalmentScheduleService.cs
@@ -0,0 +1,504 @@
+
+
+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 instalment schedule resources.
+ ///
+ /// Instalment schedules are objects which represent a collection of related
+ /// payments, with the
+ /// intention to collect the `total_amount` specified. The API supports both
+ /// schedule-based
+ /// creation (similar to subscriptions) as well as explicit selection of
+ /// differing payment
+ /// amounts and charge dates.
+ ///
+ /// Unlike subscriptions, the payments are created immediately, so the
+ /// instalment schedule
+ /// cannot be modified once submitted and instead can only be cancelled
+ /// (which will cancel
+ /// any of the payments which have not yet been submitted).
+ ///
+ /// Customers will receive a single notification about the complete schedule
+ /// of collection.
+ ///
+ ///
+
+ public class InstalmentScheduleService
+ {
+ 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 InstalmentScheduleService(GoCardlessClient goCardlessClient)
+ {
+ _goCardlessClient = goCardlessClient;
+ }
+
+ ///
+ /// Creates a new instalment schedule object, along with the associated
+ /// payments.
+ ///
+ /// The `instalments` property can either be an array of payment
+ /// properties (`amount`
+ /// and `charge_date`) or a schedule object with `interval`,
+ /// `interval_unit` and
+ /// `amounts`.
+ ///
+ /// It can take quite a while to create the associated payments, so the
+ /// API will return
+ /// the status as `pending` initially. When processing has completed, a
+ /// subsequent
+ /// GET request for the instalment schedule will either have the status
+ /// `success` and link to
+ /// the created payments, or the status `error` and detailed information
+ /// about the
+ /// failures.
+ ///
+ /// An optional `InstalmentScheduleCreateRequest` representing the body for this create request.
+ /// An optional `RequestSettings` allowing you to configure the request
+ /// A single instalment schedule resource
+ public Task CreateAsync(InstalmentScheduleCreateRequest request = null, RequestSettings customiseRequestMessage = null)
+ {
+ request = request ?? new InstalmentScheduleCreateRequest();
+
+ var urlParams = new List>
+ {};
+
+ return _goCardlessClient.ExecuteAsync("POST", "/instalment_schedules", urlParams, request, id => GetAsync(id, null, customiseRequestMessage), "instalment_schedules", customiseRequestMessage);
+ }
+
+ ///
+ /// Returns a [cursor-paginated](#api-usage-cursor-pagination) list of
+ /// your instalment schedules.
+ ///
+ /// An optional `InstalmentScheduleListRequest` representing the query parameters for this list request.
+ /// An optional `RequestSettings` allowing you to configure the request
+ /// A set of instalment schedule resources
+ public Task ListAsync(InstalmentScheduleListRequest request = null, RequestSettings customiseRequestMessage = null)
+ {
+ request = request ?? new InstalmentScheduleListRequest();
+
+ var urlParams = new List>
+ {};
+
+ return _goCardlessClient.ExecuteAsync("GET", "/instalment_schedules", urlParams, request, null, null, customiseRequestMessage);
+ }
+
+ ///
+ /// Get a lazily enumerated list of instalment schedules.
+ /// This acts like the #list method, but paginates for you automatically.
+ ///
+ public IEnumerable All(InstalmentScheduleListRequest request = null, RequestSettings customiseRequestMessage = null)
+ {
+ request = request ?? new InstalmentScheduleListRequest();
+
+ string cursor = null;
+ do
+ {
+ request.After = cursor;
+
+ var result = Task.Run(() => ListAsync(request, customiseRequestMessage)).Result;
+ foreach (var item in result.InstalmentSchedules)
+ {
+ yield return item;
+ }
+ cursor = result.Meta?.Cursors?.After;
+ } while (cursor != null);
+ }
+
+ ///
+ /// Get a lazily enumerated list of instalment schedules.
+ /// This acts like the #list method, but paginates for you automatically.
+ ///
+ public IEnumerable>> AllAsync(InstalmentScheduleListRequest request = null, RequestSettings customiseRequestMessage = null)
+ {
+ request = request ?? new InstalmentScheduleListRequest();
+
+ return new TaskEnumerable, string>(async after =>
+ {
+ request.After = after;
+ var list = await this.ListAsync(request, customiseRequestMessage);
+ return Tuple.Create(list.InstalmentSchedules, list.Meta?.Cursors?.After);
+ });
+ }
+
+ ///
+ /// Retrieves the details of an existing instalment schedule.
+ ///
+ /// Unique identifier, beginning with "IS".
+ /// An optional `InstalmentScheduleGetRequest` representing the query parameters for this get request.
+ /// An optional `RequestSettings` allowing you to configure the request
+ /// A single instalment schedule resource
+ public Task GetAsync(string identity, InstalmentScheduleGetRequest request = null, RequestSettings customiseRequestMessage = null)
+ {
+ request = request ?? new InstalmentScheduleGetRequest();
+ if (identity == null) throw new ArgumentException(nameof(identity));
+
+ var urlParams = new List>
+ {
+ new KeyValuePair("identity", identity),
+ };
+
+ return _goCardlessClient.ExecuteAsync("GET", "/instalment_schedules/:identity", urlParams, request, null, null, customiseRequestMessage);
+ }
+
+ ///
+ /// Immediately cancels an instalment schedule; no further payments will
+ /// be collected for it.
+ ///
+ /// This will fail with a `cancellation_failed` error if the instalment
+ /// schedule is already cancelled or has completed.
+ ///
+ /// Unique identifier, beginning with "IS".
+ /// An optional `InstalmentScheduleCancelRequest` representing the body for this cancel request.
+ /// An optional `RequestSettings` allowing you to configure the request
+ /// A single instalment schedule resource
+ public Task CancelAsync(string identity, InstalmentScheduleCancelRequest request = null, RequestSettings customiseRequestMessage = null)
+ {
+ request = request ?? new InstalmentScheduleCancelRequest();
+ if (identity == null) throw new ArgumentException(nameof(identity));
+
+ var urlParams = new List>
+ {
+ new KeyValuePair("identity", identity),
+ };
+
+ return _goCardlessClient.ExecuteAsync("POST", "/instalment_schedules/:identity/actions/cancel", urlParams, request, null, "data", customiseRequestMessage);
+ }
+ }
+
+
+ ///
+ /// Creates a new instalment schedule object, along with the associated
+ /// payments.
+ ///
+ /// The `instalments` property can either be an array of payment properties
+ /// (`amount`
+ /// and `charge_date`) or a schedule object with `interval`, `interval_unit`
+ /// and
+ /// `amounts`.
+ ///
+ /// It can take quite a while to create the associated payments, so the API
+ /// will return
+ /// the status as `pending` initially. When processing has completed, a
+ /// subsequent
+ /// GET request for the instalment schedule will either have the status
+ /// `success` and link to
+ /// the created payments, or the status `error` and detailed information
+ /// about the
+ /// failures.
+ ///
+ public class InstalmentScheduleCreateRequest : IHasIdempotencyKey
+ {
+
+ ///
+ /// The amount to be deducted from each payment as an app fee, to be
+ /// paid to the partner integration which created the subscription, in
+ /// the lowest denomination for the currency (e.g. pence in GBP, cents
+ /// in EUR).
+ ///
+ [JsonProperty("app_fee")]
+ public int? AppFee { get; set; }
+
+ ///
+ /// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes)
+ /// currency code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD",
+ /// "SEK" and "USD" are supported.
+ ///
+ [JsonProperty("currency")]
+ public InstalmentScheduleCurrency? Currency { get; set; }
+
+ ///
+ /// [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes)
+ /// currency code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD",
+ /// "SEK" and "USD" are supported.
+ ///
+ [JsonConverter(typeof(StringEnumConverter))]
+ public enum InstalmentScheduleCurrency
+ {
+
+ /// `currency` with a value of "AUD"
+ [EnumMember(Value = "AUD")]
+ AUD,
+ /// `currency` with a value of "CAD"
+ [EnumMember(Value = "CAD")]
+ CAD,
+ /// `currency` with a value of "DKK"
+ [EnumMember(Value = "DKK")]
+ DKK,
+ /// `currency` with a value of "EUR"
+ [EnumMember(Value = "EUR")]
+ EUR,
+ /// `currency` with a value of "GBP"
+ [EnumMember(Value = "GBP")]
+ GBP,
+ /// `currency` with a value of "NZD"
+ [EnumMember(Value = "NZD")]
+ NZD,
+ /// `currency` with a value of "SEK"
+ [EnumMember(Value = "SEK")]
+ SEK,
+ /// `currency` with a value of "USD"
+ [EnumMember(Value = "USD")]
+ USD,
+ }
+
+ [JsonProperty("instalments")]
+ public IDictionary Instalments { get; set; }
+
+ ///
+ /// Linked resources.
+ ///
+ [JsonProperty("links")]
+ public InstalmentScheduleLinks Links { get; set; }
+ ///
+ /// Linked resources for a InstalmentSchedule.
+ ///
+ public class InstalmentScheduleLinks
+ {
+
+ ///
+ /// ID of the associated [mandate](#core-endpoints-mandates) which
+ /// the instalment schedule will create payments against.
+ ///
+ [JsonProperty("mandate")]
+ public string Mandate { 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; }
+
+ ///
+ /// Name of the instalment schedule, up to 100 chars. This name will
+ /// also be
+ /// copied to the payments of the instalment schedule if you use
+ /// schedule-based creation.
+ ///
+ ///
+ [JsonProperty("name")]
+ public string Name { get; set; }
+
+ ///
+ /// An optional reference that will appear on your customer's bank
+ /// statement. The character limit for this reference is dependent on
+ /// the scheme.
ACH - 10 characters
+ /// Autogiro - 11 characters
+ /// Bacs - 10 characters
BECS -
+ /// 30 characters
BECS NZ - 12 characters
+ /// Betalingsservice - 30 characters
+ /// PAD - 12 characters
SEPA -
+ /// 140 characters Restricted: You can only
+ /// specify a payment reference for Bacs payments (that is, when
+ /// collecting from the UK) if you're on the GoCardless Plus, Pro or
+ /// Enterprise packages.
+ ///
+ [JsonProperty("payment_reference")]
+ public string PaymentReference { get; set; }
+
+ ///
+ /// The total amount of the instalment schedule, defined as the sum of
+ /// all individual
+ /// payments. If the requested payment amounts do not sum up correctly,
+ /// a validation
+ /// error will be returned.
+ ///
+ ///
+ [JsonProperty("total_amount")]
+ public int? TotalAmount { get; set; }
+
+ ///
+ /// A unique key to ensure that this request only succeeds once, allowing you to safely retry request errors such as network failures.
+ /// Any requests, where supported, to create a resource with a key that has previously been used will not succeed.
+ /// See: https://developer.gocardless.com/api-reference/#making-requests-idempotency-keys
+ ///
+ [JsonIgnore]
+ public string IdempotencyKey { get; set; }
+ }
+
+
+ ///
+ /// Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
+ /// instalment schedules.
+ ///
+ public class InstalmentScheduleListRequest
+ {
+
+ ///
+ /// 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; }
+
+ ///
+ /// Limit to records created within certain times.
+ ///
+ [JsonProperty("created_at")]
+ public CreatedAtParam CreatedAt { get; set; }
+
+ ///
+ /// Specify filters to limit records by creation time.
+ ///
+ public class CreatedAtParam
+ {
+ ///
+ /// Limit to records created after the specified date-time.
+ ///
+ [JsonProperty("gt")]
+ public DateTimeOffset? GreaterThan { get; set; }
+
+ ///
+ /// Limit to records created on or after the specified date-time.
+ ///
+ [JsonProperty("gte")]
+ public DateTimeOffset? GreaterThanOrEqual { get; set; }
+
+ ///
+ /// Limit to records created before the specified date-time.
+ ///
+ [JsonProperty("lt")]
+ public DateTimeOffset? LessThan { get; set; }
+
+ ///
+ ///Limit to records created on or before the specified date-time.
+ ///
+ [JsonProperty("lte")]
+ public DateTimeOffset? LessThanOrEqual { get; set; }
+ }
+
+ ///
+ /// ID of the associated [customer](#core-endpoints-customers).
+ ///
+ [JsonProperty("customer")]
+ public string Customer { get; set; }
+
+ ///
+ /// Number of records to return.
+ ///
+ [JsonProperty("limit")]
+ public int? Limit { get; set; }
+
+ ///
+ /// ID of the associated [mandate](#core-endpoints-mandates) which the
+ /// instalment schedule will create payments against.
+ ///
+ [JsonProperty("mandate")]
+ public string Mandate { get; set; }
+
+ ///
+ /// At most five valid status values
+ ///
+ [JsonProperty("status")]
+ public InstalmentScheduleStatus[] Status { get; set; }
+ ///
+ /// One of:
+ ///
+ /// - `pending`: we're waiting for GC to create the payments
+ /// - `active`: the payments have been created, and the schedule is
+ /// active
+ /// - `creation_failed`: payment creation failed
+ /// - `completed`: we have passed the date of the final payment and
+ /// all payments have been collected
+ /// - `cancelled`: the schedule has been cancelled
+ /// - `errored`: one or more payments have failed
+ ///
+ ///
+ [JsonConverter(typeof(StringEnumConverter))]
+ public enum InstalmentScheduleStatus
+ {
+
+ /// `status` with a value of "pending"
+ [EnumMember(Value = "pending")]
+ Pending,
+ /// `status` with a value of "active"
+ [EnumMember(Value = "active")]
+ Active,
+ /// `status` with a value of "creation_failed"
+ [EnumMember(Value = "creation_failed")]
+ CreationFailed,
+ /// `status` with a value of "completed"
+ [EnumMember(Value = "completed")]
+ Completed,
+ /// `status` with a value of "cancelled"
+ [EnumMember(Value = "cancelled")]
+ Cancelled,
+ /// `status` with a value of "errored"
+ [EnumMember(Value = "errored")]
+ Errored,
+ }
+ }
+
+
+ ///
+ /// Retrieves the details of an existing instalment schedule.
+ ///
+ public class InstalmentScheduleGetRequest
+ {
+ }
+
+
+ ///
+ /// Immediately cancels an instalment schedule; no further payments will be
+ /// collected for it.
+ ///
+ /// This will fail with a `cancellation_failed` error if the instalment
+ /// schedule is already cancelled or has completed.
+ ///
+ public class InstalmentScheduleCancelRequest
+ {
+ }
+
+ ///
+ /// An API response for a request returning a single instalment schedule.
+ ///
+ public class InstalmentScheduleResponse : ApiResponse
+ {
+ ///
+ /// The instalment schedule from the response.
+ ///
+ [JsonProperty("instalment_schedules")]
+ public InstalmentSchedule InstalmentSchedule { get; private set; }
+ }
+
+ ///
+ /// An API response for a request returning a list of instalment schedules.
+ ///
+ public class InstalmentScheduleListResponse : ApiResponse
+ {
+ ///
+ /// The list of instalment schedules from the response.
+ ///
+ [JsonProperty("instalment_schedules")]
+ public IReadOnlyList InstalmentSchedules { 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 f3ed332..f9a9f05 100644
--- a/GoCardless/Services/MandateImportEntryService.cs
+++ b/GoCardless/Services/MandateImportEntryService.cs
@@ -350,9 +350,7 @@ public class MandateImportEntryCustomer
///
/// [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone
- /// number, including country code. Required for New Zealand
- /// customers only. Must be supplied if the customer's bank account
- /// is denominated in New Zealand Dollars (NZD).
+ /// number, including country code.
///
[JsonProperty("phone_number")]
public string PhoneNumber { get; set; }
@@ -366,7 +364,10 @@ public class MandateImportEntryCustomer
public string PostalCode { get; set; }
///
- /// The customer's address region, county or department.
+ /// The customer's address region, county or department. For US
+ /// customers a 2 letter state code ([ISO
+ /// 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) e.g CA)
+ /// is required.
///
[JsonProperty("region")]
public string Region { get; set; }
diff --git a/GoCardless/Services/MandatePdfService.cs b/GoCardless/Services/MandatePdfService.cs
index 243016a..fe512cb 100644
--- a/GoCardless/Services/MandatePdfService.cs
+++ b/GoCardless/Services/MandatePdfService.cs
@@ -292,9 +292,7 @@ public class MandatePdfLinks
///
/// [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone
- /// number, including country code. Required for New Zealand customers
- /// only. Must be supplied if the customer's bank account is denominated
- /// in New Zealand Dollars (NZD).
+ /// number, including country code.
///
[JsonProperty("phone_number")]
public string PhoneNumber { get; set; }
@@ -306,7 +304,10 @@ public class MandatePdfLinks
public string PostalCode { get; set; }
///
- /// The customer's address region, county or department.
+ /// The customer's address region, county or department. For US
+ /// customers a 2 letter state code ([ISO
+ /// 3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) e.g CA) is
+ /// required.
///
[JsonProperty("region")]
public string Region { get; set; }
diff --git a/GoCardless/Services/PaymentService.cs b/GoCardless/Services/PaymentService.cs
index 4f86d3a..bb40cf5 100644
--- a/GoCardless/Services/PaymentService.cs
+++ b/GoCardless/Services/PaymentService.cs
@@ -341,8 +341,8 @@ public class PaymentLinks
/// class='restricted-notice'>Restricted: You can only
/// specify a payment reference for Bacs payments (that is, when
/// collecting from the UK) if you're on the GoCardless Plus or Pro
- /// packages.
+ /// href='https://gocardless.com/pricing'>GoCardless Plus, Pro or
+ /// Enterprise packages.
///
[JsonProperty("reference")]
public string Reference { get; set; }
diff --git a/GoCardless/Services/PayoutService.cs b/GoCardless/Services/PayoutService.cs
index a723fc5..31f20df 100644
--- a/GoCardless/Services/PayoutService.cs
+++ b/GoCardless/Services/PayoutService.cs
@@ -18,8 +18,9 @@ namespace GoCardless.Services
///
/// Payouts represent transfers from GoCardless to a
/// [creditor](#core-endpoints-creditors). Each payout contains the funds
- /// collected from one or many [payments](#core-endpoints-payments). Payouts
- /// are created automatically after a payment has been successfully
+ /// collected from one or many [payments](#core-endpoints-payments). All the
+ /// payments in a payout will have been collected in the same currency.
+ /// Payouts are created automatically after a payment has been successfully
/// collected.
///
@@ -264,6 +265,8 @@ public enum PayoutPayoutType
/// `pending`: the payout has been created, but not yet sent to the
/// banks
/// `paid`: the payout has been sent to the banks
+ /// `bounced`: the payout bounced when sent, the payout can be
+ /// retried.
///
///
[JsonProperty("status")]
@@ -275,6 +278,8 @@ public enum PayoutPayoutType
/// `pending`: the payout has been created, but not yet sent to the
/// banks
/// `paid`: the payout has been sent to the banks
+ /// `bounced`: the payout bounced when sent, the payout can be
+ /// retried.
///
///
[JsonConverter(typeof(StringEnumConverter))]
@@ -287,6 +292,9 @@ public enum PayoutStatus
/// `status` with a value of "paid"
[EnumMember(Value = "paid")]
Paid,
+ /// `status` with a value of "bounced"
+ [EnumMember(Value = "bounced")]
+ Bounced,
}
}
diff --git a/GoCardless/Services/RefundService.cs b/GoCardless/Services/RefundService.cs
index cfc4080..39d19d6 100644
--- a/GoCardless/Services/RefundService.cs
+++ b/GoCardless/Services/RefundService.cs
@@ -234,8 +234,8 @@ public class RefundLinks
/// class='restricted-notice'>Restricted: You can only
/// specify a payment reference for Bacs payments (that is, when
/// collecting from the UK) if you're on the GoCardless Plus or Pro
- /// packages.
+ /// href='https://gocardless.com/pricing'>GoCardless Plus, Pro or
+ /// Enterprise packages.
///
[JsonProperty("reference")]
public string Reference { get; set; }
From 402bbb73302a6f3cd0f568b738018392fb6156b3 Mon Sep 17 00:00:00 2001
From: Robot
Date: Tue, 28 Jan 2020 12:01:31 +0000
Subject: [PATCH 2/2] Changes generated by
89d1c330d5f6b8b45d2fc599f0581668074f24c0
---
GoCardless/GoCardless.csproj | 4 ++--
GoCardless/GoCardlessClient.cs | 4 ++--
README.md | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/GoCardless/GoCardless.csproj b/GoCardless/GoCardless.csproj
index 8d43f38..bdb9096 100644
--- a/GoCardless/GoCardless.csproj
+++ b/GoCardless/GoCardless.csproj
@@ -2,7 +2,7 @@
GoCardless
- 3.0.1
+ 3.1.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/v3.0.1
+ https://github.com/gocardless/gocardless-dotnet/releases/tag/v3.1.0
netstandard1.6;netstandard2.0;net46
True
true
diff --git a/GoCardless/GoCardlessClient.cs b/GoCardless/GoCardlessClient.cs
index 76ebdb4..6cb3b98 100644
--- a/GoCardless/GoCardlessClient.cs
+++ b/GoCardless/GoCardlessClient.cs
@@ -233,9 +233,9 @@ private HttpRequestMessage BuildHttpRequestMessage(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/3.0.1");
+ requestMessage.Headers.Add("User-Agent", "gocardless-dotnet/3.1.0");
requestMessage.Headers.Add("GoCardless-Version", "2015-07-06");
- requestMessage.Headers.Add("GoCardless-Client-Version", "3.0.1");
+ requestMessage.Headers.Add("GoCardless-Client-Version", "3.1.0");
requestMessage.Headers.Add("GoCardless-Client-Library", "gocardless-dotnet");
requestMessage.Headers.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", _accessToken);
diff --git a/README.md b/README.md
index 5e88e9a..f3156d8 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 3.0.1`
+`Install-Package GoCardless -Version 3.1.0`
## Usage