diff --git a/README.md b/README.md index 0a59ac61..f062d2ac 100644 --- a/README.md +++ b/README.md @@ -14,14 +14,14 @@ With Maven: com.gocardless gocardless-pro - 8.5.0 + 8.6.0 ``` With Gradle: ``` -implementation 'com.gocardless:gocardless-pro:8.5.0' +implementation 'com.gocardless:gocardless-pro:8.6.0' ``` ## Initializing the client diff --git a/build.gradle b/build.gradle index 0719c7f5..3796c934 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ buildscript { } dependencies { - classpath 'ch.raffael.pegdown-doclet:pegdown-doclet:1.2.1' + classpath 'ch.raffael.pegdown-doclet:pegdown-doclet:1.3' // Only add Spotless if running on Java 11+ // TODO: Remove this when we drop support for Java 8 if (JavaVersion.current() >= JavaVersion.VERSION_11) { @@ -29,7 +29,7 @@ plugins { sourceCompatibility = 1.8 targetCompatibility = 1.8 group = 'com.gocardless' -version = '8.5.0' +version = '8.6.0' apply plugin: 'ch.raffael.pegdown-doclet' @@ -51,19 +51,19 @@ repositories { } dependencies { - implementation("com.squareup.okhttp3:okhttp:4.9.1") - implementation 'com.google.code.gson:gson:2.8.7' - implementation("com.google.guava:guava:30.1.1-jre") - implementation 'org.slf4j:slf4j-api:1.7.32' - implementation 'commons-codec:commons-codec:1.15' + implementation("com.squareup.okhttp3:okhttp:5.4.0") + implementation 'com.google.code.gson:gson:2.14.0' + implementation("com.google.guava:guava:33.6.0-jre") + implementation 'org.slf4j:slf4j-api:2.0.18' + implementation 'commons-codec:commons-codec:1.22.0' implementation('com.github.rholder:guava-retrying:2.0.0') { exclude group: 'com.google.guava', module: 'guava' } testImplementation 'junit:junit:4.13.2' - testImplementation 'org.assertj:assertj-core:3.19.0' - testImplementation 'com.squareup.okhttp3:mockwebserver:4.9.1' + testImplementation 'org.assertj:assertj-core:3.27.7' + testImplementation 'com.squareup.okhttp3:mockwebserver:5.4.0' } javadoc { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0922d266..797be2e9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.5-bin.zip diff --git a/src/main/java/com/gocardless/http/HttpClient.java b/src/main/java/com/gocardless/http/HttpClient.java index 9c51e2c7..a820a56d 100644 --- a/src/main/java/com/gocardless/http/HttpClient.java +++ b/src/main/java/com/gocardless/http/HttpClient.java @@ -35,7 +35,7 @@ public class HttpClient { private static final String DISALLOWED_USER_AGENT_CHARACTERS = "[^\\w!#$%&'\\*\\+\\-\\.\\^`\\|~]"; private static final String USER_AGENT = - String.format("gocardless-pro-java/8.5.0 java/%s %s/%s %s/%s", + String.format("gocardless-pro-java/8.6.0 java/%s %s/%s %s/%s", cleanUserAgentToken(System.getProperty("java.vm.specification.version")), cleanUserAgentToken(System.getProperty("java.vm.name")), cleanUserAgentToken(System.getProperty("java.version")), @@ -49,7 +49,7 @@ public class HttpClient { builder.put("GoCardless-Version", "2015-07-06"); builder.put("Accept", "application/json"); builder.put("GoCardless-Client-Library", "gocardless-pro-java"); - builder.put("GoCardless-Client-Version", "8.5.0"); + builder.put("GoCardless-Client-Version", "8.6.0"); HEADERS = builder.build(); } private final OkHttpClient rawClient; diff --git a/src/main/java/com/gocardless/resources/Balance.java b/src/main/java/com/gocardless/resources/Balance.java index 782f46e4..23410189 100644 --- a/src/main/java/com/gocardless/resources/Balance.java +++ b/src/main/java/com/gocardless/resources/Balance.java @@ -32,16 +32,18 @@ public Integer getAmount() { /** * Type of the balance. Could be one of + * * */ public BalanceType getBalanceType() { @@ -49,16 +51,17 @@ public BalanceType getBalanceType() { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public Currency getCurrency() { return currency; } /** - * Dynamic [timestamp](#api-usage-dates-and-times) recording when this resource was last - * updated. + * Dynamic timestamp + * recording when this resource was last updated. */ public String getLastUpdatedAt() { return lastUpdatedAt; @@ -102,7 +105,8 @@ private Links() { private String creditor; /** - * ID of the associated [creditor](#core-endpoints-creditors). + * ID of the associated creditor. */ public String getCreditor() { return creditor; diff --git a/src/main/java/com/gocardless/resources/BankAccountDetail.java b/src/main/java/com/gocardless/resources/BankAccountDetail.java index c4ecd16c..c5e76b68 100644 --- a/src/main/java/com/gocardless/resources/BankAccountDetail.java +++ b/src/main/java/com/gocardless/resources/BankAccountDetail.java @@ -44,9 +44,13 @@ public String getIv() { /** * Base64 URL encoded JWE header values, containing the following keys: * - * - `alg`: the asymmetric encryption type used to encrypt symmetric key, e.g: `RSA-OAEP`. - - * `enc`: the content encryption type, e.g: `A256GCM`. - `kid`: the ID of an RSA-2048 public - * key, from your JWKS, used to encrypt the AES key. + * */ public String getProtectedValue() { return protectedValue; diff --git a/src/main/java/com/gocardless/resources/BankAccountHolderVerification.java b/src/main/java/com/gocardless/resources/BankAccountHolderVerification.java index 45f996f1..b91a627d 100644 --- a/src/main/java/com/gocardless/resources/BankAccountHolderVerification.java +++ b/src/main/java/com/gocardless/resources/BankAccountHolderVerification.java @@ -35,15 +35,16 @@ public String getId() { /** * Result of the verification, could be one of + * * */ public Result getResult() { @@ -52,19 +53,21 @@ public Result getResult() { /** * The status of the bank account holder verification. + * * - * */ public Status getStatus() { return status; } /** - * Type of the verification that has been performed eg. [Confirmation of - * Payee](https://www.wearepay.uk/what-we-do/overlay-services/confirmation-of-payee/) + * Type of the verification that has been performed eg. Confirmation of + * Payee */ public Type getType() { return type; diff --git a/src/main/java/com/gocardless/resources/BankAuthorisation.java b/src/main/java/com/gocardless/resources/BankAuthorisation.java index 3a0a2c86..3e43e128 100644 --- a/src/main/java/com/gocardless/resources/BankAuthorisation.java +++ b/src/main/java/com/gocardless/resources/BankAuthorisation.java @@ -35,7 +35,9 @@ public AuthorisationType getAuthorisationType() { } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when the user has been authorised. + * Fixed timestamp, + * recording when the user has been authorised. */ public String getAuthorisedAt() { return authorisedAt; @@ -64,8 +66,9 @@ public String getId() { } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when the authorisation URL has been - * visited. + * Fixed timestamp, + * recording when the authorisation URL has been visited. */ public String getLastVisitedAt() { return lastVisitedAt; @@ -77,8 +80,8 @@ public Links getLinks() { /** * URL to a QR code PNG image of the bank authorisation url. This QR code can be used as an - * alternative to providing the `url` to the payer to allow them to authorise with their mobile - * devices. + * alternative to providing the url to the payer to allow them to authorise with + * their mobile devices. */ public String getQrCodeUrl() { return qrCodeUrl; @@ -87,24 +90,27 @@ public String getQrCodeUrl() { /** * URL that the payer can be redirected to after authorising the payment. * - * On completion of bank authorisation, the query parameter of either `outcome=success` or - * `outcome=failure` will be appended to the `redirect_uri` to indicate the result of the bank - * authorisation. If the bank authorisation is expired, the query parameter `outcome=timeout` - * will be appended to the `redirect_uri`, in which case you should prompt the user to try the - * bank authorisation step again. + * On completion of bank authorisation, the query parameter of either + * outcome=success or outcome=failure will be appended to the + * redirect_uri to indicate the result of the bank authorisation. If the bank + * authorisation is expired, the query parameter outcome=timeout will be appended + * to the redirect_uri, in which case you should prompt the user to try the bank + * authorisation step again. * - * Please note: bank authorisations can still fail despite an `outcome=success` on the - * `redirect_uri`. It is therefore recommended to wait for the relevant bank authorisation - * event, such as - * [`BANK_AUTHORISATION_AUTHORISED`](#billing-request-bankauthorisationauthorised), - * [`BANK_AUTHORISATION_DENIED`](#billing-request-bankauthorisationdenied), or - * [`BANK_AUTHORISATION_FAILED`](#billing-request-bankauthorisationfailed) in order to show the - * correct outcome to the user. + * Please note: bank authorisations can still fail despite an outcome=success on + * the redirect_uri. It is therefore recommended to wait for the relevant bank + * authorisation event, such as BANK_AUTHORISATION_AUTHORISED, + * BANK_AUTHORISATION_DENIED, + * or BANK_AUTHORISATION_FAILED + * in order to show the correct outcome to the user. * - * The BillingRequestFlow ID will also be appended to the `redirect_uri` as query parameter - * `id=BRF123`. + * The BillingRequestFlow ID will also be appended to the redirect_uri as query + * parameter id=BRF123. * - * Defaults to `https://pay.gocardless.com/billing/static/thankyou`. + * Defaults to https://pay.gocardless.com/billing/static/thankyou. */ public String getRedirectUri() { return redirectUri; @@ -138,16 +144,18 @@ private Links() { private String institution; /** - * ID of the [billing request](#billing-requests-billing-requests) against which this - * authorisation was created. + * ID of the billing + * request against which this authorisation was created. */ public String getBillingRequest() { return billingRequest; } /** - * ID of the [institution](#billing-requests-institutions) against which this authorisation - * was created. + * ID of the institution + * against which this authorisation was created. */ public String getInstitution() { return institution; diff --git a/src/main/java/com/gocardless/resources/BankDetailsLookup.java b/src/main/java/com/gocardless/resources/BankDetailsLookup.java index f90ae46e..b58763cd 100644 --- a/src/main/java/com/gocardless/resources/BankDetailsLookup.java +++ b/src/main/java/com/gocardless/resources/BankDetailsLookup.java @@ -18,8 +18,10 @@ private BankDetailsLookup() { private String bic; /** - * Array of [schemes](#mandates_scheme) supported for this bank account. This will be an empty - * array if the bank account is not reachable by any schemes. + * Array of + * schemes + * supported for this bank account. This will be an empty array if the bank account is not + * reachable by any schemes. */ public List getAvailableDebitSchemes() { return availableDebitSchemes; @@ -37,7 +39,7 @@ public String getBankName() { * *

* Even if no BIC is returned for an account, GoCardless may still be able to collect payments - * from it - you should refer to the `available_debit_schemes` attribute to determine + * from it - you should refer to the available_debit_schemes attribute to determine * reachability. *

*/ diff --git a/src/main/java/com/gocardless/resources/BillingRequest.java b/src/main/java/com/gocardless/resources/BillingRequest.java index ab8bd6a6..51a076ad 100644 --- a/src/main/java/com/gocardless/resources/BillingRequest.java +++ b/src/main/java/com/gocardless/resources/BillingRequest.java @@ -11,12 +11,11 @@ * of required input might be additional customer billing details, while an action would be asking a * customer to authorise a payment using their mobile banking app. * - * See [Billing Requests: - * Overview](https://developer.gocardless.com/getting-started/billing-requests/overview/) for - * how-to's, explanations and tutorials. + * See Billing + * Requests: Overview for how-to's, explanations and tutorials. *

- * Important: All properties associated with `subscription_request` and - * `instalment_schedule_request` are only supported for ACH and PAD schemes. + * Important: All properties associated with subscription_request and + * instalment_schedule_request are only supported for ACH and PAD schemes. *

*/ public class BillingRequest { @@ -49,7 +48,9 @@ public List getActions() { } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; @@ -59,9 +60,9 @@ public String getCreatedAt() { * (Optional) If true, this billing request can fallback from instant payment to direct debit. * Should not be set if GoCardless payment intelligence feature is used. * - * See [Billing Requests: Retain customers with - * Fallbacks](https://developer.gocardless.com/billing-requests/retain-customers-with-fallbacks/) - * for more information. + * See Billing + * Requests: Retain customers with Fallbacks for more information. */ public Boolean getFallbackEnabled() { return fallbackEnabled; @@ -82,8 +83,9 @@ public String getId() { } /** - * Request for an instalment schedule. Has to contain either `instalments_with_schedule` object - * or an array of `instalments_with_dates` objects + * Request for an instalment schedule. Has to contain either + * instalments_with_schedule object or an array of + * instalments_with_dates objects */ public InstalmentScheduleRequest getInstalmentScheduleRequest() { return instalmentScheduleRequest; @@ -121,9 +123,8 @@ public PaymentContextCode getPaymentContextCode() { /** * Specifies the underlying purpose of the payment. Defines the specific reason or type of * service/goods the payment relates to, improving straight-through processing and compliance. - * See [VRP Commercial Payment Purpose - * Codes](https://developer.gocardless.com/vrp-commercial-payment-purpose-codes/) for the - * complete list of valid codes. + * See VRP + * Commercial Payment Purpose Codes for the complete list of valid codes. */ public String getPaymentPurposeCode() { return paymentPurposeCode; @@ -139,9 +140,9 @@ public PaymentRequest getPaymentRequest() { /** * Specifies the high-level purpose/category of a mandate and/or payment using a set of * pre-defined categories. Provides context on the nature and reason for the payment to - * facilitate processing and compliance. See [Billing Request Purpose - * Codes](https://developer.gocardless.com/billing-request-purpose-codes/) for the complete list - * of valid codes. + * facilitate processing and compliance. See + * Billing Request + * Purpose Codes for the complete list of valid codes. */ public PurposeCode getPurposeCode() { return purposeCode; @@ -153,12 +154,13 @@ public Resources getResources() { /** * One of: + * * */ public Status getStatus() { @@ -303,12 +305,18 @@ public List getCompletesActions() { /** * Describes whether we inferred the institution from the provided bank account details. One - * of: - `not_needed`: we won't attempt to infer the institution as it is not needed. Either - * because it was manually selected or the billing request does not support this feature - - * `pending`: we are waiting on the bank details in order to infer the institution - - * `failed`: we weren't able to infer the institution - `success`: we inferred the - * institution and added it to the resources of a Billing Request + * of: * + *
    + *
  • not_needed: we won't attempt to infer the institution as it is not + * needed. Either because it was manually selected or the billing request does not support + * this feature
  • + *
  • pending: we are waiting on the bank details in order to infer the + * institution
  • + *
  • failed: we weren't able to infer the institution
  • + *
  • success: we inferred the institution and added it to the resources of a + * Billing Request
  • + *
*/ public InstitutionGuessStatus getInstitutionGuessStatus() { return institutionGuessStatus; @@ -466,8 +474,9 @@ public List getCustomerBillingDetail() { /** * Represents a instalment schedule request resource returned from the API. * - * Request for an instalment schedule. Has to contain either `instalments_with_schedule` object - * or an array of `instalments_with_dates` objects + * Request for an instalment schedule. Has to contain either + * instalments_with_schedule object or an array of + * instalments_with_dates objects */ public static class InstalmentScheduleRequest { private InstalmentScheduleRequest() { @@ -495,16 +504,18 @@ public Integer getAppFee() { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "USD" and "CAD" are supported. + * ISO 4217 currency code. + * Currently "USD" and "CAD" are supported. */ public String getCurrency() { return currency; } /** - * An explicit array of instalment payments, each specifying at least an `amount` and - * `charge_date`. See [create (with dates)](#instalment-schedules-create-with-dates) + * An explicit array of instalment payments, each specifying at least an amount + * and charge_date. See create + * (with dates) */ public List getInstalmentsWithDates() { return instalmentsWithDates; @@ -512,9 +523,9 @@ public List getInstalmentsWithDates() { /** * Frequency of the payments you want to create, together with an array of payment amounts - * to be collected, with a specified start date for the first payment. See [create (with - * schedule)](#instalment-schedules-create-with-schedule) - * + * to be collected, with a specified start date for the first payment. See create + * (with schedule) */ public InstalmentsWithSchedule getInstalmentsWithSchedule() { return instalmentsWithSchedule; @@ -542,19 +553,22 @@ public String getName() { /** * An optional payment reference. This will be set as the reference on each payment created - * and will appear on your customer's bank statement. See the documentation for the [create - * payment endpoint](#payments-create-a-payment) for more details.
+ * and will appear on your customer's bank statement. See the documentation for the create + * payment endpoint for more details.
+ *
*/ public String getPaymentReference() { return paymentReference; } /** - * On failure, automatically retry payments using [intelligent - * retries](/success-plus/overview). Default is `false`. + * On failure, automatically retry payments using + * intelligent retries. + * Default is false. *

* Important: To be able to use intelligent retries, Success+ needs to be - * enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus). + * enabled in GoCardless dashboard. *

*/ public Boolean getRetryIfPossible() { @@ -588,6 +602,14 @@ private InstalmentsWithDate() { /** * Amount, in the lowest denomination for the currency (e.g. pence in GBP, cents in * EUR). + * + * Minimum and maximum amounts vary by payment scheme. For more information, see + * Transaction + * limits + * + * For Variable Recurring Payments (VRP), this must not exceed the mandate's + * max_amount_per_payment constraint. */ public Integer getAmount() { return amount; @@ -595,8 +617,9 @@ public Integer getAmount() { /** * A future date on which the payment should be collected. If the date is before the - * next_possible_charge_date on the [mandate](#core-endpoints-mandates), it will be - * automatically rolled forwards to that date. + * next_possible_charge_date on the mandate, + * it will be automatically rolled forwards to that date. */ public String getChargeDate() { return chargeDate; @@ -605,8 +628,9 @@ public String getChargeDate() { /** * A human-readable description of the payment. This will be included in the * notification email GoCardless sends to your customer if your organisation does not - * send its own notifications (see [compliance - * requirements](#appendix-compliance-requirements)). + * send its own notifications (see compliance + * requirements). */ public String getDescription() { return description; @@ -617,9 +641,9 @@ public String getDescription() { * Represents a instalments with schedule resource returned from the API. * * Frequency of the payments you want to create, together with an array of payment amounts - * to be collected, with a specified start date for the first payment. See [create (with - * schedule)](#instalment-schedules-create-with-schedule) - * + * to be collected, with a specified start date for the first payment. See create + * (with schedule) */ public static class InstalmentsWithSchedule { private InstalmentsWithSchedule() { @@ -634,24 +658,22 @@ private InstalmentsWithSchedule() { /** * List of amounts of each instalment, in the lowest denomination for the currency (e.g. * cents in USD). - * */ public List getAmounts() { return amounts; } /** - * Number of `interval_units` between charge dates. Must be greater than or equal to - * `1`. - * + * Number of interval_units between charge dates. Must be greater than or + * equal to 1. */ public Integer getInterval() { return interval; } /** - * The unit of time between customer charge dates. One of `weekly`, `monthly` or - * `yearly`. + * The unit of time between customer charge dates. One of weekly, + * monthly or yearly. */ public IntervalUnit getIntervalUnit() { return intervalUnit; @@ -659,10 +681,12 @@ public IntervalUnit getIntervalUnit() { /** * The date on which the first payment should be charged. Must be on or after the - * [mandate](#core-endpoints-mandates)'s `next_possible_charge_date`. When left blank - * and `month` or `day_of_month` are provided, this will be set to the date of the first - * payment. If created without `month` or `day_of_month` this will be set as the - * mandate's `next_possible_charge_date` + * mandate's + * next_possible_charge_date. When left blank and month or + * day_of_month are provided, this will be set to the date of the first + * payment. If created without month or day_of_month this will + * be set as the mandate's next_possible_charge_date */ public String getStartDate() { return startDate; @@ -690,9 +714,9 @@ private Links() { private String instalmentSchedule; /** - * (Optional) ID of the [instalment_schedule](#core-endpoints-instalment-schedules) that - * was created from this instalment schedule request. - * + * (Optional) ID of the instalment_schedule + * that was created from this instalment schedule request. */ public String getInstalmentSchedule() { return instalmentSchedule; @@ -727,30 +751,35 @@ private Links() { private String subscriptionRequestSubscription; /** - * (Optional) ID of the [bank authorisation](#billing-requests-bank-authorisations) that was - * used to verify this request. + * (Optional) ID of the bank + * authorisation that was used to verify this request. */ public String getBankAuthorisation() { return bankAuthorisation; } /** - * ID of the associated [creditor](#core-endpoints-creditors). + * ID of the associated creditor. */ public String getCreditor() { return creditor; } /** - * ID of the [customer](#core-endpoints-customers) that will be used for this request + * ID of the customer + * that will be used for this request */ public String getCustomer() { return customer; } /** - * (Optional) ID of the [customer_bank_account](#core-endpoints-customer-bank-accounts) that - * will be used for this request + * (Optional) ID of the customer_bank_account + * that will be used for this request */ public String getCustomerBankAccount() { return customerBankAccount; @@ -771,8 +800,9 @@ public String getInstalmentScheduleRequest() { } /** - * (Optional) ID of the [instalment_schedule](#core-endpoints-instalment-schedules) that was - * created from this instalment schedule request. + * (Optional) ID of the instalment_schedule + * that was created from this instalment schedule request. */ public String getInstalmentScheduleRequestInstalmentSchedule() { return instalmentScheduleRequestInstalmentSchedule; @@ -786,8 +816,9 @@ public String getMandateRequest() { } /** - * (Optional) ID of the [mandate](#core-endpoints-mandates) that was created from this - * mandate request. this mandate request. + * (Optional) ID of the mandate + * that was created from this mandate request. this mandate request. */ public String getMandateRequestMandate() { return mandateRequestMandate; @@ -815,8 +846,9 @@ public String getPaymentRequest() { } /** - * (Optional) ID of the [payment](#core-endpoints-payments) that was created from this - * payment request. + * (Optional) ID of the payment + * that was created from this payment request. */ public String getPaymentRequestPayment() { return paymentRequestPayment; @@ -830,8 +862,9 @@ public String getSubscriptionRequest() { } /** - * (Optional) ID of the [subscription](#core-endpoints-subscriptions) that was created from - * this subscription request. + * (Optional) ID of the subscription + * that was created from this subscription request. */ public String getSubscriptionRequestSubscription() { return subscriptionRequestSubscription; @@ -862,14 +895,13 @@ private MandateRequest() { private Verify verify; /** - * This field is ACH specific, sometimes referred to as [SEC - * code](https://www.moderntreasury.com/learn/sec-codes). + * This field is ACH specific, sometimes referred to as + * SEC code. * * This is the way that the payer gives authorisation to the merchant. web: Authorisation is * Internet Initiated or via Mobile Entry (maps to SEC code: WEB) telephone: Authorisation * is provided orally over telephone (maps to SEC code: TEL) paper: Authorisation is * provided in writing and signed, or similarly authenticated (maps to SEC code: PPD) - * */ public AuthorisationSource getAuthorisationSource() { return authorisationSource; @@ -877,9 +909,9 @@ public AuthorisationSource getAuthorisationSource() { /** * This attribute represents the authorisation type between the payer and merchant. It can - * be set to `one_off`, `recurring` or `standing` for ACH scheme. And `single`, `recurring` - * and `sporadic` for PAD scheme. _Note:_ This is only supported for ACH and PAD schemes. - * + * be set to one_off, recurring or standing for ACH + * scheme. And single, recurring and sporadic for PAD + * scheme. Note: This is only supported for ACH and PAD schemes. */ public String getConsentType() { return consentType; @@ -894,7 +926,7 @@ public Constraints getConstraints() { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. + * ISO 4217 currency code. */ public String getCurrency() { return currency; @@ -903,7 +935,6 @@ public String getCurrency() { /** * A human-readable description of the payment and/or mandate. This will be displayed to the * payer when authorising the billing request. - * */ public String getDescription() { return description; @@ -912,10 +943,12 @@ public String getDescription() { /** * This field will decide how GoCardless handles settlement of funds from the customer. * - * - `managed` will be moved through GoCardless' account, batched, and payed out. - `direct` - * will be a direct transfer from the payer's account to the merchant where invoicing will - * be handled separately. - * + *
    + *
  • managed will be moved through GoCardless' account, batched, and payed + * out.
  • + *
  • direct will be a direct transfer from the payer's account to the + * merchant where invoicing will be handled separately.
  • + *
*/ public FundsSettlement getFundsSettlement() { return fundsSettlement; @@ -965,26 +998,29 @@ public Boolean getSweeping() { /** * Verification preference for the mandate. One of: + * *
    - *
  • `minimum`: only verify if absolutely required, such as when part of scheme rules
  • - *
  • `recommended`: in addition to `minimum`, use the GoCardless payment intelligence - * solution to decide if a payer should be verified
  • - *
  • `when_available`: if verification mechanisms are available, use them
  • - *
  • `always`: as `when_available`, but fail to create the Billing Request if a mechanism - * isn't available
  • + *
  • minimum: only verify if absolutely required, such as when part of scheme + * rules
  • + *
  • recommended: in addition to minimum, use the GoCardless + * payment intelligence solution to decide if a payer should be verified
  • + *
  • when_available: if verification mechanisms are available, use them
  • + *
  • always: as when_available, but fail to create the Billing + * Request if a mechanism isn't available
  • *
- * - * By default, all Billing Requests use the `recommended` verification preference. It uses - * GoCardless payment intelligence solution to determine if a payer is fraudulent or not. - * The verification mechanism is based on the response and the payer may be asked to verify - * themselves. If the feature is not available, `recommended` behaves like `minimum`. + * By default, all Billing Requests use the recommended verification + * preference. It uses GoCardless payment intelligence solution to determine if a payer is + * fraudulent or not. The verification mechanism is based on the response and the payer may + * be asked to verify themselves. If the feature is not available, recommended + * behaves like minimum. * * If you never wish to take advantage of our reduced risk products and Verified Mandates as - * they are released in new schemes, please use the `minimum` verification preference. + * they are released in new schemes, please use the minimum verification + * preference. * - * See [Billing Requests: Creating Verified - * Mandates](https://developer.gocardless.com/getting-started/billing-requests/verified-mandates/) - * for more information. + * See Billing + * Requests: Creating Verified Mandates for more information. */ public Verify getVerify() { return verify; @@ -1038,15 +1074,15 @@ private Constraints() { * This is an optional field and if it is not supplied the agreement will be considered * open and will not have an end date. Keep in mind the end date must take into account * how long it will take the user to set up this agreement via the Billing Request. - * */ public String getEndDate() { return endDate; } /** - * The maximum amount that can be charged for a single payment. Required for PayTo and - * VRP. + * The maximum amount that can be charged for a single payment in the lowest + * denomination for the currency (e.g. pence in GBP, cents in EUR). Note: + * Required for PayTo and VRP. */ public Integer getMaxAmountPerPayment() { return maxAmountPerPayment; @@ -1054,15 +1090,20 @@ public Integer getMaxAmountPerPayment() { /** * A constraint where you can specify info (free text string) about how payments are - * calculated. _Note:_ This is only supported for ACH and PAD schemes. - * + * calculated. For use when payments vary and cannot be expressed as a fixed amount and + * frequency. Note: This is only supported for ACH and PAD schemes. */ public String getPaymentMethod() { return paymentMethod; } /** - * List of periodic limits and constraints which apply to them + * Caps on the total amount and/or number of payments that can be collected within a + * repeating period (e.g. no more than a set amount per month), as opposed to + * max_amount_per_payment which caps a single payment. + * + * Note: Required for VRP, where exactly one periodic limit must be provided. + * Optional for PayTo. */ public List getPeriodicLimits() { return periodicLimits; @@ -1073,7 +1114,6 @@ public List getPeriodicLimits() { * * This is an optional field and if it is not supplied the start date will be set to the * day authorisation happens. - * */ public String getStartDate() { return startDate; @@ -1095,15 +1135,29 @@ private PeriodicLimit() { private Period period; /** - * The alignment of the period. + * The alignment of the period. Defaults to creation_date if not + * specified. * - * `calendar` - this will finish on the end of the current period. For example this - * will expire on the Monday for the current week or the January for the next year. + * calendar + *
    + *
  • the period follows fixed calendar boundaries, the same for every + * mandate:
  • + *
+ * week runs Monday to Sunday, month runs from the 1st to + * the last day of the calendar month, and year runs from 1 January to + * 31 December. If the mandate starts partway through a period, the limit for that + * first period is reduced proportionally to the days remaining (e.g. a monthly + * limit starting on the 15th gives roughly half the limit for that first month). * - * `creation_date` - this will finish on the next instance of the current period. - * For example Monthly it will expire on the same day of the next month, or yearly - * the same day of the next year. + * creation_date + *
    + *
  • the period follows the mandate's own start date rather than the calendar. For + * example, if the mandate starts on the 15th, each monthly period runs from the + * 15th to the 14th of the following month. The first period is a full period, not + * reduced proportionally.
  • + *
* + * Note: Has no effect when period is flexible. */ public Alignment getAlignment() { return alignment; @@ -1111,8 +1165,8 @@ public Alignment getAlignment() { /** * The maximum number of payments that can be collected in this periodic limit. - * _Note:_ This is only supported for the PayTo scheme, where it is required. * + * Note: Only supported for the PayTo scheme, where it is optional. */ public Integer getMaxPayments() { return maxPayments; @@ -1120,16 +1174,19 @@ public Integer getMaxPayments() { /** * The maximum total amount that can be charged for all payments in this periodic - * limit. Required for VRP. + * limit, in the lowest denomination for the currency (e.g. pence in GBP, cents in + * EUR). * + * Note: Required for VRP. This is not permitted for the PayTo scheme. */ public Integer getMaxTotalAmount() { return maxTotalAmount; } /** - * The repeating period for this mandate. Defaults to flexible for PayTo if not - * specified. + * The repeating period for this mandate. Required whenever a periodic limit is + * provided (for both VRP and PayTo). If periodic_limits is omitted entirely for + * PayTo, this defaults to flexible. */ public Period getPeriod() { return period; @@ -1167,9 +1224,9 @@ private Links() { private String mandate; /** - * (Optional) ID of the [mandate](#core-endpoints-mandates) that was created from this - * mandate request. this mandate request. - * + * (Optional) ID of the mandate + * that was created from this mandate request. this mandate request. */ public String getMandate() { return mandate; @@ -1214,9 +1271,9 @@ public Integer getAppFee() { } /** - * [ISO 4217](https://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 - * supported Eurozone countries only. + * ISO 4217 currency code. + * GBP and EUR supported; GBP with your customers in + * the UK and for EUR with your customers in supported Eurozone countries only. */ public String getCurrency() { return currency; @@ -1225,7 +1282,6 @@ public String getCurrency() { /** * A human-readable description of the payment and/or mandate. This will be displayed to the * payer when authorising the billing request. - * */ public String getDescription() { return description; @@ -1234,10 +1290,12 @@ public String getDescription() { /** * This field will decide how GoCardless handles settlement of funds from the customer. * - * - `managed` will be moved through GoCardless' account, batched, and payed out. - `direct` - * will be a direct transfer from the payer's account to the merchant where invoicing will - * be handled separately. - * + *
    + *
  • managed will be moved through GoCardless' account, batched, and payed + * out.
  • + *
  • direct will be a direct transfer from the payer's account to the + * merchant where invoicing will be handled separately.
  • + *
*/ public FundsSettlement getFundsSettlement() { return fundsSettlement; @@ -1259,18 +1317,18 @@ public Map getMetadata() { * A custom payment reference defined by the merchant. It is only available for payments on * the PayTo scheme or payments using the Direct Funds settlement model on the Faster * Payments scheme. - * */ public String getReference() { return reference; } /** - * (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 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. + * (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 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. */ public String getScheme() { return scheme; @@ -1296,8 +1354,9 @@ private Links() { private String payment; /** - * (Optional) ID of the [payment](#core-endpoints-payments) that was created from this - * payment request. + * (Optional) ID of the payment + * that was created from this payment request. */ public String getPayment() { return payment; @@ -1361,18 +1420,20 @@ private Customer() { private String phoneNumber; /** - * Customer's company name. Required unless a `given_name` and `family_name` are - * provided. For Canadian customers, the use of a `company_name` value will mean that - * any mandate created from this customer will be considered to be a "Business PAD" - * (otherwise, any mandate will be considered to be a "Personal PAD"). + * Customer's company name. Required unless a given_name and + * family_name are provided. For Canadian customers, the use of a + * company_name value will mean that any mandate created from this customer + * will be considered to be a "Business PAD" (otherwise, any mandate will be considered + * to be a "Personal PAD"). */ public String getCompanyName() { return companyName; } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was - * created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; @@ -1387,14 +1448,14 @@ public String getEmail() { } /** - * Customer's surname. Required unless a `company_name` is provided. + * Customer's surname. Required unless a company_name is provided. */ public String getFamilyName() { return familyName; } /** - * Customer's first name. Required unless a `company_name` is provided. + * Customer's first name. Required unless a company_name is provided. */ public String getGivenName() { return givenName; @@ -1408,12 +1469,13 @@ public String getId() { } /** - * [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code. Used as the - * language for notification emails sent by GoCardless if your organisation does not - * send its own (see [compliance requirements](#appendix-compliance-requirements)). - * Currently only "en", "fr", "de", "pt", "es", "it", "nl", "da", "nb", "sl", "sv" are - * supported. If this is not provided, the language will be chosen based on the - * `country_code` (if supplied) or default to "en". + * ISO 639-1 code. + * Used as the language for notification emails sent by GoCardless if your organisation + * does not send its own (see compliance + * requirements). Currently only "en", "fr", "de", "pt", "es", "it", "nl", "da", + * "nb", "sl", "sv" are supported. If this is not provided, the language will be chosen + * based on the country_code (if supplied) or default to "en". */ public String getLanguage() { return language; @@ -1428,8 +1490,8 @@ public Map getMetadata() { } /** - * [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone number, including - * country code. + * ITU E.123 formatted phone number, + * including country code. */ public String getPhoneNumber() { return phoneNumber; @@ -1458,13 +1520,15 @@ private CustomerBankAccount() { private String id; private Links links; private Map metadata; + private PayerNameVerificationResult payerNameVerificationResult; /** * Name of the account holder, as known by the bank. The full name provided when the * customer is created is stored and is available via the API, but is transliterated, * upcased, and truncated to 18 characters in bank submissions. This field is required - * unless the request includes a [customer bank account - * token](#javascript-flow-customer-bank-account-tokens). + * unless the request includes a customer + * bank account token. */ public String getAccountHolderName() { return accountHolderName; @@ -1480,8 +1544,9 @@ public String getAccountNumberEnding() { /** * 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. + * for bank accounts in other currencies. See local + * details for more information. */ public AccountType getAccountType() { return accountType; @@ -1503,25 +1568,28 @@ public String getBankName() { } /** - * [ISO 3166-1 alpha-2 - * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). - * Defaults to the country code of the `iban` if supplied, otherwise is required. + * ISO + * 3166-1 alpha-2 code. Defaults to the country code of the iban if + * supplied, otherwise is required. */ public String getCountryCode() { return countryCode; } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was - * created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. - * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency + * code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are + * supported. */ public String getCurrency() { return currency; @@ -1553,6 +1621,25 @@ public Map getMetadata() { return metadata; } + /** + * The result of the payer name verification check performed when the bank account was + * created. Only present if a check was performed. + * + *
    + *
  • full: The name provided matches the name held by the bank.
  • + *
  • close: The name provided is a close but not exact match to the name + * held by the bank.
  • + *
  • cannot_perform_verification: A verification was attempted but could + * not be completed. This can happen for a number of reasons, including the account + * holder's bank not participating in the verification scheme, the account not being + * eligible for verification (e.g. the account holder has opted out), or the bank + * details not being resolvable, among others.
  • + *
+ */ + public PayerNameVerificationResult getPayerNameVerificationResult() { + return payerNameVerificationResult; + } + public enum AccountType { @SerializedName("savings") SAVINGS, @SerializedName("checking") @@ -1560,6 +1647,14 @@ public enum AccountType { UNKNOWN } + public enum PayerNameVerificationResult { + @SerializedName("full") + FULL, @SerializedName("close") + CLOSE, @SerializedName("cannot_perform_verification") + CANNOT_PERFORM_VERIFICATION, @SerializedName("unknown") + UNKNOWN + } + /** * Represents a link resource returned from the API. * @@ -1573,7 +1668,9 @@ private Links() { private String customer; /** - * ID of the [customer](#core-endpoints-customers) that owns this bank account. + * ID of the customer + * that owns this bank account. */ public String getCustomer() { return customer; @@ -1634,16 +1731,18 @@ public String getCity() { } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public String getCountryCode() { return countryCode; } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was - * created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; @@ -1669,9 +1768,8 @@ public String getId() { * address of the payer to whom the mandate belongs (i.e. as a result of their * completion of a mandate setup flow in their browser). * - * Not required for creating offline mandates where `authorisation_source` is set to - * telephone or paper. - * + * Not required for creating offline mandates where authorisation_source is + * set to telephone or paper. */ public String getIpAddress() { return ipAddress; @@ -1686,8 +1784,8 @@ public String getPostalCode() { /** * The customer's address region, county or department. For US customers a 2 letter - * [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state code is required - * (e.g. `CA` for California). + * ISO3166-2:US state code is + * required (e.g. CA for California). */ public String getRegion() { return region; @@ -1761,31 +1859,36 @@ public Integer getCount() { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "USD" and "CAD" are supported. + * ISO 4217 currency code. + * Currently "USD" and "CAD" are supported. */ public String getCurrency() { return currency; } /** - * As per RFC 2445. The day of the month to charge customers on. `1`-`28` or `-1` to - * indicate the last day of the month. + * As per RFC 2445. The day of the month to charge customers on. 1 + *
    + *
  • + *
+ * 28 or -1 to indicate the last day of the month. */ public Integer getDayOfMonth() { return dayOfMonth; } /** - * Number of `interval_units` between customer charge dates. Must be greater than or equal - * to `1`. Must result in at least one charge date per year. Defaults to `1`. + * Number of interval_units between customer charge dates. Must be greater than + * or equal to 1. Must result in at least one charge date per year. Defaults to + * 1. */ public Integer getInterval() { return interval; } /** - * The unit of time between customer charge dates. One of `weekly`, `monthly` or `yearly`. + * The unit of time between customer charge dates. One of weekly, + * monthly or yearly. */ public IntervalUnit getIntervalUnit() { return intervalUnit; @@ -1805,8 +1908,7 @@ public Map getMetadata() { /** * Name of the month on which to charge a customer. Must be lowercase. Only applies when the - * interval_unit is `yearly`. - * + * interval_unit is yearly. */ public Month getMonth() { return month; @@ -1822,19 +1924,22 @@ public String getName() { /** * An optional payment reference. This will be set as the reference on each payment created - * and will appear on your customer's bank statement. See the documentation for the [create - * payment endpoint](#payments-create-a-payment) for more details.
+ * and will appear on your customer's bank statement. See the documentation for the create + * payment endpoint for more details.
+ *
*/ public String getPaymentReference() { return paymentReference; } /** - * On failure, automatically retry payments using [intelligent - * retries](/success-plus/overview). Default is `false`. + * On failure, automatically retry payments using + * intelligent retries. + * Default is false. *

* Important: To be able to use intelligent retries, Success+ needs to be - * enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus). + * enabled in GoCardless dashboard. *

*/ public Boolean getRetryIfPossible() { @@ -1843,11 +1948,11 @@ public Boolean getRetryIfPossible() { /** * The date on which the first payment should be charged. If fulfilled after this date, this - * will be set as the mandate's `next_possible_charge_date`. When left blank and `month` or - * `day_of_month` are provided, this will be set to the date of the first payment. If - * created without `month` or `day_of_month` this will be set as the mandate's - * `next_possible_charge_date`. - * + * will be set as the mandate's next_possible_charge_date. When left blank and + * month or day_of_month are provided, this will be set to the + * date of the first payment. If created without month or + * day_of_month this will be set as the mandate's + * next_possible_charge_date. */ public String getStartDate() { return startDate; @@ -1891,9 +1996,9 @@ private Links() { private String subscription; /** - * (Optional) ID of the [subscription](#core-endpoints-subscriptions) that was created - * from this subscription request. - * + * (Optional) ID of the subscription + * that was created from this subscription request. */ public String getSubscription() { return subscription; diff --git a/src/main/java/com/gocardless/resources/BillingRequestFlow.java b/src/main/java/com/gocardless/resources/BillingRequestFlow.java index 77922702..48fb2d7c 100644 --- a/src/main/java/com/gocardless/resources/BillingRequestFlow.java +++ b/src/main/java/com/gocardless/resources/BillingRequestFlow.java @@ -86,8 +86,8 @@ public String getId() { } /** - * Sets the default language of the Billing Request Flow and the customer. [ISO - * 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code. + * Sets the default language of the Billing Request Flow and the customer. + * ISO 639-1 code. */ public String getLanguage() { return language; @@ -104,7 +104,6 @@ public Links getLinks() { * * You can only lock bank account if these have already been completed as a part of the billing * request. - * */ public Boolean getLockBankAccount() { return lockBankAccount; @@ -126,7 +125,6 @@ public Boolean getLockCurrency() { * * You can only lock customer details if these have already been completed as a part of the * billing request. - * */ public Boolean getLockCustomerDetails() { return lockCustomerDetails; @@ -206,8 +204,9 @@ private Links() { private String billingRequest; /** - * ID of the [billing request](#billing-requests-billing-requests) against which this flow - * was created. + * ID of the billing + * request against which this flow was created. */ public String getBillingRequest() { return billingRequest; @@ -230,8 +229,9 @@ private PrefilledBankAccount() { /** * Bank account type 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. + * accounts in other currencies. See local + * details for more information. */ public AccountType getAccountType() { return accountType; @@ -300,16 +300,17 @@ public String getCity() { } /** - * Customer's company name. Company name should only be provided if `given_name` and - * `family_name` are null. + * Customer's company name. Company name should only be provided if given_name + * and family_name are null. */ public String getCompanyName() { return companyName; } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public String getCountryCode() { return countryCode; diff --git a/src/main/java/com/gocardless/resources/BillingRequestTemplate.java b/src/main/java/com/gocardless/resources/BillingRequestTemplate.java index 0dd9d044..57718c86 100644 --- a/src/main/java/com/gocardless/resources/BillingRequestTemplate.java +++ b/src/main/java/com/gocardless/resources/BillingRequestTemplate.java @@ -31,7 +31,7 @@ private BillingRequestTemplate() { private String mandateRequestDescription; private Map mandateRequestMetadata; private String mandateRequestScheme; - private MandateRequestVerify mandateRequestVerify; + private String mandateRequestVerify; private Map metadata; private String name; private String paymentRequestAmount; @@ -44,14 +44,16 @@ private BillingRequestTemplate() { /** * Permanent URL that customers can visit to allow them to complete a flow based on this - * template, before being returned to the `redirect_uri`. + * template, before being returned to the redirect_uri. */ public String getAuthorisationUrl() { return authorisationUrl; } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; @@ -73,7 +75,7 @@ public MandateRequestConstraints getMandateRequestConstraints() { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. + * ISO 4217 currency code. */ public String getMandateRequestCurrency() { return mandateRequestCurrency; @@ -82,7 +84,6 @@ public String getMandateRequestCurrency() { /** * A human-readable description of the payment and/or mandate. This will be displayed to the * payer when authorising the billing request. - * */ public String getMandateRequestDescription() { return mandateRequestDescription; @@ -108,29 +109,9 @@ public String getMandateRequestScheme() { } /** - * Verification preference for the mandate. One of: - *
    - *
  • `minimum`: only verify if absolutely required, such as when part of scheme rules
  • - *
  • `recommended`: in addition to `minimum`, use the GoCardless payment intelligence solution - * to decide if a payer should be verified
  • - *
  • `when_available`: if verification mechanisms are available, use them
  • - *
  • `always`: as `when_available`, but fail to create the Billing Request if a mechanism - * isn't available
  • - *
- * - * By default, all Billing Requests use the `recommended` verification preference. It uses - * GoCardless payment intelligence solution to determine if a payer is fraudulent or not. The - * verification mechanism is based on the response and the payer may be asked to verify - * themselves. If the feature is not available, `recommended` behaves like `minimum`. - * - * If you never wish to take advantage of our reduced risk products and Verified Mandates as - * they are released in new schemes, please use the `minimum` verification preference. - * - * See [Billing Requests: Creating Verified - * Mandates](https://developer.gocardless.com/getting-started/billing-requests/verified-mandates/) - * for more information. + * Verification preference for the mandate. */ - public MandateRequestVerify getMandateRequestVerify() { + public String getMandateRequestVerify() { return mandateRequestVerify; } @@ -158,9 +139,9 @@ public String getPaymentRequestAmount() { } /** - * [ISO 4217](https://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 - * supported Eurozone countries only. + * ISO 4217 currency code. + * GBP and EUR supported; GBP with your customers in the + * UK and for EUR with your customers in supported Eurozone countries only. */ public String getPaymentRequestCurrency() { return paymentRequestCurrency; @@ -169,7 +150,6 @@ public String getPaymentRequestCurrency() { /** * A human-readable description of the payment and/or mandate. This will be displayed to the * payer when authorising the billing request. - * */ public String getPaymentRequestDescription() { return paymentRequestDescription; @@ -185,11 +165,12 @@ public Map getPaymentRequestMetadata() { } /** - * (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 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. + * (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 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. */ public String getPaymentRequestScheme() { return paymentRequestScheme; @@ -203,22 +184,14 @@ public String getRedirectUri() { } /** - * Dynamic [timestamp](#api-usage-dates-and-times) recording when this resource was last - * updated. + * Dynamic timestamp + * recording when this resource was last updated. */ public String getUpdatedAt() { return updatedAt; } - public enum MandateRequestVerify { - @SerializedName("minimum") - MINIMUM, @SerializedName("recommended") - RECOMMENDED, @SerializedName("when_available") - WHEN_AVAILABLE, @SerializedName("always") - ALWAYS, @SerializedName("unknown") - UNKNOWN - } - /** * Represents a mandate request constraint resource returned from the API. * @@ -242,14 +215,15 @@ private MandateRequestConstraints() { * This is an optional field and if it is not supplied the agreement will be considered open * and will not have an end date. Keep in mind the end date must take into account how long * it will take the user to set up this agreement via the Billing Request. - * */ public String getEndDate() { return endDate; } /** - * The maximum amount that can be charged for a single payment. Required for PayTo and VRP. + * The maximum amount that can be charged for a single payment in the lowest denomination + * for the currency (e.g. pence in GBP, cents in EUR). Note: Required for PayTo and + * VRP. */ public Integer getMaxAmountPerPayment() { return maxAmountPerPayment; @@ -257,15 +231,20 @@ public Integer getMaxAmountPerPayment() { /** * A constraint where you can specify info (free text string) about how payments are - * calculated. _Note:_ This is only supported for ACH and PAD schemes. - * + * calculated. For use when payments vary and cannot be expressed as a fixed amount and + * frequency. Note: This is only supported for ACH and PAD schemes. */ public String getPaymentMethod() { return paymentMethod; } /** - * List of periodic limits and constraints which apply to them + * Caps on the total amount and/or number of payments that can be collected within a + * repeating period (e.g. no more than a set amount per month), as opposed to + * max_amount_per_payment which caps a single payment. + * + * Note: Required for VRP, where exactly one periodic limit must be provided. + * Optional for PayTo. */ public List getPeriodicLimits() { return periodicLimits; @@ -276,7 +255,6 @@ public List getPeriodicLimits() { * * This is an optional field and if it is not supplied the start date will be set to the day * authorisation happens. - * */ public String getStartDate() { return startDate; @@ -298,41 +276,55 @@ private PeriodicLimit() { private Period period; /** - * The alignment of the period. + * The alignment of the period. Defaults to creation_date if not specified. * - * `calendar` - this will finish on the end of the current period. For example this will - * expire on the Monday for the current week or the January for the next year. + * calendar + *
    + *
  • the period follows fixed calendar boundaries, the same for every mandate:
  • + *
+ * week runs Monday to Sunday, month runs from the 1st to the + * last day of the calendar month, and year runs from 1 January to 31 + * December. If the mandate starts partway through a period, the limit for that first + * period is reduced proportionally to the days remaining (e.g. a monthly limit starting + * on the 15th gives roughly half the limit for that first month). * - * `creation_date` - this will finish on the next instance of the current period. For - * example Monthly it will expire on the same day of the next month, or yearly the same - * day of the next year. + * creation_date + *
    + *
  • the period follows the mandate's own start date rather than the calendar. For + * example, if the mandate starts on the 15th, each monthly period runs from the 15th to + * the 14th of the following month. The first period is a full period, not reduced + * proportionally.
  • + *
* + * Note: Has no effect when period is flexible. */ public Alignment getAlignment() { return alignment; } /** - * The maximum number of payments that can be collected in this periodic limit. _Note:_ - * This is only supported for the PayTo scheme, where it is required. + * The maximum number of payments that can be collected in this periodic limit. * + * Note: Only supported for the PayTo scheme, where it is optional. */ public Integer getMaxPayments() { return maxPayments; } /** - * The maximum total amount that can be charged for all payments in this periodic limit. - * Required for VRP. + * The maximum total amount that can be charged for all payments in this periodic limit, + * in the lowest denomination for the currency (e.g. pence in GBP, cents in EUR). * + * Note: Required for VRP. This is not permitted for the PayTo scheme. */ public Integer getMaxTotalAmount() { return maxTotalAmount; } /** - * The repeating period for this mandate. Defaults to flexible for PayTo if not - * specified. + * The repeating period for this mandate. Required whenever a periodic limit is provided + * (for both VRP and PayTo). If periodic_limits is omitted entirely for PayTo, this + * defaults to flexible. */ public Period getPeriod() { return period; diff --git a/src/main/java/com/gocardless/resources/BillingRequestWithAction.java b/src/main/java/com/gocardless/resources/BillingRequestWithAction.java index c7068523..4aedb60e 100644 --- a/src/main/java/com/gocardless/resources/BillingRequestWithAction.java +++ b/src/main/java/com/gocardless/resources/BillingRequestWithAction.java @@ -11,9 +11,8 @@ * of required input might be additional customer billing details, while an action would be asking a * customer to authorise a payment using their mobile banking app. * - * See [Billing Requests: - * Overview](https://developer.gocardless.com/getting-started/billing-requests/overview/) for - * how-to's, explanations and tutorials. + * See Billing + * Requests: Overview for how-to's, explanations and tutorials. */ public class BillingRequestWithAction { private BillingRequestWithAction() { @@ -39,12 +38,12 @@ public BankAuthorisations getBankAuthorisations() { * example of required input might be additional customer billing details, while an action would * be asking a customer to authorise a payment using their mobile banking app. * - * See [Billing Requests: - * Overview](https://developer.gocardless.com/getting-started/billing-requests/overview/) for - * how-to's, explanations and tutorials. + * See + * Billing + * Requests: Overview for how-to's, explanations and tutorials. *

- * Important: All properties associated with `subscription_request` and - * `instalment_schedule_request` are only supported for ACH and PAD schemes. + * Important: All properties associated with subscription_request + * and instalment_schedule_request are only supported for ACH and PAD schemes. *

*/ public BillingRequests getBillingRequests() { @@ -84,8 +83,9 @@ public AuthorisationType getAuthorisationType() { } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when the user has been - * authorised. + * Fixed timestamp, + * recording when the user has been authorised. */ public String getAuthorisedAt() { return authorisedAt; @@ -114,8 +114,9 @@ public String getId() { } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when the authorisation URL has - * been visited. + * Fixed timestamp, + * recording when the authorisation URL has been visited. */ public String getLastVisitedAt() { return lastVisitedAt; @@ -127,8 +128,8 @@ public Links getLinks() { /** * URL to a QR code PNG image of the bank authorisation url. This QR code can be used as an - * alternative to providing the `url` to the payer to allow them to authorise with their - * mobile devices. + * alternative to providing the url to the payer to allow them to authorise + * with their mobile devices. */ public String getQrCodeUrl() { return qrCodeUrl; @@ -137,24 +138,27 @@ public String getQrCodeUrl() { /** * URL that the payer can be redirected to after authorising the payment. * - * On completion of bank authorisation, the query parameter of either `outcome=success` or - * `outcome=failure` will be appended to the `redirect_uri` to indicate the result of the - * bank authorisation. If the bank authorisation is expired, the query parameter - * `outcome=timeout` will be appended to the `redirect_uri`, in which case you should prompt - * the user to try the bank authorisation step again. + * On completion of bank authorisation, the query parameter of either + * outcome=success or outcome=failure will be appended to the + * redirect_uri to indicate the result of the bank authorisation. If the bank + * authorisation is expired, the query parameter outcome=timeout will be + * appended to the redirect_uri, in which case you should prompt the user to + * try the bank authorisation step again. * - * Please note: bank authorisations can still fail despite an `outcome=success` on the - * `redirect_uri`. It is therefore recommended to wait for the relevant bank authorisation - * event, such as - * [`BANK_AUTHORISATION_AUTHORISED`](#billing-request-bankauthorisationauthorised), - * [`BANK_AUTHORISATION_DENIED`](#billing-request-bankauthorisationdenied), or - * [`BANK_AUTHORISATION_FAILED`](#billing-request-bankauthorisationfailed) in order to show - * the correct outcome to the user. + * Please note: bank authorisations can still fail despite an outcome=success + * on the redirect_uri. It is therefore recommended to wait for the relevant + * bank authorisation event, such as BANK_AUTHORISATION_AUTHORISED, + * BANK_AUTHORISATION_DENIED, + * or BANK_AUTHORISATION_FAILED + * in order to show the correct outcome to the user. * - * The BillingRequestFlow ID will also be appended to the `redirect_uri` as query parameter - * `id=BRF123`. + * The BillingRequestFlow ID will also be appended to the redirect_uri as query + * parameter id=BRF123. * - * Defaults to `https://pay.gocardless.com/billing/static/thankyou`. + * Defaults to https://pay.gocardless.com/billing/static/thankyou. */ public String getRedirectUri() { return redirectUri; @@ -188,16 +192,18 @@ private Links() { private String institution; /** - * ID of the [billing request](#billing-requests-billing-requests) against which this - * authorisation was created. + * ID of the billing + * request against which this authorisation was created. */ public String getBillingRequest() { return billingRequest; } /** - * ID of the [institution](#billing-requests-institutions) against which this - * authorisation was created. + * ID of the institution + * against which this authorisation was created. */ public String getInstitution() { return institution; @@ -212,12 +218,12 @@ public String getInstitution() { * example of required input might be additional customer billing details, while an action would * be asking a customer to authorise a payment using their mobile banking app. * - * See [Billing Requests: - * Overview](https://developer.gocardless.com/getting-started/billing-requests/overview/) for - * how-to's, explanations and tutorials. + * See + * Billing + * Requests: Overview for how-to's, explanations and tutorials. *

- * Important: All properties associated with `subscription_request` and - * `instalment_schedule_request` are only supported for ACH and PAD schemes. + * Important: All properties associated with subscription_request + * and instalment_schedule_request are only supported for ACH and PAD schemes. *

*/ public static class BillingRequests { @@ -250,7 +256,9 @@ public List getActions() { } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; @@ -260,9 +268,9 @@ public String getCreatedAt() { * (Optional) If true, this billing request can fallback from instant payment to direct * debit. Should not be set if GoCardless payment intelligence feature is used. * - * See [Billing Requests: Retain customers with - * Fallbacks](https://developer.gocardless.com/billing-requests/retain-customers-with-fallbacks/) - * for more information. + * See Billing + * Requests: Retain customers with Fallbacks for more information. */ public Boolean getFallbackEnabled() { return fallbackEnabled; @@ -283,8 +291,9 @@ public String getId() { } /** - * Request for an instalment schedule. Has to contain either `instalments_with_schedule` - * object or an array of `instalments_with_dates` objects + * Request for an instalment schedule. Has to contain either + * instalments_with_schedule object or an array of + * instalments_with_dates objects */ public InstalmentScheduleRequest getInstalmentScheduleRequest() { return instalmentScheduleRequest; @@ -322,9 +331,9 @@ public PaymentContextCode getPaymentContextCode() { /** * Specifies the underlying purpose of the payment. Defines the specific reason or type of * service/goods the payment relates to, improving straight-through processing and - * compliance. See [VRP Commercial Payment Purpose - * Codes](https://developer.gocardless.com/vrp-commercial-payment-purpose-codes/) for the - * complete list of valid codes. + * compliance. See + * VRP + * Commercial Payment Purpose Codes for the complete list of valid codes. */ public String getPaymentPurposeCode() { return paymentPurposeCode; @@ -340,9 +349,9 @@ public PaymentRequest getPaymentRequest() { /** * Specifies the high-level purpose/category of a mandate and/or payment using a set of * pre-defined categories. Provides context on the nature and reason for the payment to - * facilitate processing and compliance. See [Billing Request Purpose - * Codes](https://developer.gocardless.com/billing-request-purpose-codes/) for the complete - * list of valid codes. + * facilitate processing and compliance. See + * Billing Request + * Purpose Codes for the complete list of valid codes. */ public PurposeCode getPurposeCode() { return purposeCode; @@ -354,12 +363,15 @@ public Resources getResources() { /** * One of: + * *
    - *
  • `pending`: the billing request is pending and can be used
  • - *
  • `ready_to_fulfil`: the billing request is ready to fulfil
  • - *
  • `fulfilling`: the billing request is currently undergoing fulfilment
  • - *
  • `fulfilled`: the billing request has been fulfilled and a payment created
  • - *
  • `cancelled`: the billing request has been cancelled and cannot be used
  • + *
  • pending: the billing request is pending and can be used
  • + *
  • ready_to_fulfil: the billing request is ready to fulfil
  • + *
  • fulfilling: the billing request is currently undergoing fulfilment
  • + *
  • fulfilled: the billing request has been fulfilled and a payment + * created
  • + *
  • cancelled: the billing request has been cancelled and cannot be + * used
  • *
*/ public Status getStatus() { @@ -504,13 +516,18 @@ public List getCompletesActions() { /** * Describes whether we inferred the institution from the provided bank account details. - * One of: - `not_needed`: we won't attempt to infer the institution as it is not - * needed. Either because it was manually selected or the billing request does not - * support this feature - `pending`: we are waiting on the bank details in order to - * infer the institution - `failed`: we weren't able to infer the institution - - * `success`: we inferred the institution and added it to the resources of a Billing - * Request + * One of: * + *
    + *
  • not_needed: we won't attempt to infer the institution as it is not + * needed. Either because it was manually selected or the billing request does not + * support this feature
  • + *
  • pending: we are waiting on the bank details in order to infer the + * institution
  • + *
  • failed: we weren't able to infer the institution
  • + *
  • success: we inferred the institution and added it to the resources + * of a Billing Request
  • + *
*/ public InstitutionGuessStatus getInstitutionGuessStatus() { return institutionGuessStatus; @@ -668,8 +685,9 @@ public List getCustomerBillingDetail() { /** * Represents a instalment schedule request resource returned from the API. * - * Request for an instalment schedule. Has to contain either `instalments_with_schedule` - * object or an array of `instalments_with_dates` objects + * Request for an instalment schedule. Has to contain either + * instalments_with_schedule object or an array of + * instalments_with_dates objects */ public static class InstalmentScheduleRequest { private InstalmentScheduleRequest() { @@ -697,16 +715,18 @@ public Integer getAppFee() { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. - * Currently "USD" and "CAD" are supported. + * ISO 4217 currency + * code. Currently "USD" and "CAD" are supported. */ public String getCurrency() { return currency; } /** - * An explicit array of instalment payments, each specifying at least an `amount` and - * `charge_date`. See [create (with dates)](#instalment-schedules-create-with-dates) + * An explicit array of instalment payments, each specifying at least an + * amount and charge_date. See create + * (with dates) */ public List getInstalmentsWithDates() { return instalmentsWithDates; @@ -715,8 +735,9 @@ public List getInstalmentsWithDates() { /** * Frequency of the payments you want to create, together with an array of payment * amounts to be collected, with a specified start date for the first payment. See - * [create (with schedule)](#instalment-schedules-create-with-schedule) - * + * create + * (with schedule) */ public InstalmentsWithSchedule getInstalmentsWithSchedule() { return instalmentsWithSchedule; @@ -745,18 +766,23 @@ public String getName() { /** * An optional payment reference. This will be set as the reference on each payment * created and will appear on your customer's bank statement. See the documentation for - * the [create payment endpoint](#payments-create-a-payment) for more details.
+ * the create + * payment endpoint for more details.
+ *
*/ public String getPaymentReference() { return paymentReference; } /** - * On failure, automatically retry payments using [intelligent - * retries](/success-plus/overview). Default is `false`. + * On failure, automatically retry payments using + * intelligent + * retries. Default is false. *

* Important: To be able to use intelligent retries, Success+ needs to - * be enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus). + * be enabled in GoCardless + * dashboard. *

*/ public Boolean getRetryIfPossible() { @@ -790,6 +816,14 @@ private InstalmentsWithDate() { /** * Amount, in the lowest denomination for the currency (e.g. pence in GBP, cents in * EUR). + * + * Minimum and maximum amounts vary by payment scheme. For more information, see + * Transaction + * limits + * + * For Variable Recurring Payments (VRP), this must not exceed the mandate's + * max_amount_per_payment constraint. */ public Integer getAmount() { return amount; @@ -797,8 +831,9 @@ public Integer getAmount() { /** * A future date on which the payment should be collected. If the date is before the - * next_possible_charge_date on the [mandate](#core-endpoints-mandates), it will be - * automatically rolled forwards to that date. + * next_possible_charge_date on the mandate, + * it will be automatically rolled forwards to that date. */ public String getChargeDate() { return chargeDate; @@ -807,8 +842,9 @@ public String getChargeDate() { /** * A human-readable description of the payment. This will be included in the * notification email GoCardless sends to your customer if your organisation does - * not send its own notifications (see [compliance - * requirements](#appendix-compliance-requirements)). + * not send its own notifications (see compliance + * requirements). */ public String getDescription() { return description; @@ -820,8 +856,9 @@ public String getDescription() { * * Frequency of the payments you want to create, together with an array of payment * amounts to be collected, with a specified start date for the first payment. See - * [create (with schedule)](#instalment-schedules-create-with-schedule) - * + * create + * (with schedule) */ public static class InstalmentsWithSchedule { private InstalmentsWithSchedule() { @@ -836,24 +873,22 @@ private InstalmentsWithSchedule() { /** * List of amounts of each instalment, in the lowest denomination for the currency * (e.g. cents in USD). - * */ public List getAmounts() { return amounts; } /** - * Number of `interval_units` between charge dates. Must be greater than or equal to - * `1`. - * + * Number of interval_units between charge dates. Must be greater than + * or equal to 1. */ public Integer getInterval() { return interval; } /** - * The unit of time between customer charge dates. One of `weekly`, `monthly` or - * `yearly`. + * The unit of time between customer charge dates. One of weekly, + * monthly or yearly. */ public IntervalUnit getIntervalUnit() { return intervalUnit; @@ -861,10 +896,12 @@ public IntervalUnit getIntervalUnit() { /** * The date on which the first payment should be charged. Must be on or after the - * [mandate](#core-endpoints-mandates)'s `next_possible_charge_date`. When left - * blank and `month` or `day_of_month` are provided, this will be set to the date of - * the first payment. If created without `month` or `day_of_month` this will be set - * as the mandate's `next_possible_charge_date` + * mandate's + * next_possible_charge_date. When left blank and month or + * day_of_month are provided, this will be set to the date of the first + * payment. If created without month or day_of_month this + * will be set as the mandate's next_possible_charge_date */ public String getStartDate() { return startDate; @@ -892,9 +929,9 @@ private Links() { private String instalmentSchedule; /** - * (Optional) ID of the [instalment_schedule](#core-endpoints-instalment-schedules) + * (Optional) ID of the instalment_schedule * that was created from this instalment schedule request. - * */ public String getInstalmentSchedule() { return instalmentSchedule; @@ -929,29 +966,34 @@ private Links() { private String subscriptionRequestSubscription; /** - * (Optional) ID of the [bank authorisation](#billing-requests-bank-authorisations) that - * was used to verify this request. + * (Optional) ID of the bank + * authorisation that was used to verify this request. */ public String getBankAuthorisation() { return bankAuthorisation; } /** - * ID of the associated [creditor](#core-endpoints-creditors). + * ID of the associated creditor. */ public String getCreditor() { return creditor; } /** - * ID of the [customer](#core-endpoints-customers) that will be used for this request + * ID of the customer + * that will be used for this request */ public String getCustomer() { return customer; } /** - * (Optional) ID of the [customer_bank_account](#core-endpoints-customer-bank-accounts) + * (Optional) ID of the customer_bank_account * that will be used for this request */ public String getCustomerBankAccount() { @@ -973,8 +1015,9 @@ public String getInstalmentScheduleRequest() { } /** - * (Optional) ID of the [instalment_schedule](#core-endpoints-instalment-schedules) that - * was created from this instalment schedule request. + * (Optional) ID of the instalment_schedule + * that was created from this instalment schedule request. */ public String getInstalmentScheduleRequestInstalmentSchedule() { return instalmentScheduleRequestInstalmentSchedule; @@ -988,8 +1031,9 @@ public String getMandateRequest() { } /** - * (Optional) ID of the [mandate](#core-endpoints-mandates) that was created from this - * mandate request. this mandate request. + * (Optional) ID of the mandate + * that was created from this mandate request. this mandate request. */ public String getMandateRequestMandate() { return mandateRequestMandate; @@ -1017,8 +1061,9 @@ public String getPaymentRequest() { } /** - * (Optional) ID of the [payment](#core-endpoints-payments) that was created from this - * payment request. + * (Optional) ID of the payment + * that was created from this payment request. */ public String getPaymentRequestPayment() { return paymentRequestPayment; @@ -1032,8 +1077,9 @@ public String getSubscriptionRequest() { } /** - * (Optional) ID of the [subscription](#core-endpoints-subscriptions) that was created - * from this subscription request. + * (Optional) ID of the subscription + * that was created from this subscription request. */ public String getSubscriptionRequestSubscription() { return subscriptionRequestSubscription; @@ -1064,15 +1110,14 @@ private MandateRequest() { private Verify verify; /** - * This field is ACH specific, sometimes referred to as [SEC - * code](https://www.moderntreasury.com/learn/sec-codes). + * This field is ACH specific, sometimes referred to as + * SEC code. * * This is the way that the payer gives authorisation to the merchant. web: * Authorisation is Internet Initiated or via Mobile Entry (maps to SEC code: WEB) * telephone: Authorisation is provided orally over telephone (maps to SEC code: TEL) * paper: Authorisation is provided in writing and signed, or similarly authenticated * (maps to SEC code: PPD) - * */ public AuthorisationSource getAuthorisationSource() { return authorisationSource; @@ -1080,10 +1125,10 @@ public AuthorisationSource getAuthorisationSource() { /** * This attribute represents the authorisation type between the payer and merchant. It - * can be set to `one_off`, `recurring` or `standing` for ACH scheme. And `single`, - * `recurring` and `sporadic` for PAD scheme. _Note:_ This is only supported for ACH and - * PAD schemes. - * + * can be set to one_off, recurring or standing + * for ACH scheme. And single, recurring and + * sporadic for PAD scheme. Note: This is only supported for ACH + * and PAD schemes. */ public String getConsentType() { return consentType; @@ -1098,7 +1143,8 @@ public Constraints getConstraints() { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. + * ISO 4217 currency + * code. */ public String getCurrency() { return currency; @@ -1107,7 +1153,6 @@ public String getCurrency() { /** * A human-readable description of the payment and/or mandate. This will be displayed to * the payer when authorising the billing request. - * */ public String getDescription() { return description; @@ -1116,10 +1161,12 @@ public String getDescription() { /** * This field will decide how GoCardless handles settlement of funds from the customer. * - * - `managed` will be moved through GoCardless' account, batched, and payed out. - - * `direct` will be a direct transfer from the payer's account to the merchant where - * invoicing will be handled separately. - * + *
    + *
  • managed will be moved through GoCardless' account, batched, and + * payed out.
  • + *
  • direct will be a direct transfer from the payer's account to the + * merchant where invoicing will be handled separately.
  • + *
*/ public FundsSettlement getFundsSettlement() { return fundsSettlement; @@ -1169,29 +1216,30 @@ public Boolean getSweeping() { /** * Verification preference for the mandate. One of: + * *
    - *
  • `minimum`: only verify if absolutely required, such as when part of scheme - * rules
  • - *
  • `recommended`: in addition to `minimum`, use the GoCardless payment intelligence - * solution to decide if a payer should be verified
  • - *
  • `when_available`: if verification mechanisms are available, use them
  • - *
  • `always`: as `when_available`, but fail to create the Billing Request if a - * mechanism isn't available
  • + *
  • minimum: only verify if absolutely required, such as when part of + * scheme rules
  • + *
  • recommended: in addition to minimum, use the GoCardless + * payment intelligence solution to decide if a payer should be verified
  • + *
  • when_available: if verification mechanisms are available, use + * them
  • + *
  • always: as when_available, but fail to create the + * Billing Request if a mechanism isn't available
  • *
- * - * By default, all Billing Requests use the `recommended` verification preference. It - * uses GoCardless payment intelligence solution to determine if a payer is fraudulent - * or not. The verification mechanism is based on the response and the payer may be - * asked to verify themselves. If the feature is not available, `recommended` behaves - * like `minimum`. + * By default, all Billing Requests use the recommended verification + * preference. It uses GoCardless payment intelligence solution to determine if a payer + * is fraudulent or not. The verification mechanism is based on the response and the + * payer may be asked to verify themselves. If the feature is not available, + * recommended behaves like minimum. * * If you never wish to take advantage of our reduced risk products and Verified - * Mandates as they are released in new schemes, please use the `minimum` verification - * preference. + * Mandates as they are released in new schemes, please use the minimum + * verification preference. * - * See [Billing Requests: Creating Verified - * Mandates](https://developer.gocardless.com/getting-started/billing-requests/verified-mandates/) - * for more information. + * See Billing + * Requests: Creating Verified Mandates for more information. */ public Verify getVerify() { return verify; @@ -1246,15 +1294,15 @@ private Constraints() { * considered open and will not have an end date. Keep in mind the end date must * take into account how long it will take the user to set up this agreement via the * Billing Request. - * */ public String getEndDate() { return endDate; } /** - * The maximum amount that can be charged for a single payment. Required for PayTo - * and VRP. + * The maximum amount that can be charged for a single payment in the lowest + * denomination for the currency (e.g. pence in GBP, cents in EUR). Note: + * Required for PayTo and VRP. */ public Integer getMaxAmountPerPayment() { return maxAmountPerPayment; @@ -1262,15 +1310,20 @@ public Integer getMaxAmountPerPayment() { /** * A constraint where you can specify info (free text string) about how payments are - * calculated. _Note:_ This is only supported for ACH and PAD schemes. - * + * calculated. For use when payments vary and cannot be expressed as a fixed amount + * and frequency. Note: This is only supported for ACH and PAD schemes. */ public String getPaymentMethod() { return paymentMethod; } /** - * List of periodic limits and constraints which apply to them + * Caps on the total amount and/or number of payments that can be collected within a + * repeating period (e.g. no more than a set amount per month), as opposed to + * max_amount_per_payment which caps a single payment. + * + * Note: Required for VRP, where exactly one periodic limit must be + * provided. Optional for PayTo. */ public List getPeriodicLimits() { return periodicLimits; @@ -1281,7 +1334,6 @@ public List getPeriodicLimits() { * * This is an optional field and if it is not supplied the start date will be set to * the day authorisation happens. - * */ public String getStartDate() { return startDate; @@ -1303,16 +1355,30 @@ private PeriodicLimit() { private Period period; /** - * The alignment of the period. + * The alignment of the period. Defaults to creation_date if not + * specified. * - * `calendar` - this will finish on the end of the current period. For example - * this will expire on the Monday for the current week or the January for the - * next year. + * calendar + *
    + *
  • the period follows fixed calendar boundaries, the same for every + * mandate:
  • + *
+ * week runs Monday to Sunday, month runs from the 1st + * to the last day of the calendar month, and year runs from 1 + * January to 31 December. If the mandate starts partway through a period, the + * limit for that first period is reduced proportionally to the days remaining + * (e.g. a monthly limit starting on the 15th gives roughly half the limit for + * that first month). * - * `creation_date` - this will finish on the next instance of the current - * period. For example Monthly it will expire on the same day of the next month, - * or yearly the same day of the next year. + * creation_date + *
    + *
  • the period follows the mandate's own start date rather than the calendar. + * For example, if the mandate starts on the 15th, each monthly period runs from + * the 15th to the 14th of the following month. The first period is a full + * period, not reduced proportionally.
  • + *
* + * Note: Has no effect when period is flexible. */ public Alignment getAlignment() { return alignment; @@ -1320,8 +1386,8 @@ public Alignment getAlignment() { /** * The maximum number of payments that can be collected in this periodic limit. - * _Note:_ This is only supported for the PayTo scheme, where it is required. * + * Note: Only supported for the PayTo scheme, where it is optional. */ public Integer getMaxPayments() { return maxPayments; @@ -1329,16 +1395,19 @@ public Integer getMaxPayments() { /** * The maximum total amount that can be charged for all payments in this - * periodic limit. Required for VRP. + * periodic limit, in the lowest denomination for the currency (e.g. pence in + * GBP, cents in EUR). * + * Note: Required for VRP. This is not permitted for the PayTo scheme. */ public Integer getMaxTotalAmount() { return maxTotalAmount; } /** - * The repeating period for this mandate. Defaults to flexible for PayTo if not - * specified. + * The repeating period for this mandate. Required whenever a periodic limit is + * provided (for both VRP and PayTo). If periodic_limits is omitted entirely for + * PayTo, this defaults to flexible. */ public Period getPeriod() { return period; @@ -1376,9 +1445,9 @@ private Links() { private String mandate; /** - * (Optional) ID of the [mandate](#core-endpoints-mandates) that was created from - * this mandate request. this mandate request. - * + * (Optional) ID of the mandate + * that was created from this mandate request. this mandate request. */ public String getMandate() { return mandate; @@ -1423,9 +1492,10 @@ public Integer getAppFee() { } /** - * [ISO 4217](https://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 supported Eurozone countries only. + * ISO 4217 currency + * code. GBP and EUR supported; GBP with your + * customers in the UK and for EUR with your customers in supported + * Eurozone countries only. */ public String getCurrency() { return currency; @@ -1434,7 +1504,6 @@ public String getCurrency() { /** * A human-readable description of the payment and/or mandate. This will be displayed to * the payer when authorising the billing request. - * */ public String getDescription() { return description; @@ -1443,10 +1512,12 @@ public String getDescription() { /** * This field will decide how GoCardless handles settlement of funds from the customer. * - * - `managed` will be moved through GoCardless' account, batched, and payed out. - - * `direct` will be a direct transfer from the payer's account to the merchant where - * invoicing will be handled separately. - * + *
    + *
  • managed will be moved through GoCardless' account, batched, and + * payed out.
  • + *
  • direct will be a direct transfer from the payer's account to the + * merchant where invoicing will be handled separately.
  • + *
*/ public FundsSettlement getFundsSettlement() { return fundsSettlement; @@ -1468,18 +1539,18 @@ public Map getMetadata() { * A custom payment reference defined by the merchant. It is only available for payments * on the PayTo scheme or payments using the Direct Funds settlement model on the Faster * Payments scheme. - * */ public String getReference() { return reference; } /** - * (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 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 + * (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 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. */ public String getScheme() { @@ -1506,8 +1577,9 @@ private Links() { private String payment; /** - * (Optional) ID of the [payment](#core-endpoints-payments) that was created from - * this payment request. + * (Optional) ID of the payment + * that was created from this payment request. */ public String getPayment() { return payment; @@ -1571,18 +1643,20 @@ private Customer() { private String phoneNumber; /** - * Customer's company name. Required unless a `given_name` and `family_name` are - * provided. For Canadian customers, the use of a `company_name` value will mean - * that any mandate created from this customer will be considered to be a "Business - * PAD" (otherwise, any mandate will be considered to be a "Personal PAD"). + * Customer's company name. Required unless a given_name and + * family_name are provided. For Canadian customers, the use of a + * company_name value will mean that any mandate created from this + * customer will be considered to be a "Business PAD" (otherwise, any mandate will + * be considered to be a "Personal PAD"). */ public String getCompanyName() { return companyName; } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was - * created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; @@ -1597,14 +1671,14 @@ public String getEmail() { } /** - * Customer's surname. Required unless a `company_name` is provided. + * Customer's surname. Required unless a company_name is provided. */ public String getFamilyName() { return familyName; } /** - * Customer's first name. Required unless a `company_name` is provided. + * Customer's first name. Required unless a company_name is provided. */ public String getGivenName() { return givenName; @@ -1618,13 +1692,13 @@ public String getId() { } /** - * [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code. Used as - * the language for notification emails sent by GoCardless if your organisation does - * not send its own (see [compliance - * requirements](#appendix-compliance-requirements)). Currently only "en", "fr", - * "de", "pt", "es", "it", "nl", "da", "nb", "sl", "sv" are supported. If this is - * not provided, the language will be chosen based on the `country_code` (if - * supplied) or default to "en". + * ISO 639-1 + * code. Used as the language for notification emails sent by GoCardless if your + * organisation does not send its own (see compliance + * requirements). Currently only "en", "fr", "de", "pt", "es", "it", "nl", "da", + * "nb", "sl", "sv" are supported. If this is not provided, the language will be + * chosen based on the country_code (if supplied) or default to "en". */ public String getLanguage() { return language; @@ -1639,8 +1713,8 @@ public Map getMetadata() { } /** - * [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone number, - * including country code. + * ITU E.123 formatted phone + * number, including country code. */ public String getPhoneNumber() { return phoneNumber; @@ -1669,13 +1743,15 @@ private CustomerBankAccount() { private String id; private Links links; private Map metadata; + private PayerNameVerificationResult payerNameVerificationResult; /** * Name of the account holder, as known by the bank. The full name provided when the * customer is created is stored and is available via the API, but is * transliterated, upcased, and truncated to 18 characters in bank submissions. This - * field is required unless the request includes a [customer bank account - * token](#javascript-flow-customer-bank-account-tokens). + * field is required unless the request includes a customer + * bank account token. */ public String getAccountHolderName() { return accountHolderName; @@ -1691,8 +1767,9 @@ public String getAccountNumberEnding() { /** * 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. + * provided for bank accounts in other currencies. See local + * details for more information. */ public AccountType getAccountType() { return accountType; @@ -1714,26 +1791,28 @@ public String getBankName() { } /** - * [ISO 3166-1 alpha-2 - * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). - * Defaults to the country code of the `iban` if supplied, otherwise is required. + * ISO + * 3166-1 alpha-2 code. Defaults to the country code of the iban if + * supplied, otherwise is required. */ public String getCountryCode() { return countryCode; } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was - * created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. - * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are - * supported. + * ISO 4217 + * currency code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and + * "USD" are supported. */ public String getCurrency() { return currency; @@ -1765,6 +1844,25 @@ public Map getMetadata() { return metadata; } + /** + * The result of the payer name verification check performed when the bank account + * was created. Only present if a check was performed. + * + *
    + *
  • full: The name provided matches the name held by the bank.
  • + *
  • close: The name provided is a close but not exact match to the + * name held by the bank.
  • + *
  • cannot_perform_verification: A verification was attempted but + * could not be completed. This can happen for a number of reasons, including the + * account holder's bank not participating in the verification scheme, the account + * not being eligible for verification (e.g. the account holder has opted out), or + * the bank details not being resolvable, among others.
  • + *
+ */ + public PayerNameVerificationResult getPayerNameVerificationResult() { + return payerNameVerificationResult; + } + public enum AccountType { @SerializedName("savings") SAVINGS, @SerializedName("checking") @@ -1772,6 +1870,14 @@ public enum AccountType { UNKNOWN } + public enum PayerNameVerificationResult { + @SerializedName("full") + FULL, @SerializedName("close") + CLOSE, @SerializedName("cannot_perform_verification") + CANNOT_PERFORM_VERIFICATION, @SerializedName("unknown") + UNKNOWN + } + /** * Represents a link resource returned from the API. * @@ -1785,7 +1891,9 @@ private Links() { private String customer; /** - * ID of the [customer](#core-endpoints-customers) that owns this bank account. + * ID of the customer + * that owns this bank account. */ public String getCustomer() { return customer; @@ -1846,16 +1954,18 @@ public String getCity() { } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public String getCountryCode() { return countryCode; } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was - * created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; @@ -1882,9 +1992,8 @@ public String getId() { * address of the payer to whom the mandate belongs (i.e. as a result of their * completion of a mandate setup flow in their browser). * - * Not required for creating offline mandates where `authorisation_source` is set to - * telephone or paper. - * + * Not required for creating offline mandates where + * authorisation_source is set to telephone or paper. */ public String getIpAddress() { return ipAddress; @@ -1899,8 +2008,8 @@ public String getPostalCode() { /** * The customer's address region, county or department. For US customers a 2 letter - * [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state code is - * required (e.g. `CA` for California). + * ISO3166-2:US state code + * is required (e.g. CA for California). */ public String getRegion() { return region; @@ -1974,32 +2083,36 @@ public Integer getCount() { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. - * Currently "USD" and "CAD" are supported. + * ISO 4217 currency + * code. Currently "USD" and "CAD" are supported. */ public String getCurrency() { return currency; } /** - * As per RFC 2445. The day of the month to charge customers on. `1`-`28` or `-1` to - * indicate the last day of the month. + * As per RFC 2445. The day of the month to charge customers on. 1 + *
    + *
  • + *
+ * 28 or -1 to indicate the last day of the month. */ public Integer getDayOfMonth() { return dayOfMonth; } /** - * Number of `interval_units` between customer charge dates. Must be greater than or - * equal to `1`. Must result in at least one charge date per year. Defaults to `1`. + * Number of interval_units between customer charge dates. Must be greater + * than or equal to 1. Must result in at least one charge date per year. + * Defaults to 1. */ public Integer getInterval() { return interval; } /** - * The unit of time between customer charge dates. One of `weekly`, `monthly` or - * `yearly`. + * The unit of time between customer charge dates. One of weekly, + * monthly or yearly. */ public IntervalUnit getIntervalUnit() { return intervalUnit; @@ -2019,8 +2132,7 @@ public Map getMetadata() { /** * Name of the month on which to charge a customer. Must be lowercase. Only applies when - * the interval_unit is `yearly`. - * + * the interval_unit is yearly. */ public Month getMonth() { return month; @@ -2037,18 +2149,23 @@ public String getName() { /** * An optional payment reference. This will be set as the reference on each payment * created and will appear on your customer's bank statement. See the documentation for - * the [create payment endpoint](#payments-create-a-payment) for more details.
+ * the create + * payment endpoint for more details.
+ *
*/ public String getPaymentReference() { return paymentReference; } /** - * On failure, automatically retry payments using [intelligent - * retries](/success-plus/overview). Default is `false`. + * On failure, automatically retry payments using + * intelligent + * retries. Default is false. *

* Important: To be able to use intelligent retries, Success+ needs to - * be enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus). + * be enabled in GoCardless + * dashboard. *

*/ public Boolean getRetryIfPossible() { @@ -2057,11 +2174,11 @@ public Boolean getRetryIfPossible() { /** * The date on which the first payment should be charged. If fulfilled after this date, - * this will be set as the mandate's `next_possible_charge_date`. When left blank and - * `month` or `day_of_month` are provided, this will be set to the date of the first - * payment. If created without `month` or `day_of_month` this will be set as the - * mandate's `next_possible_charge_date`. - * + * this will be set as the mandate's next_possible_charge_date. When left + * blank and month or day_of_month are provided, this will be + * set to the date of the first payment. If created without month or + * day_of_month this will be set as the mandate's + * next_possible_charge_date. */ public String getStartDate() { return startDate; @@ -2105,9 +2222,9 @@ private Links() { private String subscription; /** - * (Optional) ID of the [subscription](#core-endpoints-subscriptions) that was - * created from this subscription request. - * + * (Optional) ID of the subscription + * that was created from this subscription request. */ public String getSubscription() { return subscription; diff --git a/src/main/java/com/gocardless/resources/Block.java b/src/main/java/com/gocardless/resources/Block.java index e0fa955a..840ab626 100644 --- a/src/main/java/com/gocardless/resources/Block.java +++ b/src/main/java/com/gocardless/resources/Block.java @@ -18,9 +18,10 @@ * * Please note: * - * - Payments and subscriptions cannot be created against a mandate in blocked state. - A mandate - * can never be transitioned out of the blocked state. - * + *
    + *
  • Payments and subscriptions cannot be created against a mandate in blocked state.
  • + *
  • A mandate can never be transitioned out of the blocked state.
  • + *
* The one exception to this is when blocking a 'bank_name'. This block will prevent bank accounts * from being created for banks that match the given name. To ensure we match bank names correctly * an existing bank account must be used when creating this block. Please be aware that we cannot @@ -62,7 +63,9 @@ public BlockType getBlockType() { } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; @@ -104,7 +107,9 @@ public String getResourceReference() { } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was updated. + * Fixed timestamp, + * recording when this resource was updated. */ public String getUpdatedAt() { return updatedAt; diff --git a/src/main/java/com/gocardless/resources/Creditor.java b/src/main/java/com/gocardless/resources/Creditor.java index 6d583f72..dfb40350 100644 --- a/src/main/java/com/gocardless/resources/Creditor.java +++ b/src/main/java/com/gocardless/resources/Creditor.java @@ -6,9 +6,11 @@ /** * Represents a creditor resource returned from the API. * - * Each [payment](#core-endpoints-payments) taken through the API is linked to a "creditor", to whom - * the payment is then paid out. In most cases your organisation will have a single "creditor", but - * the API also supports collecting payments on behalf of others. + * Each + * payment + * taken through the API is linked to a "creditor", to whom the payment is then paid out. In most + * cases your organisation will have a single "creditor", but the API also supports collecting + * payments on behalf of others. * * Currently, for Anti Money Laundering reasons, any creditors you add must be directly related to * your organisation. @@ -63,11 +65,10 @@ public String getAddressLine3() { /** * Prefix for the bank reference of payouts sent to this creditor. For instance, if the - * creditor's `bank_reference_prefix` was `ACME`, the bank reference of a payout sent to that - * creditor could be `ACME-8G7Q8`. + * creditor's bank_reference_prefix was ACME, the bank reference of a + * payout sent to that creditor could be ACME-8G7Q8. * * This prefix is also used for refunds in EUR and GBP. - * */ public String getBankReferencePrefix() { return bankReferencePrefix; @@ -88,41 +89,46 @@ public String getCity() { } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public String getCountryCode() { return countryCode; } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; } /** - * The type of business of the creditor. Currently, `individual`, `company`, `charity`, - * `partnership`, and `trust` are supported. + * The type of business of the creditor. Currently, individual, + * company, charity, partnership, and trust + * are supported. */ public CreditorType getCreditorType() { return creditorType; } /** - * Boolean value indicating whether creditor has the [Custom Payment - * Pages](https://hub.gocardless.com/s/article/Custom-payment-pages) functionality enabled. + * Boolean value indicating whether creditor has the + * Custom Payment Pages + * functionality enabled. */ public Boolean getCustomPaymentPagesEnabled() { return customPaymentPagesEnabled; } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) code for the currency in - * which amounts will be paid out (after foreign exchange). Currently "AUD", "CAD", "DKK", - * "EUR", "GBP", "NZD", "SEK" and "USD" are supported. Present only if payouts will be (or were) - * made via foreign exchange. + * ISO 4217 code for the + * currency in which amounts will be paid out (after foreign exchange). Currently "AUD", "CAD", + * "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. Present only if payouts will be + * (or were) made via foreign exchange. */ public FxPayoutCurrency getFxPayoutCurrency() { return fxPayoutCurrency; @@ -147,8 +153,9 @@ public String getLogoUrl() { } /** - * Boolean value indicating whether creditor has the [Mandate - * Imports](#core-endpoints-mandate-imports) functionality enabled. + * Boolean value indicating whether creditor has the Mandate + * Imports functionality enabled. */ public Boolean getMandateImportsEnabled() { return mandateImportsEnabled; @@ -156,9 +163,10 @@ public Boolean getMandateImportsEnabled() { /** * Boolean value indicating whether the organisation is responsible for sending all customer - * notifications (note this is separate from the functionality described - * [here](/getting-started/api/handling-customer-notifications/)). If you are a partner app, and - * this value is true, you should not send notifications on behalf of this organisation. + * notifications (note this is separate from the functionality described here). + * If you are a partner app, and this value is true, you should not send notifications on behalf + * of this organisation. */ public Boolean getMerchantResponsibleForNotifications() { return merchantResponsibleForNotifications; @@ -188,9 +196,11 @@ public String getRegion() { /** * An array of the scheme identifiers this creditor can create mandates against. * - * The support address, `phone_number` and `email` fields are for customers to contact the - * merchant for support purposes. They must be displayed on the payment page, please see our - * [compliance requirements](#appendix-compliance-requirements) for more details. + * The support address, phone_number and email fields are for + * customers to contact the merchant for support purposes. They must be displayed on the payment + * page, please see our compliance + * requirements for more details. */ public List getSchemeIdentifiers() { return schemeIdentifiers; @@ -198,17 +208,20 @@ public List getSchemeIdentifiers() { /** * The creditor's verification status, indicating whether they can yet receive payouts. For more - * details on handling verification as a partner, see our ["Helping your users get verified" - * guide](/getting-started/partners/helping-your-users-get-verified/). One of: + * details on handling verification as a partner, see our "Helping + * your users get verified" guide. One of: + * *
    - *
  • `successful`: The creditor's account is fully verified, and they can receive payouts. - * Once a creditor has been successfully verified, they may in the future require further - * verification - for example, if they change their payout bank account, we will have to check - * that they own the new bank account before they can receive payouts again.
  • - *
  • `in_review`: The creditor has provided all of the information currently requested, and it - * is awaiting review by GoCardless before they can be verified and receive payouts.
  • - *
  • `action_required`: The creditor needs to provide further information to verify their - * account so they can receive payouts, and should visit the verification flow.
  • + *
  • successful: The creditor's account is fully verified, and they can receive + * payouts. Once a creditor has been successfully verified, they may in the future require + * further verification - for example, if they change their payout bank account, we will have to + * check that they own the new bank account before they can receive payouts again.
  • + *
  • in_review: The creditor has provided all of the information currently + * requested, and it is awaiting review by GoCardless before they can be verified and receive + * payouts.
  • + *
  • action_required: The creditor needs to provide further information to verify + * their account so they can receive payouts, and should visit the verification flow.
  • *
*/ public VerificationStatus getVerificationStatus() { @@ -266,64 +279,72 @@ private Links() { private String defaultUsdPayoutAccount; /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in AUD. + * ID of the bank + * account which is set up to receive payouts in AUD. */ public String getDefaultAudPayoutAccount() { return defaultAudPayoutAccount; } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in CAD. + * ID of the bank + * account which is set up to receive payouts in CAD. */ public String getDefaultCadPayoutAccount() { return defaultCadPayoutAccount; } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in DKK. + * ID of the bank + * account which is set up to receive payouts in DKK. */ public String getDefaultDkkPayoutAccount() { return defaultDkkPayoutAccount; } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in EUR. + * ID of the bank + * account which is set up to receive payouts in EUR. */ public String getDefaultEurPayoutAccount() { return defaultEurPayoutAccount; } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in GBP. + * ID of the bank + * account which is set up to receive payouts in GBP. */ public String getDefaultGbpPayoutAccount() { return defaultGbpPayoutAccount; } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in NZD. + * ID of the bank + * account which is set up to receive payouts in NZD. */ public String getDefaultNzdPayoutAccount() { return defaultNzdPayoutAccount; } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in SEK. + * ID of the bank + * account which is set up to receive payouts in SEK. */ public String getDefaultSekPayoutAccount() { return defaultSekPayoutAccount; } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in USD. + * ID of the bank + * account which is set up to receive payouts in USD. */ public String getDefaultUsdPayoutAccount() { return defaultUsdPayoutAccount; @@ -395,15 +416,18 @@ public String getCity() { } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public String getCountryCode() { return countryCode; } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; @@ -434,8 +458,9 @@ public String getId() { * The minimum interval, in working days, between the sending of a pre-notification to the * customer, and the charge date of a payment using this scheme identifier. * - * By default, GoCardless sends these notifications automatically. Please see our - * [compliance requirements](#appendix-compliance-requirements) for more details. + * By default, GoCardless sends these notifications automatically. Please see our compliance + * requirements for more details. */ public Integer getMinimumAdvanceNotice() { return minimumAdvanceNotice; @@ -485,8 +510,8 @@ public Scheme getScheme() { } /** - * The status of the scheme identifier. Only `active` scheme identifiers will be applied to - * a creditor and used against payments. + * The status of the scheme identifier. Only active scheme identifiers will be + * applied to a creditor and used against payments. */ public Status getStatus() { return status; diff --git a/src/main/java/com/gocardless/resources/CreditorBankAccount.java b/src/main/java/com/gocardless/resources/CreditorBankAccount.java index ff78a649..ad2e4091 100644 --- a/src/main/java/com/gocardless/resources/CreditorBankAccount.java +++ b/src/main/java/com/gocardless/resources/CreditorBankAccount.java @@ -6,13 +6,16 @@ /** * Represents a creditor bank account resource returned from the API. * - * Creditor Bank Accounts hold the bank details of a [creditor](#core-endpoints-creditors). These - * are the bank accounts which your [payouts](#core-endpoints-payouts) will be sent to. + * Creditor Bank Accounts hold the bank details of a + * creditor. + * These are the bank accounts which your + * payouts will + * be sent to. * * Note that creditor bank accounts must be unique, and so you will encounter a - * `bank_account_exists` error if you try to create a duplicate bank account. You may wish to handle - * this by updating the existing record instead, the ID of which will be provided as - * `links[creditor_bank_account]` in the error response. + * bank_account_exists error if you try to create a duplicate bank account. You may + * wish to handle this by updating the existing record instead, the ID of which will be provided as + * links[creditor_bank_account] in the error response. * *

* Restricted: This API is not available for partner integrations. @@ -38,8 +41,9 @@ private CreditorBankAccount() { /** * 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. + * with the linked creditor. This + * field will be transliterated, upcased and truncated to 18 characters. */ public String getAccountHolderName() { return accountHolderName; @@ -55,8 +59,9 @@ public String getAccountNumberEnding() { /** * 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. + * accounts in other currencies. See local + * details for more information. */ public AccountType getAccountType() { return accountType; @@ -70,24 +75,27 @@ public String getBankName() { } /** - * [ISO 3166-1 alpha-2 - * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). - * Defaults to the country code of the `iban` if supplied, otherwise is required. + * ISO + * 3166-1 alpha-2 code. Defaults to the country code of the iban if supplied, + * otherwise is required. */ public String getCountryCode() { return countryCode; } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public String getCurrency() { return currency; @@ -120,7 +128,8 @@ public Map getMetadata() { } /** - * Verification status of the Bank Account. Can be one of `pending`, `in_review` or `successful` + * Verification status of the Bank Account. Can be one of pending, + * in_review or successful */ public VerificationStatus getVerificationStatus() { return verificationStatus; @@ -155,7 +164,9 @@ private Links() { private String creditor; /** - * ID of the [creditor](#core-endpoints-creditors) that owns this bank account. + * ID of the creditor + * that owns this bank account. */ public String getCreditor() { return creditor; diff --git a/src/main/java/com/gocardless/resources/Customer.java b/src/main/java/com/gocardless/resources/Customer.java index cc6d0098..9a10b5d5 100644 --- a/src/main/java/com/gocardless/resources/Customer.java +++ b/src/main/java/com/gocardless/resources/Customer.java @@ -5,9 +5,10 @@ /** * Represents a customer resource returned from the API. * - * Customer objects hold the contact details for a customer. A customer can have several [customer - * bank accounts](#core-endpoints-customer-bank-accounts), which in turn can have several Direct - * Debit [mandates](#core-endpoints-mandates). + * Customer objects hold the contact details for a customer. A customer can have several customer + * bank accounts, which in turn can have several Direct Debit + * mandates. */ public class Customer { private Customer() { @@ -62,25 +63,29 @@ public String getCity() { } /** - * Customer's company name. Required unless a `given_name` and `family_name` are provided. For - * Canadian customers, the use of a `company_name` value will mean that any mandate created from - * this customer will be considered to be a "Business PAD" (otherwise, any mandate will be - * considered to be a "Personal PAD"). + * Customer's company name. Required unless a given_name and + * family_name are provided. For Canadian customers, the use of a + * company_name value will mean that any mandate created from this customer will be + * considered to be a "Business PAD" (otherwise, any mandate will be considered to be a + * "Personal PAD"). */ public String getCompanyName() { return companyName; } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public String getCountryCode() { return countryCode; } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; @@ -103,14 +108,14 @@ public String getEmail() { } /** - * Customer's surname. Required unless a `company_name` is provided. + * Customer's surname. Required unless a company_name is provided. */ public String getFamilyName() { return familyName; } /** - * Customer's first name. Required unless a `company_name` is provided. + * Customer's first name. Required unless a company_name is provided. */ public String getGivenName() { return givenName; @@ -124,11 +129,13 @@ public String getId() { } /** - * [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code. Used as the language - * for notification emails sent by GoCardless if your organisation does not send its own (see - * [compliance requirements](#appendix-compliance-requirements)). Currently only "en", "fr", - * "de", "pt", "es", "it", "nl", "da", "nb", "sl", "sv" are supported. If this is not provided, - * the language will be chosen based on the `country_code` (if supplied) or default to "en". + * ISO 639-1 code. Used as + * the language for notification emails sent by GoCardless if your organisation does not send + * its own (see compliance + * requirements). Currently only "en", "fr", "de", "pt", "es", "it", "nl", "da", "nb", "sl", + * "sv" are supported. If this is not provided, the language will be chosen based on the + * country_code (if supplied) or default to "en". */ public String getLanguage() { return language; @@ -143,8 +150,8 @@ public Map getMetadata() { } /** - * [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone number, including country - * code. + * ITU E.123 formatted phone number, including + * country code. */ public String getPhoneNumber() { return phoneNumber; @@ -159,8 +166,8 @@ public String getPostalCode() { /** * The customer's address region, county or department. For US customers a 2 letter - * [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state code is required (e.g. `CA` - * for California). + * ISO3166-2:US state code is required + * (e.g. CA for California). */ public String getRegion() { return region; diff --git a/src/main/java/com/gocardless/resources/CustomerBankAccount.java b/src/main/java/com/gocardless/resources/CustomerBankAccount.java index f9ae38e3..a5b40c7b 100644 --- a/src/main/java/com/gocardless/resources/CustomerBankAccount.java +++ b/src/main/java/com/gocardless/resources/CustomerBankAccount.java @@ -6,18 +6,21 @@ /** * Represents a customer bank account resource returned from the API. * - * Customer Bank Accounts hold the bank details of a [customer](#core-endpoints-customers). They - * always belong to a [customer](#core-endpoints-customers), and may be linked to several Direct - * Debit [mandates](#core-endpoints-mandates). + * Customer Bank Accounts hold the bank details of a + * customer. + * They always belong to a + * customer, + * and may be linked to several Direct Debit + * mandates. * * Note that customer bank accounts must be unique, and so you will encounter a - * `bank_account_exists` error if you try to create a duplicate bank account. You may wish to handle - * this by updating the existing record instead, the ID of which will be provided as - * `links[customer_bank_account]` in the error response. + * bank_account_exists error if you try to create a duplicate bank account. You may + * wish to handle this by updating the existing record instead, the ID of which will be provided as + * links[customer_bank_account] in the error response. * - * _Note:_ To ensure the customer's bank accounts are valid, verify them first using - * [bank_details_lookups](#bank-details-lookups-perform-a-bank-details-lookup), before proceeding - * with creating the accounts + * Note: To ensure the customer's bank accounts are valid, verify them first using bank_details_lookups, + * before proceeding with creating the accounts */ public class CustomerBankAccount { private CustomerBankAccount() { @@ -36,13 +39,16 @@ private CustomerBankAccount() { private String id; private Links links; private Map metadata; + private PayerNameVerificationResult payerNameVerificationResult; private Boolean trustedRecipient; /** * Name of the account holder, as known by the bank. The full name provided when the customer is * created is stored and is available via the API, but is transliterated, upcased, and truncated * to 18 characters in bank submissions. This field is required unless the request includes a - * [customer bank account token](#javascript-flow-customer-bank-account-tokens). + * customer + * bank account token. */ public String getAccountHolderName() { return accountHolderName; @@ -58,8 +64,9 @@ public String getAccountNumberEnding() { /** * 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. + * accounts in other currencies. See local + * details for more information. */ public AccountType getAccountType() { return accountType; @@ -81,24 +88,27 @@ public String getBankName() { } /** - * [ISO 3166-1 alpha-2 - * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). - * Defaults to the country code of the `iban` if supplied, otherwise is required. + * ISO + * 3166-1 alpha-2 code. Defaults to the country code of the iban if supplied, + * otherwise is required. */ public String getCountryCode() { return countryCode; } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public String getCurrency() { return currency; @@ -130,6 +140,25 @@ public Map getMetadata() { return metadata; } + /** + * The result of the payer name verification check performed when the bank account was created. + * Only present if a check was performed. + * + *

    + *
  • full: The name provided matches the name held by the bank.
  • + *
  • close: The name provided is a close but not exact match to the name held by + * the bank.
  • + *
  • cannot_perform_verification: A verification was attempted but could not be + * completed. This can happen for a number of reasons, including the account holder's bank not + * participating in the verification scheme, the account not being eligible for verification + * (e.g. the account holder has opted out), or the bank details not being resolvable, among + * others.
  • + *
+ */ + public PayerNameVerificationResult getPayerNameVerificationResult() { + return payerNameVerificationResult; + } + /** * Whether this customer bank account is registered as a trusted recipient for Outbound * Payments. Only present when the feature is enabled for the organisation. @@ -145,6 +174,14 @@ public enum AccountType { UNKNOWN } + public enum PayerNameVerificationResult { + @SerializedName("full") + FULL, @SerializedName("close") + CLOSE, @SerializedName("cannot_perform_verification") + CANNOT_PERFORM_VERIFICATION, @SerializedName("unknown") + UNKNOWN + } + /** * Represents a link resource returned from the API. * @@ -158,7 +195,9 @@ private Links() { private String customer; /** - * ID of the [customer](#core-endpoints-customers) that owns this bank account. + * ID of the customer + * that owns this bank account. */ public String getCustomer() { return customer; diff --git a/src/main/java/com/gocardless/resources/CustomerNotification.java b/src/main/java/com/gocardless/resources/CustomerNotification.java index 749e5a0f..61d25a5b 100644 --- a/src/main/java/com/gocardless/resources/CustomerNotification.java +++ b/src/main/java/com/gocardless/resources/CustomerNotification.java @@ -7,7 +7,7 @@ * * Customer Notifications represent the notification which is due to be sent to a customer after an * event has happened. The event, the resource and the customer to be notified are all identified in - * the `links` property. + * the links property. * * Note that these are ephemeral records - once the notification has been actioned in some way, it * is no longer visible using this API. @@ -30,16 +30,17 @@ private CustomerNotification() { private Type type; /** - * The action that was taken on the notification. Currently this can only be `handled`, which - * means the integrator sent the notification themselves. - * + * The action that was taken on the notification. Currently this can only be + * handled, which means the integrator sent the notification themselves. */ public ActionTaken getActionTaken() { return actionTaken; } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this action was taken. + * Fixed timestamp, + * recording when this action was taken. */ public String getActionTakenAt() { return actionTakenAt; @@ -65,15 +66,16 @@ public Links getLinks() { /** * The type of notification the customer shall receive. One of: + * *
    - *
  • `payment_created`
  • - *
  • `payment_cancelled`
  • - *
  • `mandate_created`
  • - *
  • `mandate_blocked`
  • - *
  • `subscription_created`
  • - *
  • `subscription_cancelled`
  • - *
  • `instalment_schedule_created`
  • - *
  • `instalment_schedule_cancelled`
  • + *
  • payment_created
  • + *
  • payment_cancelled
  • + *
  • mandate_created
  • + *
  • mandate_blocked
  • + *
  • subscription_created
  • + *
  • subscription_cancelled
  • + *
  • instalment_schedule_created
  • + *
  • instalment_schedule_cancelled
  • *
*/ public Type getType() { diff --git a/src/main/java/com/gocardless/resources/Event.java b/src/main/java/com/gocardless/resources/Event.java index bba52e8f..ca57d9ef 100644 --- a/src/main/java/com/gocardless/resources/Event.java +++ b/src/main/java/com/gocardless/resources/Event.java @@ -10,8 +10,16 @@ * Events are stored for all webhooks. An event refers to a resource which has been updated, for * example a payment which has been collected, or a mandate which has been transferred. Event * creation is an asynchronous process, so it can take some time between an action occurring and its - * corresponding event getting included in API responses. See [here](#event-types) for a complete + * corresponding event getting included in API responses. See + * here for a complete * list of event types. + * + *

+ * Important: Events older than 18 months will be archived and no longer accessible + * via the API or exports. Archival will begin no sooner than 1 August 2026 in sandbox environments, + * and no sooner than 1 October 2026 in live environments. Events within the 18-month window are + * unaffected. If you need archived data, contact GoCardless support. + *

*/ public class Event { private Event() { @@ -30,14 +38,18 @@ private Event() { private Source source; /** - * What has happened to the resource. See [Event Types](#event-types) for the possible actions. + * What has happened to the resource. See + * Event Types for the + * possible actions. */ public String getAction() { return action; } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; @@ -45,8 +57,9 @@ public String getCreatedAt() { /** * Present only in webhooks when an integrator is authorised to send their own notifications. - * See [here](/getting-started/api/handling-customer-notifications/) for further information. - * + * See here + * for further information. */ public List getCustomerNotifications() { return customerNotifications; @@ -71,9 +84,8 @@ public Links getLinks() { * The metadata that was passed when making the API request that triggered the event (for * instance, cancelling a mandate). * - * This field will only be populated if the `details[origin]` field is `api` otherwise it will - * be an empty object. - * + * This field will only be populated if the details[origin] field is + * api otherwise it will be an empty object. */ public Map getMetadata() { return metadata; @@ -81,9 +93,8 @@ public Map getMetadata() { /** * The metadata of the resource that the event is for. For example, this field will have the - * same value of the `mandate[metadata]` field on the response you would receive from performing - * a GET request on a mandate. - * + * same value of the mandate[metadata] field on the response you would receive from + * performing a GET request on a mandate. */ public Map getResourceMetadata() { return resourceMetadata; @@ -91,20 +102,21 @@ public Map getResourceMetadata() { /** * The resource type for this event. One of: + * *
    - *
  • `billing_requests`
  • - *
  • `creditors`
  • - *
  • `exports`
  • - *
  • `instalment_schedules`
  • - *
  • `mandates`
  • - *
  • `payer_authorisations`
  • - *
  • `payments`
  • - *
  • `payouts`
  • - *
  • `refunds`
  • - *
  • `scheme_identifiers`
  • - *
  • `subscriptions`
  • - *
  • `outbound_payments`
  • - *
  • `payment_account_transactions`
  • + *
  • billing_requests
  • + *
  • creditors
  • + *
  • exports
  • + *
  • instalment_schedules
  • + *
  • mandates
  • + *
  • payer_authorisations
  • + *
  • payments
  • + *
  • payouts
  • + *
  • refunds
  • + *
  • scheme_identifiers
  • + *
  • subscriptions
  • + *
  • outbound_payments
  • + *
  • payment_account_transactions
  • *
*/ public ResourceType getResourceType() { @@ -175,8 +187,9 @@ public Boolean getMandatory() { } /** - * See [here](#core-endpoints-customer-notifications) for a complete list of customer - * notification types. + * See here + * for a complete list of customer notification types. */ public String getType() { return type; @@ -206,32 +219,32 @@ private Details() { private Boolean willAttemptRetry; /** - * When we send a creditor `new_payout_currency_added` webhook, we also send the bank - * account id of the new account + * When we send a creditor new_payout_currency_added webhook, we also send the + * bank account id of the new account */ public String getBankAccountId() { return bankAccountId; } /** - * What triggered the event. _Note:_ `cause` is our simplified and predictable key - * indicating what triggered the event. + * What triggered the event. Note: cause is our simplified and + * predictable key indicating what triggered the event. */ public String getCause() { return cause; } /** - * When we send a creditor `new_payout_currency_added` webhook, we also send the currency of - * the new account + * When we send a creditor new_payout_currency_added webhook, we also send the + * currency of the new account */ public String getCurrency() { return currency; } /** - * Human readable description of the cause. _Note:_ Changes to event descriptions are not - * considered breaking. + * Human readable description of the cause. Note: Changes to event descriptions are + * not considered breaking. */ public String getDescription() { return description; @@ -247,10 +260,12 @@ public Integer getItemCount() { /** * When will_attempt_retry is set to false, this field will contain the reason the payment * was not retried. This can be one of: + * *
    - *
  • `failure_filter_applied`: The payment won't be intelligently retried as there is a - * high likelihood of failure on retry.
  • - *
  • `other`: The payment won't be intelligently retried due to any other reason.
  • + *
  • failure_filter_applied: The payment won't be intelligently retried as + * there is a high likelihood of failure on retry.
  • + *
  • other: The payment won't be intelligently retried due to any other + * reason.
  • *
*/ public String getNotRetriedReason() { @@ -259,12 +274,13 @@ public String getNotRetriedReason() { /** * Who initiated the event. One of: + * *
    - *
  • `bank`: this event was triggered by a report from the banks
  • - *
  • `gocardless`: this event was performed by GoCardless automatically
  • - *
  • `api`: this event was triggered by an API endpoint
  • - *
  • `customer`: this event was triggered by a Customer
  • - *
  • `payer`: this event was triggered by a Payer
  • + *
  • bank: this event was triggered by a report from the banks
  • + *
  • gocardless: this event was performed by GoCardless automatically
  • + *
  • api: this event was triggered by an API endpoint
  • + *
  • customer: this event was triggered by a Customer
  • + *
  • payer: this event was triggered by a Payer
  • *
*/ public Origin getOrigin() { @@ -272,19 +288,20 @@ public Origin getOrigin() { } /** - * When we send a creditor `creditor_updated` webhook, this tells you which property on the - * creditor has been updated + * When we send a creditor creditor_updated webhook, this tells you which + * property on the creditor has been updated */ public String getProperty() { return property; } /** - * Set when a `bank` is the origin of the event. This is the reason code received in the - * report from the customer's bank. See the [GoCardless Direct Debit - * guide](https://gocardless.com/direct-debit/receiving-messages) for information on the - * meanings of different reason codes. _Note:_ `reason_code` is payment scheme-specific and - * can be inconsistent between banks. + * Set when a bank is the origin of the event. This is the reason code received + * in the report from the customer's bank. See the + * GoCardless Direct Debit + * guide for information on the meanings of different reason codes. Note: + * reason_code is payment scheme-specific and can be inconsistent between + * banks. */ public String getReasonCode() { return reasonCode; @@ -367,59 +384,72 @@ private Links() { private String subscription; /** - * ID of a [bank authorisation](#billing-requests-bank-authorisations). + * ID of a bank + * authorisation. */ public String getBankAuthorisation() { return bankAuthorisation; } /** - * ID of a [billing request](#billing-requests-billing-requests). + * ID of a billing + * request. */ public String getBillingRequest() { return billingRequest; } /** - * ID of a [billing request flow](#billing-requests-billing-request-flows). + * ID of a billing + * request flow. */ public String getBillingRequestFlow() { return billingRequestFlow; } /** - * If `resource_type` is `creditor`, this is the ID of the - * [creditor](#core-endpoints-creditors) which has been updated. + * If resource_type is creditor, this is the ID of the creditor + * which has been updated. */ public String getCreditor() { return creditor; } /** - * ID of a [customer](#core-endpoints-customers). + * ID of a customer. */ public String getCustomer() { return customer; } /** - * ID of a [customer bank account](#core-endpoints-customer-bank-accounts). + * ID of a customer + * bank account. */ public String getCustomerBankAccount() { return customerBankAccount; } /** - * If `resource_type` is `instalment_schedule`, this is the ID of the [instalment - * schedule](#core-endpoints-instalment-schedules) which has been updated. + * If resource_type is instalment_schedule, this is the ID of the + * instalment + * schedule which has been updated. */ public String getInstalmentSchedule() { return instalmentSchedule; } /** - * If `resource_type` is `mandates`, this is the ID of the - * [mandate](#core-endpoints-mandates) which has been updated. + * If resource_type is mandates, this is the ID of the mandate + * which has been updated. */ public String getMandate() { return mandate; @@ -433,41 +463,46 @@ public String getMandateRequest() { } /** - * If `resource_type` is `billing_requests`, this is the ID of the - * [mandate](#core-endpoints-mandates) which has been created. + * If resource_type is billing_requests, this is the ID of the + * mandate + * which has been created. */ public String getMandateRequestMandate() { return mandateRequestMandate; } /** - * This is only included for mandate transfer events, when it is the ID of the [customer - * bank account](#core-endpoints-customer-bank-accounts) which the mandate is being - * transferred to. + * This is only included for mandate transfer events, when it is the ID of the customer + * bank account which the mandate is being transferred to. */ public String getNewCustomerBankAccount() { return newCustomerBankAccount; } /** - * This is only included for mandate replaced events, when it is the ID of the new - * [mandate](#core-endpoints-mandates) that replaces the existing mandate. + * This is only included for mandate replaced events, when it is the ID of the new mandate + * that replaces the existing mandate. */ public String getNewMandate() { return newMandate; } /** - * If the event is included in a [webhook](#webhooks-overview) to an [OAuth - * app](#appendix-oauth), this is the ID of the account to which it belongs. + * If the event is included in a + * webhook + * to an OAuth + * app, this is the ID of the account to which it belongs. */ public String getOrganisation() { return organisation; } /** - * If `resource_type` is `outbound_payments`, this is the ID of the outbound_payment which - * has been updated. + * If resource_type is outbound_payments, this is the ID of the + * outbound_payment which has been updated. */ public String getOutboundPayment() { return outboundPayment; @@ -484,72 +519,83 @@ public String getParentEvent() { } /** - * ID of a [payer authorisation](#core-endpoints-payer-authorisations). + * ID of a payer + * authorisation. */ public String getPayerAuthorisation() { return payerAuthorisation; } /** - * If `resource_type` is `payments`, this is the ID of the - * [payment](#core-endpoints-payments) which has been updated. + * If resource_type is payments, this is the ID of the payment + * which has been updated. */ public String getPayment() { return payment; } /** - * If `resource_type` is `payment_account_transaction`, this is the ID of a transaction - * which has been recorded on the payment account. + * If resource_type is payment_account_transaction, this is the ID + * of a transaction which has been recorded on the payment account. */ public String getPaymentAccountTransaction() { return paymentAccountTransaction; } /** - * If `resource_type` is `billing_requests`, this is the ID of the - * [payment](#core-endpoints-payments) which has been created for Pay by Bank. + * If resource_type is billing_requests, this is the ID of the + * payment + * which has been created for Pay by Bank. */ public String getPaymentRequestPayment() { return paymentRequestPayment; } /** - * If `resource_type` is `payouts`, this is the ID of the [payout](#core-endpoints-payouts) - * which has been updated. + * If resource_type is payouts, this is the ID of the payout which + * has been updated. */ public String getPayout() { return payout; } /** - * This is only included for mandate transfer events, when it is the ID of the [customer - * bank account](#core-endpoints-customer-bank-accounts) which the mandate is being - * transferred from. + * This is only included for mandate transfer events, when it is the ID of the customer + * bank account which the mandate is being transferred from. */ public String getPreviousCustomerBankAccount() { return previousCustomerBankAccount; } /** - * If `resource_type` is `refunds`, this is the ID of the [refund](#core-endpoints-refunds) - * which has been updated. + * If resource_type is refunds, this is the ID of the refund which + * has been updated. */ public String getRefund() { return refund; } /** - * If `resource_type` is `scheme_identifiers`, this is the ID of the - * [scheme_identifier](#core-endpoints-scheme-identifiers) which has been updated. + * If resource_type is scheme_identifiers, this is the ID of the + * scheme_identifier + * which has been updated. */ public String getSchemeIdentifier() { return schemeIdentifier; } /** - * If `resource_type` is `subscription`, this is the ID of the - * [subscription](#core-endpoints-subscriptions) which has been updated. + * If resource_type is subscription, this is the ID of the + * subscription + * which has been updated. */ public String getSubscription() { return subscription; diff --git a/src/main/java/com/gocardless/resources/Export.java b/src/main/java/com/gocardless/resources/Export.java index fea0bb16..77418503 100644 --- a/src/main/java/com/gocardless/resources/Export.java +++ b/src/main/java/com/gocardless/resources/Export.java @@ -20,7 +20,9 @@ private Export() { private String id; /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; @@ -85,7 +87,8 @@ public enum ExportType { GC_INVALID_AUTHORISATION_REQUESTS, @SerializedName("partner_fees") PARTNER_FEES, @SerializedName("payments_import_template") PAYMENTS_IMPORT_TEMPLATE, @SerializedName("payment_account_statement") - PAYMENT_ACCOUNT_STATEMENT, @SerializedName("unknown") + PAYMENT_ACCOUNT_STATEMENT, @SerializedName("outbound_payments_index") + OUTBOUND_PAYMENTS_INDEX, @SerializedName("unknown") UNKNOWN } } diff --git a/src/main/java/com/gocardless/resources/InstalmentSchedule.java b/src/main/java/com/gocardless/resources/InstalmentSchedule.java index 9d53f9c1..0673dda3 100644 --- a/src/main/java/com/gocardless/resources/InstalmentSchedule.java +++ b/src/main/java/com/gocardless/resources/InstalmentSchedule.java @@ -8,16 +8,15 @@ * Represents a instalment schedule resource returned from the API. * * 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. + * 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 { private InstalmentSchedule() { @@ -35,15 +34,17 @@ private InstalmentSchedule() { private Integer totalAmount; /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public Currency getCurrency() { return currency; @@ -80,9 +81,9 @@ public String getName() { } /** - * 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. - * + * 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. */ public Map getPaymentErrors() { return paymentErrors; @@ -90,14 +91,15 @@ public Map getPaymentErrors() { /** * 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
  • + *
  • 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
  • *
*/ public Status getStatus() { @@ -152,22 +154,25 @@ private Links() { private List payments; /** - * ID of the associated [customer](#core-endpoints-customers). + * ID of the associated customer. */ public String getCustomer() { return customer; } /** - * ID of the associated [mandate](#core-endpoints-mandates) which the instalment schedule - * will create payments against. + * ID of the associated mandate + * which the instalment schedule will create payments against. */ public String getMandate() { return mandate; } /** - * Array of IDs of the associated [payments](#core-endpoints-payments) + * Array of IDs of the associated payments */ public List getPayments() { return payments; diff --git a/src/main/java/com/gocardless/resources/Institution.java b/src/main/java/com/gocardless/resources/Institution.java index 78c30860..60965687 100644 --- a/src/main/java/com/gocardless/resources/Institution.java +++ b/src/main/java/com/gocardless/resources/Institution.java @@ -1,13 +1,15 @@ package com.gocardless.resources; import com.google.gson.annotations.SerializedName; +import java.util.List; import java.util.Map; /** * Represents a institution resource returned from the API. * - * Institutions that are supported when creating [Bank - * Authorisations](#billing-requests-bank-authorisations) for a particular country or purpose. + * Institutions that are supported when creating Bank + * Authorisations for a particular country or purpose. * * Not all institutions support both Payment Initiation (PIS) and Account Information (AIS) * services. @@ -24,6 +26,7 @@ private Institution() { private Limits limits; private String logoUrl; private String name; + private List roles; private Status status; /** @@ -36,10 +39,10 @@ public Boolean getAutocompletesCollectBankAccount() { } /** - * [ISO - * 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) - * alpha-2 code. The country code of the institution. If nothing is provided, institutions with - * the country code 'GB' are returned by default. + * ISO + * 3166-1 alpha-2 code. The country code of the institution. If nothing is provided, + * institutions with the country code 'GB' are returned by default. */ public String getCountryCode() { return countryCode; @@ -80,6 +83,13 @@ public String getName() { return name; } + /** + * The roles assigned to this institution, representing the open banking features it supports. + */ + public List getRoles() { + return roles; + } + /** * The status of the institution */ diff --git a/src/main/java/com/gocardless/resources/Logo.java b/src/main/java/com/gocardless/resources/Logo.java index 326038b9..32357763 100644 --- a/src/main/java/com/gocardless/resources/Logo.java +++ b/src/main/java/com/gocardless/resources/Logo.java @@ -3,8 +3,9 @@ /** * Represents a logo resource returned from the API. * - * Logos are image uploads that, when associated with a creditor, are shown on the [billing request - * flow](#billing-requests-billing-request-flows) payment pages. + * Logos are image uploads that, when associated with a creditor, are shown on the billing + * request flow payment pages. */ public class Logo { private Logo() { diff --git a/src/main/java/com/gocardless/resources/Mandate.java b/src/main/java/com/gocardless/resources/Mandate.java index 8f53c0cd..79f55f77 100644 --- a/src/main/java/com/gocardless/resources/Mandate.java +++ b/src/main/java/com/gocardless/resources/Mandate.java @@ -6,10 +6,12 @@ /** * Represents a mandate resource returned from the API. * - * Mandates represent the Direct Debit mandate with a [customer](#core-endpoints-customers). + * Mandates represent the Direct Debit mandate with a + * customer. * - * GoCardless will notify you via a [webhook](#appendix-webhooks) whenever the status of a mandate - * changes. + * GoCardless will notify you via a + * webhook whenever + * the status of a mandate changes. */ public class Mandate { private Mandate() { @@ -34,14 +36,13 @@ private Mandate() { private String verifiedAt; /** - * This field is ACH specific, sometimes referred to as [SEC - * code](https://www.moderntreasury.com/learn/sec-codes). + * This field is ACH specific, sometimes referred to as + * SEC code. * * This is the way that the payer gives authorisation to the merchant. web: Authorisation is * Internet Initiated or via Mobile Entry (maps to SEC code: WEB) telephone: Authorisation is * provided orally over telephone (maps to SEC code: TEL) paper: Authorisation is provided in * writing and signed, or similarly authenticated (maps to SEC code: PPD) - * */ public AuthorisationSource getAuthorisationSource() { return authorisationSource; @@ -63,7 +64,9 @@ public ConsentType getConsentType() { } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; @@ -72,10 +75,12 @@ public String getCreatedAt() { /** * This field will decide how GoCardless handles settlement of funds from the customer. * - * - `managed` will be moved through GoCardless' account, batched, and payed out. - `direct` - * will be a direct transfer from the payer's account to the merchant where invoicing will be - * handled separately. - * + *
    + *
  • managed will be moved through GoCardless' account, batched, and payed + * out.
  • + *
  • direct will be a direct transfer from the payer's account to the merchant + * where invoicing will be handled separately.
  • + *
*/ public FundsSettlement getFundsSettlement() { return fundsSettlement; @@ -109,17 +114,17 @@ public Map getMetadata() { } /** - * 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. + * 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. */ public String getNextPossibleChargeDate() { return nextPossibleChargeDate; } /** - * If this is an an ACH mandate, the earliest date that can be used as a `charge_date` on any - * newly created payment to be charged through standard ACH, rather than Faster ACH. This value - * will change over time. + * If this is an an ACH mandate, the earliest date that can be used as a + * charge_date on any newly created payment to be charged through standard ACH, + * rather than Faster ACH. This value will change over time. * * It is only present in the API response for ACH mandates. */ @@ -136,9 +141,10 @@ public Boolean getPaymentsRequireApproval() { } /** - * Unique reference. Different schemes have different length and [character - * set](#appendix-character-sets) requirements. GoCardless will generate a unique reference - * satisfying the different scheme requirements if this field is left blank. + * Unique reference. Different schemes have different length and + * character + * set requirements. GoCardless will generate a unique reference satisfying the different + * scheme requirements if this field is left blank. */ public String getReference() { return reference; @@ -155,20 +161,22 @@ public String getScheme() { /** * One of: + * *
    - *
  • `pending_customer_approval`: the mandate has not yet been signed by the second + *
  • pending_customer_approval: the mandate has not yet been signed by the second * customer
  • - *
  • `pending_submission`: the mandate has not yet been submitted to the customer's bank
  • - *
  • `submitted`: the mandate has been submitted to the customer's bank but has not been - * processed yet
  • - *
  • `active`: the mandate has been successfully set up by the customer's bank
  • - *
  • `suspended_by_payer`: the mandate has been suspended by payer
  • - *
  • `failed`: the mandate could not be created
  • - *
  • `cancelled`: the mandate has been cancelled
  • - *
  • `expired`: the mandate has expired due to dormancy
  • - *
  • `consumed`: the mandate has been consumed and cannot be reused (note that this only - * applies to schemes that are per-payment authorised)
  • - *
  • `blocked`: the mandate has been blocked and payments cannot be created
  • + *
  • pending_submission: the mandate has not yet been submitted to the customer's + * bank
  • + *
  • submitted: the mandate has been submitted to the customer's bank but has not + * been processed yet
  • + *
  • active: the mandate has been successfully set up by the customer's bank
  • + *
  • suspended_by_payer: the mandate has been suspended by payer
  • + *
  • failed: the mandate could not be created
  • + *
  • cancelled: the mandate has been cancelled
  • + *
  • expired: the mandate has expired due to dormancy
  • + *
  • consumed: the mandate has been consumed and cannot be reused (note that this + * only applies to schemes that are per-payment authorised)
  • + *
  • blocked: the mandate has been blocked and payments cannot be created
  • *
*/ public Status getStatus() { @@ -176,7 +184,9 @@ public Status getStatus() { } /** - * [Timestamp](#api-usage-dates-and-times) recording when this mandate was verified. + * Timestamp + * recording when this mandate was verified. */ public String getVerifiedAt() { return verifiedAt; @@ -318,22 +328,25 @@ private Links() { private String newMandate; /** - * ID of the associated [creditor](#core-endpoints-creditors). + * ID of the associated creditor. */ public String getCreditor() { return creditor; } /** - * ID of the associated [customer](#core-endpoints-customers) + * ID of the associated customer */ public String getCustomer() { return customer; } /** - * ID of the associated [customer bank account](#core-endpoints-customer-bank-accounts) - * which the mandate is created and submits payments against. + * ID of the associated customer + * bank account which the mandate is created and submits payments against. */ public String getCustomerBankAccount() { return customerBankAccount; diff --git a/src/main/java/com/gocardless/resources/MandateImport.java b/src/main/java/com/gocardless/resources/MandateImport.java index 502b82f8..038b944e 100644 --- a/src/main/java/com/gocardless/resources/MandateImport.java +++ b/src/main/java/com/gocardless/resources/MandateImport.java @@ -10,27 +10,40 @@ * * The process is as follows: * - * 1. [Create a mandate import](#mandate-imports-create-a-new-mandate-import) 2. [Add - * entries](#mandate-import-entries-add-a-mandate-import-entry) to the import 3. - * [Submit](#mandate-imports-submit-a-mandate-import) the import 4. Wait until a member of the - * GoCardless team approves the import, at which point the mandates will be created 5. [Link up the - * mandates](#mandate-import-entries-list-all-mandate-import-entries) in your system - * + *
    + *
  1. Create + * a mandate import
  2. + *
  3. Add + * entries to the import
  4. + *
  5. Submit + * the import
  6. + *
  7. Wait until a member of the GoCardless team approves the import, at which point the mandates + * will be created
  8. + *
  9. Link + * up the mandates in your system
  10. + *
* When you add entries to your mandate import, they are not turned into actual mandates until the * mandate import is submitted by you via the API, and then processed by a member of the GoCardless * team. When that happens, a mandate will be created for each entry in the import. * - * We will issue a `mandate_created` webhook for each entry, which will be the same as the webhooks - * triggered when [ creating a mandate ](#mandates-create-a-mandate) using the mandates API. Once - * these webhooks start arriving, any reconciliation can now be accomplished by [checking the - * current status](#mandate-imports-get-a-mandate-import) of the mandate import and [linking up the - * mandates to your system](#mandate-import-entries-list-all-mandate-import-entries). + * We will issue a mandate_created webhook for each entry, which will be the same as + * the webhooks triggered when + * creating a + * mandate using the mandates API. Once these webhooks start arriving, any reconciliation can + * now be accomplished by checking + * the current status of the mandate import and linking + * up the mandates to your system. * *

* Note that all Mandate Imports have an upper limit of 30,000 entries, so we recommend you split * your import into several smaller imports if you're planning to exceed this threshold. *

- * *

* Restricted: This API is currently only available for approved integrators - * please get in touch if you would like to use this API. @@ -48,7 +61,9 @@ private MandateImport() { private Status status; /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; @@ -70,6 +85,7 @@ public Links getLinks() { /** * The scheme of the mandates to be imported.
+ *
* All mandates in a single mandate import must be for the same scheme. */ public Scheme getScheme() { @@ -78,15 +94,18 @@ public Scheme getScheme() { /** * The status of the mandate import. + * *

    - *
  • `created`: A new mandate import.
  • - *
  • `submitted`: After the integrator has finished adding mandates and - * submitted the import.
  • - *
  • `cancelled`: If the integrator - * cancelled the mandate import.
  • - *
  • `processing`: Once a mandate import has been approved by a GoCardless team member it will - * be in this state while mandates are imported.
  • - *
  • `processed`: When all mandates have been imported successfully.
  • + *
  • created: A new mandate import.
  • + *
  • submitted: After the integrator has finished adding mandates and submitted + * the import.
  • + *
  • cancelled: If the integrator cancelled + * the mandate import.
  • + *
  • processing: Once a mandate import has been approved by a GoCardless team + * member it will be in this state while mandates are imported.
  • + *
  • processed: When all mandates have been imported successfully.
  • *
*/ public Status getStatus() { diff --git a/src/main/java/com/gocardless/resources/MandateImportEntry.java b/src/main/java/com/gocardless/resources/MandateImportEntry.java index b9557672..32156a6a 100644 --- a/src/main/java/com/gocardless/resources/MandateImportEntry.java +++ b/src/main/java/com/gocardless/resources/MandateImportEntry.java @@ -5,23 +5,26 @@ /** * Represents a mandate import entry resource returned from the API. * - * Mandate Import Entries are added to a [Mandate Import](#core-endpoints-mandate-imports). Each - * entry corresponds to one mandate to be imported into GoCardless. + * Mandate Import Entries are added to a + * Mandate + * Import. Each entry corresponds to one mandate to be imported into GoCardless. * * To import a mandate you will need: + * *
    *
  1. Identifying information about the customer (name/company and address)
  2. *
  3. Bank account details, consisting of an account holder name and either an IBAN or - * local bank details
  4. + * local bank + * details *
  5. Amendment details (SEPA only)
  6. *
- * - * We suggest you provide a `record_identifier` (which is unique within the context of a single - * mandate import) to help you to identify mandates that have been created once the import has been - * processed by GoCardless. You can [list the mandate import - * entries](#mandate-import-entries-list-all-mandate-import-entries), match them up in your system - * using the `record_identifier`, and look at the `links` fields to find the mandate, customer and - * customer bank account that have been imported. + * We suggest you provide a record_identifier (which is unique within the context of a + * single mandate import) to help you to identify mandates that have been created once the import + * has been processed by GoCardless. You can list + * the mandate import entries, match them up in your system using the + * record_identifier, and look at the links fields to find the mandate, + * customer and customer bank account that have been imported. * *

* Restricted: This API is currently only available for approved integrators - @@ -39,7 +42,9 @@ private MandateImportEntry() { private String recordIdentifier; /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; @@ -62,7 +67,6 @@ public Map getProcessingErrors() { /** * A unique identifier for this entry, which you can use (once the import has been processed by * GoCardless) to identify the records that have been created. Limited to 255 characters. - * */ public String getRecordIdentifier() { return recordIdentifier; @@ -106,9 +110,9 @@ public String getMandate() { } /** - * The ID of the mandate import. This is returned when you [create a Mandate - * Import](#mandate-imports-create-a-new-mandate-import). - * + * The ID of the mandate import. This is returned when you create + * a Mandate Import. */ public String getMandateImport() { return mandateImport; diff --git a/src/main/java/com/gocardless/resources/MandatePdf.java b/src/main/java/com/gocardless/resources/MandatePdf.java index 979b6ad9..4ec8d812 100644 --- a/src/main/java/com/gocardless/resources/MandatePdf.java +++ b/src/main/java/com/gocardless/resources/MandatePdf.java @@ -3,8 +3,9 @@ /** * Represents a mandate pdf resource returned from the API. * - * Mandate PDFs allow you to easily display [scheme-rules - * compliant](#appendix-compliance-requirements) Direct Debit mandates to your customers. + * Mandate PDFs allow you to easily display scheme-rules + * compliant Direct Debit mandates to your customers. */ public class MandatePdf { private MandatePdf() { @@ -15,7 +16,8 @@ private MandatePdf() { private String url; /** - * The date and time at which the `url` will expire (10 minutes after the original request). + * The date and time at which the url will expire (10 minutes after the original + * request). */ public String getExpiresAt() { return expiresAt; @@ -23,8 +25,8 @@ public String getExpiresAt() { /** * The URL at which this mandate PDF can be viewed until it expires at the date and time - * specified by `expires_at`. You should not store this URL or rely on its structure remaining - * the same. + * specified by expires_at. You should not store this URL or rely on its structure + * remaining the same. */ public String getUrl() { return url; diff --git a/src/main/java/com/gocardless/resources/NegativeBalanceLimit.java b/src/main/java/com/gocardless/resources/NegativeBalanceLimit.java index cdf490ce..1f218606 100644 --- a/src/main/java/com/gocardless/resources/NegativeBalanceLimit.java +++ b/src/main/java/com/gocardless/resources/NegativeBalanceLimit.java @@ -8,7 +8,6 @@ * The negative balance limit is a threshold for the creditor balance beyond which refunds are not * permitted. The default limit is zero — refunds are not permitted if the creditor has a negative * balance. The limit can be changed on a per-creditor basis. - * */ public class NegativeBalanceLimit { private NegativeBalanceLimit() { @@ -29,15 +28,17 @@ public Integer getBalanceLimit() { } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this limit was created. + * Fixed timestamp, + * recording when this limit was created. */ public String getCreatedAt() { return createdAt; } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public Currency getCurrency() { return currency; @@ -88,7 +89,9 @@ public String getCreatorUser() { } /** - * ID of [creditor](#core-endpoints-creditors) which this limit relates to + * ID of creditor + * which this limit relates to */ public String getCreditor() { return creditor; diff --git a/src/main/java/com/gocardless/resources/OutboundPayment.java b/src/main/java/com/gocardless/resources/OutboundPayment.java index 0be6d4c9..9d680c17 100644 --- a/src/main/java/com/gocardless/resources/OutboundPayment.java +++ b/src/main/java/com/gocardless/resources/OutboundPayment.java @@ -6,18 +6,23 @@ /** * Represents a outbound payment resource returned from the API. * - * Outbound Payments represent payments sent from [creditors](#core-endpoints-creditors). + * Outbound Payments represent payments sent from + * creditors. * - * GoCardless will notify you via a [webhook](#appendix-webhooks) when the status of the outbound - * payment [changes](#event-types-outbound-payment). + * GoCardless will notify you via a + * webhook when the + * status of the outbound payment changes. * - * ####Rate limiting + *

Rate limiting

Two rate limits apply to the Outbound Payments APIs: * - * Two rate limits apply to the Outbound Payments APIs: - All POST Outbound Payment endpoints - * (create, withdraw, approve, cancel and etc.) share a single rate-limit group of 300 requests per - * minute. As initiating a payment typically requires two API calls (one to create the payment and - * one to approve it), this allows you to add approximately 150 outbound payments per minute. - All - * remaining Outbound Payment endpoints are limited to 500 requests per minute. + *
    + *
  • All POST Outbound Payment endpoints (create, withdraw, approve, cancel and etc.) share a + * single rate-limit group of 300 requests per minute. As initiating a payment typically requires + * two API calls (one to create the payment and one to approve it), this allows you to add + * approximately 150 outbound payments per minute.
  • + *
  • All remaining Outbound Payment endpoints are limited to 500 requests per minute.
  • + *
*/ public class OutboundPayment { private OutboundPayment() { @@ -46,16 +51,17 @@ public Integer getAmount() { } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when the outbound payment was - * created. + * Fixed timestamp, + * recording when the outbound payment was created. */ public String getCreatedAt() { return createdAt; } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency. Currently only - * "GBP" is supported. + * ISO 4217 currency. + * Currently only "GBP" is supported. */ public Currency getCurrency() { return currency; @@ -105,9 +111,15 @@ public Map getMetadata() { /** * An optional reference that will appear on your customer's bank statement. The character limit - * for this reference is dependent on the scheme.
- * Faster Payments - 18 characters, including: - * "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 &-./"
+ * for this reference is dependent on the scheme.
+ *
+ * Faster Payments + *
    + *
  • 18 characters, including: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 + * &-./"
  • + *
+ *
+ *
*/ public String getReference() { return reference; @@ -123,23 +135,26 @@ public Scheme getScheme() { /** * One of: + * *
    - *
  • `verifying`: The payment has been - * [created](#outbound-payments-create-an-outbound-payment) and the verification process has - * begun.
  • - *
  • `pending_approval`: The payment is awaiting - * [approval](#outbound-payments-approve-an-outbound-payment).
  • - *
  • `scheduled`: The payment has passed verification & - * [approval](#outbound-payments-approve-an-outbound-payment), but processing has not yet - * begun.
  • - *
  • `executing`: The execution date has arrived and the payment has been placed in queue for - * processing.
  • - *
  • `executed`: The payment has been accepted by the scheme and is now on its way to the - * recipient.
  • - *
  • `cancelled`: The payment has been - * [cancelled](#outbound-payments-cancel-an-outbound-payment) or was not - * [approved](#outbound-payments-approve-an-outbound-payment) on time.
  • - *
  • `failed`: The payment was not sent, usually due to an error while or after + *
  • verifying: The payment has been created + * and the verification process has begun.
  • + *
  • pending_approval: The payment is awaiting approval.
  • + *
  • scheduled: The payment has passed verification & approval, + * but processing has not yet begun.
  • + *
  • executing: The execution date has arrived and the payment has been placed in + * queue for processing.
  • + *
  • executed: The payment has been accepted by the scheme and is now on its way + * to the recipient.
  • + *
  • cancelled: The payment has been cancelled + * or was not approved + * on time.
  • + *
  • failed: The payment was not sent, usually due to an error while or after * executing.
  • *
*/ @@ -201,7 +216,9 @@ public String getCreditor() { } /** - * ID of the [customer](#core-endpoints-customers) that receives this outbound payment + * ID of the customer + * that receives this outbound payment */ public String getCustomer() { return customer; @@ -265,15 +282,16 @@ public String getActualAccountName() { /** * Result of the verification, could be one of + * *
    - *
  • `full_match`: The verification has confirmed that the account name exactly - * matches the details provided.
  • - *
  • `partial_match`: The verification has confirmed that the account name is similar - * but does not match to the details provided.
  • - *
  • `no_match`: The verification concludes the provided name does not match the - * account details.
  • - *
  • `unable_to_match`: The verification could not be performed due to recipient bank - * issues or technical issues
  • + *
  • full_match: The verification has confirmed that the account name + * exactly matches the details provided.
  • + *
  • partial_match: The verification has confirmed that the account name + * is similar but does not match to the details provided.
  • + *
  • no_match: The verification concludes the provided name does not + * match the account details.
  • + *
  • unable_to_match: The verification could not be performed due to + * recipient bank issues or technical issues
  • *
*/ public Result getResult() { @@ -281,8 +299,9 @@ public Result getResult() { } /** - * Type of the verification that has been performed eg. [Confirmation of - * Payee](https://www.wearepay.uk/what-we-do/overlay-services/confirmation-of-payee/) + * Type of the verification that has been performed eg. Confirmation + * of Payee */ public Type getType() { return type; diff --git a/src/main/java/com/gocardless/resources/OutboundPaymentImport.java b/src/main/java/com/gocardless/resources/OutboundPaymentImport.java index c7303747..2a175ca5 100644 --- a/src/main/java/com/gocardless/resources/OutboundPaymentImport.java +++ b/src/main/java/com/gocardless/resources/OutboundPaymentImport.java @@ -7,10 +7,15 @@ * * Outbound Payment Imports allow you to create multiple payments via a single API call. * - * The Workflow: 1. Create the outbound payment import. 2. Retrieve an authorisation link from the - * response. 3. Redirect the user to the link to authorise the import. 4. Once the user authorises - * the import, the individual outbound payments are automatically submitted. + * The Workflow: * + *
    + *
  1. Create the outbound payment import.
  2. + *
  3. Retrieve an authorisation link from the response.
  4. + *
  5. Redirect the user to the link to authorise the import.
  6. + *
  7. Once the user authorises the import, the individual outbound payments are automatically + * submitted.
  8. + *
* Import entries are not processed as actual payments until they are reviewed and authorised in * GoCardless Dashboard. Upon approval, a unique outbound payment is generated for every entry in * the import. @@ -50,15 +55,17 @@ public String getAuthorisationUrl() { } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency. Currently only - * "GBP" is supported. + * ISO 4217 currency. + * Currently only "GBP" is supported. */ public Currency getCurrency() { return currency; @@ -81,15 +88,17 @@ public Links getLinks() { /** * The status of the outbound payment import. + * *
    - *
  • `created`: The initial state of a new import.
  • - *
  • `validating`: Import validation in progress.
  • - *
  • `invalid`: Import validation failed.
  • - *
  • `valid`: Import validation succeeded.
  • - *
  • `processing`: Authorisation received; payments are being generated.
  • - *
  • `processed`: All entries have been successfully converted into outbound payments.
  • - *
  • `cancelled`: The import was cancelled by a user or automatically expired by the - * system.
  • + *
  • created: The initial state of a new import.
  • + *
  • validating: Import validation in progress.
  • + *
  • invalid: Import validation failed.
  • + *
  • valid: Import validation succeeded.
  • + *
  • processing: Authorisation received; payments are being generated.
  • + *
  • processed: All entries have been successfully converted into outbound + * payments.
  • + *
  • cancelled: The import was cancelled by a user or automatically expired by + * the system.
  • *
*/ public Status getStatus() { diff --git a/src/main/java/com/gocardless/resources/OutboundPaymentImportEntry.java b/src/main/java/com/gocardless/resources/OutboundPaymentImportEntry.java index f82c6950..b9d71c55 100644 --- a/src/main/java/com/gocardless/resources/OutboundPaymentImportEntry.java +++ b/src/main/java/com/gocardless/resources/OutboundPaymentImportEntry.java @@ -34,7 +34,9 @@ public Integer getAmount() { } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; @@ -60,7 +62,9 @@ public Map getMetadata() { } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this entry was processed. + * Fixed timestamp, + * recording when this entry was processed. */ public String getProcessedAt() { return processedAt; diff --git a/src/main/java/com/gocardless/resources/PayerAuthorisation.java b/src/main/java/com/gocardless/resources/PayerAuthorisation.java index 2f18baf6..1f0c5c59 100644 --- a/src/main/java/com/gocardless/resources/PayerAuthorisation.java +++ b/src/main/java/com/gocardless/resources/PayerAuthorisation.java @@ -12,40 +12,46 @@ * Billing * Requests. Use Billing Requests to build any future integrations. *

- * * Payer Authorisation resource acts as a wrapper for creating customer, bank account and mandate * details in a single request. PayerAuthorisation API enables the integrators to build their own * custom payment pages. * * The process to use the Payer Authorisation API is as follows: * - * 1. Create a Payer Authorisation, either empty or with already available information 2. Update the - * authorisation with additional information or fix any mistakes 3. Submit the authorisation, after - * the payer has reviewed their information 4. [coming soon] Redirect the payer to the verification - * mechanisms from the response of the Submit request (this will be introduced as a non-breaking - * change) 5. Confirm the authorisation to indicate that the resources can be created - * + *
    + *
  1. Create a Payer Authorisation, either empty or with already available information
  2. + *
  3. Update the authorisation with additional information or fix any mistakes
  4. + *
  5. Submit the authorisation, after the payer has reviewed their information
  6. + *
  7. [coming soon] Redirect the payer to the verification mechanisms from the response of the + * Submit request (this will be introduced as a non-breaking change)
  8. + *
  9. Confirm the authorisation to indicate that the resources can be created
  10. + *
* After the Payer Authorisation is confirmed, resources will eventually be created as it's an * asynchronous process. * * To retrieve the status and ID of the linked resources you can do one of the following: + * *
    - *
  1. Listen to payer_authorisation_completed - * webhook (recommended)
  2. - *
  3. Poll the GET + *
  4. Listen to payer_authorisation_completed + * webhook + * (recommended)
  5. + *
  6. Poll the GET * endpoint
  7. *
  8. Poll the GET events API - * https://api.gocardless.com/events?payer_authorisation={id}&action=completed
  9. + * https://api.gocardless.com/events?payer_authorisation={id}&action=completed *
- * *

- * Note that the `create` and `update` endpoints behave differently than other existing `create` and - * `update` endpoints. The Payer Authorisation is still saved if incomplete data is provided. We - * return the list of incomplete data in the `incomplete_fields` along with the resources in the - * body of the response. The bank account details(account_number, bank_code & branch_code) must be - * sent together rather than splitting across different request for both `create` and `update` + * Note that the create and update endpoints behave differently than other + * existing create and update endpoints. The Payer Authorisation is still + * saved if incomplete data is provided. We return the list of incomplete data in the + * incomplete_fields along with the resources in the body of the response. The bank + * account details(account_number, bank_code & branch_code) must be sent together rather than + * splitting across different request for both create and update * endpoints.
+ *
*
+ *
* The API is designed to be flexible and allows you to collect information in multiple steps * without storing any sensitive data in the browser or in your servers. *

@@ -65,22 +71,26 @@ private PayerAuthorisation() { private Status status; /** - * All details required for the creation of a [Customer Bank - * Account](#core-endpoints-customer-bank-accounts). + * All details required for the creation of a Customer + * Bank Account. */ public BankAccount getBankAccount() { return bankAccount; } /** - * [Timestamp](#api-usage-dates-and-times), recording when this Payer Authorisation was created. + * Timestamp, + * recording when this Payer Authorisation was created. */ public String getCreatedAt() { return createdAt; } /** - * All details required for the creation of a [Customer](#core-endpoints-customers). + * All details required for the creation of a Customer. */ public Customer getCustomer() { return customer; @@ -108,7 +118,8 @@ public Links getLinks() { } /** - * All details required for the creation of a [Mandate](#core-endpoints-mandates). + * All details required for the creation of a Mandate. */ public Mandate getMandate() { return mandate; @@ -116,14 +127,17 @@ public Mandate getMandate() { /** * One of: + * *
    - *
  • `created`: The PayerAuthorisation has been created, and not been confirmed yet
  • - *
  • `submitted`: The payer information has been submitted
  • - *
  • `confirmed`: PayerAuthorisation is confirmed and resources are ready to be created
  • - *
  • `completed`: The PayerAuthorisation has been completed and customer, bank_account and - * mandate has been created
  • - *
  • `failed`: The PayerAuthorisation has failed and customer, bank_account and mandate is not + *
  • created: The PayerAuthorisation has been created, and not been confirmed + * yet
  • + *
  • submitted: The payer information has been submitted
  • + *
  • confirmed: PayerAuthorisation is confirmed and resources are ready to be * created
  • + *
  • completed: The PayerAuthorisation has been completed and customer, + * bank_account and mandate has been created
  • + *
  • failed: The PayerAuthorisation has failed and customer, bank_account and + * mandate is not created
  • *
*/ public Status getStatus() { @@ -143,8 +157,9 @@ public enum Status { /** * Represents a bank account resource returned from the API. * - * All details required for the creation of a [Customer Bank - * Account](#core-endpoints-customer-bank-accounts). + * All details required for the creation of a Customer + * Bank Account. */ public static class BankAccount { private BankAccount() { @@ -167,16 +182,18 @@ private BankAccount() { * Name of the account holder, as known by the bank. The full name provided when the * customer is created is stored and is available via the API, but is transliterated, * upcased, and truncated to 18 characters in bank submissions. This field is required - * unless the request includes a [customer bank account - * token](#javascript-flow-customer-bank-account-tokens). + * unless the request includes a customer + * bank account token. */ public String getAccountHolderName() { return accountHolderName; } /** - * Bank account number - see [local details](#appendix-local-bank-details) for more - * information. Alternatively you can provide an `iban`. + * Bank account number - see local + * details for more information. Alternatively you can provide an iban. */ public String getAccountNumber() { return accountNumber; @@ -191,8 +208,9 @@ public String getAccountNumberEnding() { } /** - * Account number suffix (only for bank accounts denominated in NZD) - see [local - * details](#local-bank-details-new-zealand) for more information. + * Account number suffix (only for bank accounts denominated in NZD) - see local + * details for more information. */ public String getAccountNumberSuffix() { return accountNumberSuffix; @@ -200,50 +218,57 @@ public String getAccountNumberSuffix() { /** * 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. + * bank accounts in other currencies. See local + * details for more information. */ public AccountType getAccountType() { return accountType; } /** - * Bank code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Bank code - see local + * details for more information. Alternatively you can provide an iban. */ public String getBankCode() { return bankCode; } /** - * Branch code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Branch code - see local + * details for more information. Alternatively you can provide an iban. */ public String getBranchCode() { return branchCode; } /** - * [ISO 3166-1 alpha-2 - * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). - * Defaults to the country code of the `iban` if supplied, otherwise is required. + * ISO + * 3166-1 alpha-2 code. Defaults to the country code of the iban if + * supplied, otherwise is required. */ public String getCountryCode() { return countryCode; } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public String getCurrency() { return currency; } /** - * International Bank Account Number. Alternatively you can provide [local - * details](#appendix-local-bank-details). IBANs are not accepted for Swedish bank accounts - * denominated in SEK - you must supply [local details](#local-bank-details-sweden). + * International Bank Account Number. Alternatively you can provide local + * details. IBANs are not accepted for Swedish bank accounts denominated in SEK - you + * must supply + * local + * details. */ public String getIban() { return iban; @@ -268,7 +293,8 @@ public enum AccountType { /** * Represents a customer resource returned from the API. * - * All details required for the creation of a [Customer](#core-endpoints-customers). + * All details required for the creation of a Customer. */ public static class Customer { private Customer() { @@ -320,18 +346,20 @@ public String getCity() { } /** - * Customer's company name. Required unless a `given_name` and `family_name` are provided. - * For Canadian customers, the use of a `company_name` value will mean that any mandate - * created from this customer will be considered to be a "Business PAD" (otherwise, any - * mandate will be considered to be a "Personal PAD"). + * Customer's company name. Required unless a given_name and + * family_name are provided. For Canadian customers, the use of a + * company_name value will mean that any mandate created from this customer + * will be considered to be a "Business PAD" (otherwise, any mandate will be considered to + * be a "Personal PAD"). */ public String getCompanyName() { return companyName; } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public String getCountryCode() { return countryCode; @@ -354,23 +382,22 @@ public String getEmail() { } /** - * Customer's surname. Required unless a `company_name` is provided. + * Customer's surname. Required unless a company_name is provided. */ public String getFamilyName() { return familyName; } /** - * Customer's first name. Required unless a `company_name` is provided. + * Customer's first name. Required unless a company_name is provided. */ public String getGivenName() { return givenName; } /** - * An [IETF Language Tag](https://tools.ietf.org/html/rfc5646), used for both language and - * regional variations of our product. - * + * An IETF Language Tag, used for both + * language and regional variations of our product. */ public String getLocale() { return locale; @@ -393,8 +420,8 @@ public String getPostalCode() { /** * The customer's address region, county or department. For US customers a 2 letter - * [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state code is required (e.g. - * `CA` for California). + * ISO3166-2:US state code is + * required (e.g. CA for California). */ public String getRegion() { return region; @@ -486,7 +513,8 @@ public String getMandate() { /** * Represents a mandate resource returned from the API. * - * All details required for the creation of a [Mandate](#core-endpoints-mandates). + * All details required for the creation of a Mandate. */ public static class Mandate { private Mandate() { @@ -511,18 +539,18 @@ public Map getMetadata() { * the payer to whom the mandate belongs (i.e. as a result of their completion of a mandate * setup flow in their browser). * - * Not required for creating offline mandates where `authorisation_source` is set to - * telephone or paper. - * + * Not required for creating offline mandates where authorisation_source is set + * to telephone or paper. */ public String getPayerIpAddress() { return payerIpAddress; } /** - * Unique reference. Different schemes have different length and [character - * set](#appendix-character-sets) requirements. GoCardless will generate a unique reference - * satisfying the different scheme requirements if this field is left blank. + * Unique reference. Different schemes have different length and character + * set requirements. GoCardless will generate a unique reference satisfying the + * different scheme requirements if this field is left blank. */ public String getReference() { return reference; diff --git a/src/main/java/com/gocardless/resources/Payment.java b/src/main/java/com/gocardless/resources/Payment.java index dc9ea978..6979116c 100644 --- a/src/main/java/com/gocardless/resources/Payment.java +++ b/src/main/java/com/gocardless/resources/Payment.java @@ -6,12 +6,16 @@ /** * Represents a payment resource returned from the API. * - * Payment objects represent payments from a [customer](#core-endpoints-customers) to a - * [creditor](#core-endpoints-creditors), taken against a Direct Debit - * [mandate](#core-endpoints-mandates). + * Payment objects represent payments from a + * customer + * to a + * creditor, + * taken against a Direct Debit + * mandate. * - * GoCardless will notify you via a [webhook](#appendix-webhooks) whenever the state of a payment - * changes. + * GoCardless will notify you via a + * webhook whenever + * the state of a payment changes. */ public class Payment { private Payment() { @@ -36,14 +40,22 @@ private Payment() { /** * Amount, in the lowest denomination for the currency (e.g. pence in GBP, cents in EUR). + * + * Minimum and maximum amounts vary by payment scheme. For more information, see Transaction + * limits + * + * For Variable Recurring Payments (VRP), this must not exceed the mandate's + * max_amount_per_payment constraint. */ public Integer getAmount() { return amount; } /** - * Amount [refunded](#core-endpoints-refunds), in the lowest denomination for the currency (e.g. - * pence in GBP, cents in EUR). + * Amount refunded, in the + * lowest denomination for the currency (e.g. pence in GBP, cents in EUR). */ public Integer getAmountRefunded() { return amountRefunded; @@ -51,24 +63,27 @@ public Integer getAmountRefunded() { /** * A future date on which the payment should be collected. If not specified, the payment will be - * collected as soon as possible. If the value is before the - * [mandate](#core-endpoints-mandates)'s `next_possible_charge_date` creation will fail. If the - * value is not a working day it will be rolled forwards to the next available one. + * collected as soon as possible. If the value is before the mandate's + * next_possible_charge_date creation will fail. If the value is not a working day + * it will be rolled forwards to the next available one. */ public String getChargeDate() { return chargeDate; } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public Currency getCurrency() { return currency; @@ -77,7 +92,9 @@ public Currency getCurrency() { /** * A human-readable description of the payment. This will be included in the notification email * GoCardless sends to your customer if your organisation does not send its own notifications - * (see [compliance requirements](#appendix-compliance-requirements)). + * (see compliance + * requirements). */ public String getDescription() { return description; @@ -117,25 +134,76 @@ public Map getMetadata() { /** * 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
- * Faster Payments - 18 characters
- * PAD - scheme doesn't offer references
- * PayTo - 18 characters
- * SEPA - 140 characters
+ * 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
  • + *
+ *
+ *
+ * Faster Payments + *
    + *
  • 18 characters
  • + *
+ *
+ *
+ * PAD + *
    + *
  • scheme doesn't offer references
  • + *
+ *
+ *
+ * PayTo + *
    + *
  • 18 characters
  • + *
+ *
+ *
+ * SEPA + *
    + *
  • 140 characters
  • + *
+ *
+ *
* Note that this reference must be unique (for each merchant) for the BECS scheme as it is a * scheme requirement. - *

+ *

* 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. + * GoCardless Plus, Pro or Enterprise packages. *

- *

+ *

* Restricted: You can not specify a payment reference for Faster Payments. *

*/ @@ -144,11 +212,12 @@ public String getReference() { } /** - * On failure, automatically retry the payment using [intelligent - * retries](/success-plus/overview). Default is `false`. + * On failure, automatically retry the payment using + * intelligent retries. + * Default is false. *

* Important: To be able to use intelligent retries, Success+ needs to be - * enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus). + * enabled in GoCardless dashboard. *

*/ public Boolean getRetryIfPossible() { @@ -166,19 +235,22 @@ public String getScheme() { /** * One of: + * *
    - *
  • `pending_customer_approval`: we're waiting for the customer to approve this payment
  • - *
  • `pending_submission`: the payment has been created, but not yet submitted to the - * banks
  • - *
  • `submitted`: the payment has been submitted to the banks
  • - *
  • `confirmed`: the payment has been confirmed as collected
  • - *
  • `paid_out`: the payment has been included in a [payout](#core-endpoints-payouts)
  • - *
  • `cancelled`: the payment has been cancelled
  • - *
  • `customer_approval_denied`: the customer has denied approval for the payment. You should - * contact the customer directly
  • - *
  • `failed`: the payment failed to be processed. Note that payments can fail after being - * confirmed if the failure message is sent late by the banks.
  • - *
  • `charged_back`: the payment has been charged back
  • + *
  • pending_customer_approval: we're waiting for the customer to approve this + * payment
  • + *
  • pending_submission: the payment has been created, but not yet submitted to + * the banks
  • + *
  • submitted: the payment has been submitted to the banks
  • + *
  • confirmed: the payment has been confirmed as collected
  • + *
  • paid_out: the payment has been included in a payout
  • + *
  • cancelled: the payment has been cancelled
  • + *
  • customer_approval_denied: the customer has denied approval for the payment. + * You should contact the customer directly
  • + *
  • failed: the payment failed to be processed. Note that payments can fail + * after being confirmed if the failure message is sent late by the banks.
  • + *
  • charged_back: the payment has been charged back
  • *
*/ public Status getStatus() { @@ -228,35 +300,37 @@ private Fx() { private FxCurrency fxCurrency; /** - * Estimated rate that will be used in the foreign exchange of the `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 up to 10 decimal places. + * Estimated rate that will be used in the foreign exchange of the 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 up to 10 + * decimal places. */ public String getEstimatedExchangeRate() { return estimatedExchangeRate; } /** - * Rate used in the foreign exchange of the `amount` into the `fx_currency`. Present only - * after a resource is paid out. Has up to 10 decimal places. + * Rate used in the foreign exchange of the amount into the + * fx_currency. Present only after a resource is paid out. Has up to 10 decimal + * places. */ public String getExchangeRate() { return exchangeRate; } /** - * Amount that was paid out in the `fx_currency` after foreign exchange. Present only after - * the resource has been paid out. + * Amount that was paid out in the fx_currency after foreign exchange. Present + * only after the resource has been paid out. */ public Integer getFxAmount() { return fxAmount; } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) code for the currency in - * which amounts will be paid out (after foreign exchange). Currently "AUD", "CAD", "DKK", - * "EUR", "GBP", "NZD", "SEK" and "USD" are supported. Present only if payouts will be (or - * were) made via foreign exchange. + * ISO 4217 code for the + * currency in which amounts will be paid out (after foreign exchange). Currently "AUD", + * "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. Present only if payouts + * will be (or were) made via foreign exchange. */ public FxCurrency getFxCurrency() { return fxCurrency; @@ -293,33 +367,41 @@ private Links() { private String subscription; /** - * ID of [creditor](#core-endpoints-creditors) to which the collected payment will be sent. + * ID of creditor + * to which the collected payment will be sent. */ public String getCreditor() { return creditor; } /** - * 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. + * ID of instalment_schedule + * from which this payment was created.
+ *
+ * Note: this property will only be present if this payment is part of an + * instalment schedule. */ public String getInstalmentSchedule() { return instalmentSchedule; } /** - * ID of the [mandate](#core-endpoints-mandates) against which this payment should be - * collected. + * ID of the mandate + * against which this payment should be collected. */ public String getMandate() { return mandate; } /** - * ID of [payout](#core-endpoints-payouts) which contains the funds from this payment.
- * _Note_: this property will not be present until the payment has been successfully + * ID of payout which + * contains the funds from this payment.
+ *
+ * Note: this property will not be present until the payment has been successfully * collected. */ public String getPayout() { @@ -327,9 +409,12 @@ public String getPayout() { } /** - * ID of [subscription](#core-endpoints-subscriptions) from which this payment was - * created.
- * _Note_: this property will only be present if this payment is part of a subscription. + * ID of subscription + * from which this payment was created.
+ *
+ * Note: this property will only be present if this payment is part of a + * subscription. */ public String getSubscription() { return subscription; diff --git a/src/main/java/com/gocardless/resources/PaymentAccount.java b/src/main/java/com/gocardless/resources/PaymentAccount.java index 70942fcd..3a8d0bd9 100644 --- a/src/main/java/com/gocardless/resources/PaymentAccount.java +++ b/src/main/java/com/gocardless/resources/PaymentAccount.java @@ -3,8 +3,9 @@ /** * Represents a payment account resource returned from the API. * - * Access the details of bank accounts provided for you by GoCardless that are used to fund - * [Outbound Payments](#core-endpoints-outbound-payments). + * Access the details of bank accounts provided for you by GoCardless that are used to fund Outbound + * Payments. */ public class PaymentAccount { private PaymentAccount() { @@ -29,8 +30,9 @@ public Integer getAccountBalance() { /** * 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. + * with the linked creditor. This + * field will be transliterated, upcased and truncated to 18 characters. */ public String getAccountHolderName() { return accountHolderName; @@ -52,8 +54,8 @@ public String getBankName() { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public String getCurrency() { return currency; @@ -83,7 +85,9 @@ private Links() { private String creditor; /** - * ID of the [creditor](#core-endpoints-creditors) that owns this bank account. + * ID of the creditor + * that owns this bank account. */ public String getCreditor() { return creditor; diff --git a/src/main/java/com/gocardless/resources/PaymentAccountTransaction.java b/src/main/java/com/gocardless/resources/PaymentAccountTransaction.java index 621511fd..32c2b8ad 100644 --- a/src/main/java/com/gocardless/resources/PaymentAccountTransaction.java +++ b/src/main/java/com/gocardless/resources/PaymentAccountTransaction.java @@ -6,8 +6,9 @@ * Represents a payment account transaction resource returned from the API. * * Payment account transactions represent movements of funds on a given payment account. The payment - * account is provisioned by GoCardless and is used to fund [outbound - * payments](#core-endpoints-outbound-payments). + * account is provisioned by GoCardless and is used to fund outbound + * payments. */ public class PaymentAccountTransaction { private PaymentAccountTransaction() { @@ -123,7 +124,9 @@ private Links() { private String payout; /** - * ID of the [outbound_payment](#core-endpoints-outbound-payments) linked to the transaction + * ID of the outbound_payment + * linked to the transaction */ public String getOutboundPayment() { return outboundPayment; @@ -137,7 +140,9 @@ public String getPaymentBankAccount() { } /** - * ID of the [payout](#core-endpoints-payouts) linked to the transaction. + * ID of the payout + * linked to the transaction. */ public String getPayout() { return payout; diff --git a/src/main/java/com/gocardless/resources/Payout.java b/src/main/java/com/gocardless/resources/Payout.java index af3b6ea5..17eed085 100644 --- a/src/main/java/com/gocardless/resources/Payout.java +++ b/src/main/java/com/gocardless/resources/Payout.java @@ -6,9 +6,11 @@ /** * Represents a payout resource returned from the API. * - * 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). All - * the payments in a payout will have been collected in the same currency. Payouts are created + * Payouts represent transfers from GoCardless to a + * creditor. + * Each payout contains the funds collected from one or many + * 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 { @@ -39,27 +41,29 @@ public Integer getAmount() { /** * Date the payout is due to arrive in the creditor's bank account. One of: + * *
    - *
  • `yyyy-mm-dd`: the payout has been paid and is due to arrive in the creditor's bank - * account on this day
  • - *
  • `null`: the payout hasn't been paid yet
  • + *
  • yyyy-mm-dd: the payout has been paid and is due to arrive in the creditor's + * bank account on this day
  • + *
  • null: the payout hasn't been paid yet
  • *
- * */ public String getArrivalDate() { return arrivalDate; } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public Currency getCurrency() { return currency; @@ -67,13 +71,17 @@ public Currency getCurrency() { /** * Fees that have already been deducted from the payout amount in minor unit (e.g. pence in GBP, - * cents in EUR), inclusive of tax if applicable.
- * 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` 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. + * cents in EUR), inclusive of tax if applicable.
+ *
+ * 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 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. */ public Integer getDeductedFees() { return deductedFees; @@ -96,8 +104,8 @@ public Links getLinks() { /** * 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. _Note:_ This should not be used for storing PII - * data. + * characters and values up to 500 characters. Note: This should not be used for + * storing PII data. */ public Map getMetadata() { return metadata; @@ -119,12 +127,13 @@ public String getReference() { /** * One of: + * *
    - *
  • `pending`: the payout has been created, but not yet sent to your bank or it is in the - * process of being exchanged through our FX provider.
  • - *
  • `paid`: the payout has been sent to the your bank. FX payouts will become `paid` after we - * emit the `fx_rate_confirmed` webhook.
  • - *
  • `bounced`: the payout bounced when sent, the payout can be retried.
  • + *
  • pending: the payout has been created, but not yet sent to your bank or it is + * in the process of being exchanged through our FX provider.
  • + *
  • paid: the payout has been sent to the your bank. FX payouts will become + * paid after we emit the fx_rate_confirmed webhook.
  • + *
  • bounced: the payout bounced when sent, the payout can be retried.
  • *
*/ public Status getStatus() { @@ -132,10 +141,10 @@ public Status getStatus() { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) code for the currency in - * which tax is paid out to the tax authorities of your tax jurisdiction. Currently “EUR”, - * “GBP”, for French or British merchants, this will be `null` if tax is not applicable - * beta + * ISO 4217 code for the + * currency in which tax is paid out to the tax authorities of your tax jurisdiction. Currently + * “EUR”, “GBP”, for French or British merchants, this will be null if tax is not + * applicable beta */ public String getTaxCurrency() { return taxCurrency; @@ -185,35 +194,37 @@ private Fx() { private FxCurrency fxCurrency; /** - * Estimated rate that will be used in the foreign exchange of the `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 up to 10 decimal places. + * Estimated rate that will be used in the foreign exchange of the 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 up to 10 + * decimal places. */ public String getEstimatedExchangeRate() { return estimatedExchangeRate; } /** - * Rate used in the foreign exchange of the `amount` into the `fx_currency`. Present only - * after a resource is paid out. Has up to 10 decimal places. + * Rate used in the foreign exchange of the amount into the + * fx_currency. Present only after a resource is paid out. Has up to 10 decimal + * places. */ public String getExchangeRate() { return exchangeRate; } /** - * Amount that was paid out in the `fx_currency` after foreign exchange. Present only after - * the resource has been paid out. + * Amount that was paid out in the fx_currency after foreign exchange. Present + * only after the resource has been paid out. */ public Integer getFxAmount() { return fxAmount; } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) code for the currency in - * which amounts will be paid out (after foreign exchange). Currently "AUD", "CAD", "DKK", - * "EUR", "GBP", "NZD", "SEK" and "USD" are supported. Present only if payouts will be (or - * were) made via foreign exchange. + * ISO 4217 code for the + * currency in which amounts will be paid out (after foreign exchange). Currently "AUD", + * "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. Present only if payouts + * will be (or were) made via foreign exchange. */ public FxCurrency getFxCurrency() { return fxCurrency; @@ -247,15 +258,18 @@ private Links() { private String creditorBankAccount; /** - * ID of [creditor](#core-endpoints-creditors) who will receive this payout, i.e. the owner - * of the `creditor_bank_account`. + * ID of creditor + * who will receive this payout, i.e. the owner of the creditor_bank_account. */ public String getCreditor() { return creditor; } /** - * ID of [bank account](#core-endpoints-creditor-bank-accounts) which this will be sent to. + * ID of bank + * account which this will be sent to. */ public String getCreditorBankAccount() { return creditorBankAccount; diff --git a/src/main/java/com/gocardless/resources/PayoutItem.java b/src/main/java/com/gocardless/resources/PayoutItem.java index 126a3687..46b8c57e 100644 --- a/src/main/java/com/gocardless/resources/PayoutItem.java +++ b/src/main/java/com/gocardless/resources/PayoutItem.java @@ -17,7 +17,6 @@ * The Payout Items API allows you to view, on a per-payout basis, the credit and debit items that * make up that payout's amount. Payout items can only be retrieved for payouts created in the last * 6 months. Requests for older payouts will return an HTTP status 410 Gone. - * */ public class PayoutItem { private PayoutItem() { @@ -32,11 +31,14 @@ private PayoutItem() { /** * The positive (credit) or negative (debit) value of the item, in fractional currency; the * lowest denomination for the currency (e.g. pence in GBP, cents in EUR), to one decimal place. + * *

* For accuracy, we store some of our fees to greater precision than we can actually pay out * (for example, a GoCardless fee we record might come to 0.5 pence, but it is not possible to * send a payout via bank transfer including a half penny).
+ *
*
+ *
* To calculate the final amount of the payout, we sum all of the items and then round to the * nearest currency unit. *

@@ -52,8 +54,8 @@ public Links getLinks() { /** * An array of tax items beta * - * _Note_: VAT applies to transaction and surcharge fees for merchants operating in the UK and - * France. + * Note: VAT applies to transaction and surcharge fees for merchants operating in the + * UK and France. */ public List getTaxes() { return taxes; @@ -62,27 +64,28 @@ public List getTaxes() { /** * The type of the credit (positive) or debit (negative) item in the payout (inclusive of VAT if * applicable). One of: + * *
    - *
  • `payment_paid_out` (credit)
  • - *
  • `payment_failed` (debit): The payment failed to be processed.
  • - *
  • `payment_charged_back` (debit): The payment has been charged back.
  • - *
  • `payment_refunded` (debit): The payment has been refunded to the customer.
  • - *
  • `refund` (debit): A refund sent to a customer, not linked to a payment.
  • - *
  • `refund_funds_returned` (credit): The refund could not be sent to the customer, and the - * funds have been returned to you.
  • - *
  • `gocardless_fee` (credit/debit): The fees that GoCardless charged for a payment. In the - * case of a payment failure or chargeback, these will appear as credits. Will include taxes if - * applicable for merchants.
  • - *
  • `app_fee` (credit/debit): The optional fees that a partner may have taken for a payment. - * In the case of a payment failure or chargeback, these will appear as credits.
  • - *
  • `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. Will include taxes if applicable for merchants.
  • + *
  • payment_paid_out (credit)
  • + *
  • payment_failed (debit): The payment failed to be processed.
  • + *
  • payment_charged_back (debit): The payment has been charged back.
  • + *
  • payment_refunded (debit): The payment has been refunded to the + * customer.
  • + *
  • refund (debit): A refund sent to a customer, not linked to a payment.
  • + *
  • refund_funds_returned (credit): The refund could not be sent to the + * customer, and the funds have been returned to you.
  • + *
  • gocardless_fee (credit/debit): The fees that GoCardless charged for a + * payment. In the case of a payment failure or chargeback, these will appear as credits. Will + * include taxes if applicable for merchants.
  • + *
  • app_fee (credit/debit): The optional fees that a partner may have taken for + * a payment. In the case of a payment failure or chargeback, these will appear as credits.
  • + *
  • 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. Will include taxes if applicable for merchants.
  • *
- * */ public Type getType() { return type; @@ -119,8 +122,8 @@ private Links() { /** * Unique identifier, beginning with "MD". Note that this prefix may not apply to mandates - * created before 2016. Present only for the items of type `payment_refunded`, `refund` and - * `refund_funds_returned`. + * created before 2016. Present only for the items of type payment_refunded, + * refund and refund_funds_returned. */ public String getMandate() { return mandate; @@ -135,7 +138,8 @@ public String getPayment() { /** * Unique identifier, beginning with "RF". Present only for the items of type - * `payment_refunded`, `refund` and `refund_funds_returned`. + * payment_refunded, refund and + * refund_funds_returned. */ public String getRefund() { return refund; @@ -168,8 +172,8 @@ public String getAmount() { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public Currency getCurrency() { return currency; @@ -180,17 +184,17 @@ public Currency getCurrency() { * lowest denomination for the currency (e.g. pence in GBP, cents in EUR), to one decimal * place. * - * When `currency` and `destination_currency` don't match this will be `null` until the - * `exchange_rate` has been finalised. + * When currency and destination_currency don't match this will be + * null until the exchange_rate has been finalised. */ public String getDestinationAmount() { return destinationAmount; } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) code for the currency in - * which tax is paid out to the tax authorities of your tax jurisdiction. Currently “EUR” - * for French merchants and “GBP” for British merchants. + * ISO 4217 code for the + * currency in which tax is paid out to the tax authorities of your tax jurisdiction. + * Currently “EUR” for French merchants and “GBP” for British merchants. */ public String getDestinationCurrency() { return destinationCurrency; @@ -202,9 +206,9 @@ public String getDestinationCurrency() { * Present only if the currency and the destination currency don't match and the exchange * rate has been finalised. * - * You can listen for the payout's [`tax_exchange_rates_confirmed` - * webhook](https://developer.gocardless.com/api-reference/#event-types-payout) to know when - * the exchange rate has been finalised for all fees in the payout. + * You can listen for the payout's tax_exchange_rates_confirmed + * webhook to know when the exchange rate has been finalised for all fees in the payout. */ public String getExchangeRate() { return exchangeRate; diff --git a/src/main/java/com/gocardless/resources/RedirectFlow.java b/src/main/java/com/gocardless/resources/RedirectFlow.java index b5dea604..2ac3b6f4 100644 --- a/src/main/java/com/gocardless/resources/RedirectFlow.java +++ b/src/main/java/com/gocardless/resources/RedirectFlow.java @@ -8,35 +8,44 @@ * *

* Deprecated: Redirect Flows are legacy APIs and cannot be used by new - * integrators. The [Billing Request flow](#billing-requests) API should be used for your payment - * flows. + * integrators. The Billing + * Request flow API should be used for your payment flows. *

- * - * Redirect flows enable you to use GoCardless' [hosted payment - * pages](https://pay-sandbox.gocardless.com/AL000000AKFPFF) to set up mandates with your customers. - * These pages are fully compliant and have been translated into Danish, Dutch, French, German, - * Italian, Norwegian, Portuguese, Slovak, Spanish and Swedish. + * Redirect flows enable you to use GoCardless' + * hosted payment pages to set up + * mandates with your customers. These pages are fully compliant and have been translated into + * Danish, Dutch, French, German, Italian, Norwegian, Portuguese, Slovak, Spanish and Swedish. * * The overall flow is: * - * 1. You [create](#redirect-flows-create-a-redirect-flow) a redirect flow for your customer, and - * redirect them to the returned redirect url, e.g. `https://pay.gocardless.com/flow/RE123`. - * - * 2. Your customer supplies their name, email, address, and bank account details, and submits the - * form. This securely stores their details, and redirects them back to your `success_redirect_url` - * with `redirect_flow_id=RE123` in the querystring. - * - * 3. You [complete](#redirect-flows-complete-a-redirect-flow) the redirect flow, which creates a - * [customer](#core-endpoints-customers), [customer bank - * account](#core-endpoints-customer-bank-accounts), and [mandate](#core-endpoints-mandates), and - * returns the ID of the mandate. You may wish to create a - * [subscription](#core-endpoints-subscriptions) or [payment](#core-endpoints-payments) at this - * point. - * - * Once you have [completed](#redirect-flows-complete-a-redirect-flow) the redirect flow via the - * API, you should display a confirmation page to your customer, confirming that their Direct Debit - * has been set up. You can build your own page, or redirect to the one we provide in the - * `confirmation_url` attribute of the redirect flow. + *
    + *
  1. You create + * a redirect flow for your customer, and redirect them to the returned redirect url, e.g. + * https://pay.gocardless.com/flow/RE123.
  2. + *
  3. Your customer supplies their name, email, address, and bank account details, and submits the + * form. This securely stores their details, and redirects them back to your + * success_redirect_url with redirect_flow_id=RE123 in the + * querystring.
  4. + *
  5. You complete + * the redirect flow, which creates a + * customer, + * customer + * bank account, and + * mandate, + * and returns the ID of the mandate. You may wish to create a subscription + * or payment + * at this point.
  6. + *
+ * Once you have completed + * the redirect flow via the API, you should display a confirmation page to your customer, + * confirming that their Direct Debit has been set up. You can build your own page, or redirect to + * the one we provide in the confirmation_url attribute of the redirect flow. * * Redirect flows expire 30 minutes after they are first created. You cannot complete an expired * redirect flow. For an integrator this is shorter and they will expire after 10 minutes. @@ -62,7 +71,8 @@ private RedirectFlow() { * The URL of a confirmation page, which you may optionally redirect the customer to rather than * use your own page, that confirms in their chosen language that their Direct Debit has been * set up successfully. Only returned once the customer has set up their mandate via the payment - * pages and the redirect flow has been [completed](#redirect-flows-complete-a-redirect-flow), + * pages and the redirect flow has been completed, * and only available for 15 minutes from when you complete the redirect flow. The structure of * this URL may change at any time, so you should read it directly from the API response. */ @@ -71,7 +81,9 @@ public String getConfirmationUrl() { } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; @@ -105,8 +117,8 @@ public String getMandateReference() { /** * 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. _Note:_ This should not be used for storing PII - * data. + * characters and values up to 500 characters. Note: This should not be used for + * storing PII data. */ public Map getMetadata() { return metadata; @@ -139,8 +151,8 @@ public String getSessionToken() { } /** - * The URL to redirect to upon successful mandate setup. You must use a URL beginning `https` in - * the live environment. + * The URL to redirect to upon successful mandate setup. You must use a URL beginning + * https in the live environment. */ public String getSuccessRedirectUrl() { return successRedirectUrl; @@ -176,46 +188,58 @@ private Links() { private String mandate; /** - * ID of [billing request](#billing-requests-billing-requests) that a redirect flow can - * create.
- * **Note**: The redirect flow will only create a billing request in the event the redirect - * flow is eligible to send the payer down this new and improved flow + * ID of billing + * request that a redirect flow can create.
+ *
+ * Note: The redirect flow will only create a billing request in the event + * the redirect flow is eligible to send the payer down this new and improved flow */ public String getBillingRequest() { return billingRequest; } /** - * The [creditor](#core-endpoints-creditors) for whom the mandate will be created. The - * `name` of the creditor will be displayed on the payment page. + * The creditor + * for whom the mandate will be created. The name of the creditor will be + * displayed on the payment page. */ public String getCreditor() { return creditor; } /** - * ID of [customer](#core-endpoints-customers) created by this redirect flow.
- * **Note**: this property will not be present until the redirect flow has been successfully - * completed. + * ID of customer + * created by this redirect flow.
+ *
+ * Note: this property will not be present until the redirect flow has been + * successfully completed. */ public String getCustomer() { return customer; } /** - * ID of [customer bank account](#core-endpoints-customer-bank-accounts) created by this - * redirect flow.
- * **Note**: this property will not be present until the redirect flow has been successfully - * completed. + * ID of customer + * bank account created by this redirect flow.
+ *
+ * Note: this property will not be present until the redirect flow has been + * successfully completed. */ public String getCustomerBankAccount() { return customerBankAccount; } /** - * ID of [mandate](#core-endpoints-mandates) created by this redirect flow.
- * **Note**: this property will not be present until the redirect flow has been successfully - * completed. + * ID of mandate + * created by this redirect flow.
+ *
+ * Note: this property will not be present until the redirect flow has been + * successfully completed. */ public String getMandate() { return mandate; diff --git a/src/main/java/com/gocardless/resources/Refund.java b/src/main/java/com/gocardless/resources/Refund.java index cc4dd0fc..fd2e0ba3 100644 --- a/src/main/java/com/gocardless/resources/Refund.java +++ b/src/main/java/com/gocardless/resources/Refund.java @@ -6,11 +6,14 @@ /** * Represents a refund resource returned from the API. * - * Refund objects represent (partial) refunds of a [payment](#core-endpoints-payments) back to the - * [customer](#core-endpoints-customers). + * Refund objects represent (partial) refunds of a + * payment + * back to the + * customer. * - * GoCardless will notify you via a [webhook](#appendix-webhooks) whenever a refund is created, and - * will update the `amount_refunded` property of the payment. + * GoCardless will notify you via a + * webhook whenever + * a refund is created, and will update the amount_refunded property of the payment. */ public class Refund { private Refund() { @@ -35,15 +38,18 @@ public Integer getAmount() { } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. This is set to - * the currency of the refund's [payment](#core-endpoints-payments). + * ISO 4217 currency code. + * This is set to the currency of the refund's payment. */ public String getCurrency() { return currency; @@ -74,25 +80,76 @@ public Map getMetadata() { /** * 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
- * Faster Payments - 18 characters
- * PAD - scheme doesn't offer references
- * PayTo - 18 characters
- * SEPA - 140 characters
+ * 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
  • + *
+ *
+ *
+ * Faster Payments + *
    + *
  • 18 characters
  • + *
+ *
+ *
+ * PAD + *
    + *
  • scheme doesn't offer references
  • + *
+ *
+ *
+ * PayTo + *
    + *
  • 18 characters
  • + *
+ *
+ *
+ * SEPA + *
    + *
  • 140 characters
  • + *
+ *
+ *
* Note that this reference must be unique (for each merchant) for the BECS scheme as it is a * scheme requirement. - *

+ *

* 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. + * GoCardless Plus, Pro or Enterprise packages. *

- *

+ *

* Restricted: You can not specify a payment reference for Faster Payments. *

*/ @@ -102,15 +159,17 @@ public String getReference() { /** * 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
  • + *
  • 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
  • + *
  • cancelled: the refund has been cancelled
  • + *
  • bounced: the refund has failed to be paid
  • + *
  • funds_returned: the refund has had its funds returned
  • *
*/ public Status getStatus() { @@ -145,35 +204,37 @@ private Fx() { private FxCurrency fxCurrency; /** - * Estimated rate that will be used in the foreign exchange of the `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 up to 10 decimal places. + * Estimated rate that will be used in the foreign exchange of the 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 up to 10 + * decimal places. */ public String getEstimatedExchangeRate() { return estimatedExchangeRate; } /** - * Rate used in the foreign exchange of the `amount` into the `fx_currency`. Present only - * after a resource is paid out. Has up to 10 decimal places. + * Rate used in the foreign exchange of the amount into the + * fx_currency. Present only after a resource is paid out. Has up to 10 decimal + * places. */ public String getExchangeRate() { return exchangeRate; } /** - * Amount that was paid out in the `fx_currency` after foreign exchange. Present only after - * the resource has been paid out. + * Amount that was paid out in the fx_currency after foreign exchange. Present + * only after the resource has been paid out. */ public Integer getFxAmount() { return fxAmount; } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) code for the currency in - * which amounts will be paid out (after foreign exchange). Currently "AUD", "CAD", "DKK", - * "EUR", "GBP", "NZD", "SEK" and "USD" are supported. Present only if payouts will be (or - * were) made via foreign exchange. + * ISO 4217 code for the + * currency in which amounts will be paid out (after foreign exchange). Currently "AUD", + * "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. Present only if payouts + * will be (or were) made via foreign exchange. */ public FxCurrency getFxCurrency() { return fxCurrency; @@ -207,14 +268,18 @@ private Links() { private String payment; /** - * ID of the [mandate](#core-endpoints-mandates) against which the refund is being made. + * ID of the mandate + * against which the refund is being made. */ public String getMandate() { return mandate; } /** - * ID of the [payment](#core-endpoints-payments) against which the refund is being made. + * ID of the payment + * against which the refund is being made. */ public String getPayment() { return payment; diff --git a/src/main/java/com/gocardless/resources/ScenarioSimulator.java b/src/main/java/com/gocardless/resources/ScenarioSimulator.java index 23176c2f..c74a1933 100644 --- a/src/main/java/com/gocardless/resources/ScenarioSimulator.java +++ b/src/main/java/com/gocardless/resources/ScenarioSimulator.java @@ -15,108 +15,126 @@ private ScenarioSimulator() { /** * The unique identifier of the simulator, used to initiate simulations. One of: + * *
    - *
  • `creditor_verification_status_action_required`: Sets a creditor's `verification status` - * to `action required`, meaning that the creditor must provide further information to - * GoCardless in order to verify their account to receive payouts.
  • - *
  • `creditor_verification_status_in_review`: Sets a creditor's `verification status` to `in - * review`, meaning that the creditor has provided all of the information requested by - * GoCardless to verify their account, and is now awaiting review.
  • - *
  • `creditor_verification_status_successful`: Sets a creditor's `verification status` to - * `successful`, meaning that the creditor is fully verified and can receive payouts.
  • - *
  • `payment_confirmed`: Transitions a payment through to `confirmed`. It must start in the - * `pending_submission` state, and its mandate must be in the `activated` state (unless it is a - * payment for ACH, BECS, BECS_NZ or SEPA, in which cases the mandate may be - * `pending_submission`, since their mandates are submitted with their first payment).
  • - *
  • `payment_paid_out`: Transitions a payment through to `paid_out`, having been collected - * successfully and paid out to you. It must start in the `pending_submission` state, and its - * mandate must be in the `activated` state (unless it is a payment for ACH, BECS, BECS_NZ or - * SEPA, in which cases the mandate may be `pending_submission`, since their mandates are - * submitted with their first payment).
  • - *
  • `payment_failed`: Transitions a payment through to `failed`. It must start in the - * `pending_submission` state, and its mandate must be in the `activated` state (unless it is a - * payment for ACH, BECS, BECS_NZ or SEPA, in which cases the mandate may be - * `pending_submission`, since their mandates are submitted with their first payment).
  • - *
  • `payment_charged_back`: Behaves the same as the `payout_paid_out` simulator, except that - * the payment is transitioned to `charged_back` after it is paid out, having been charged back - * by the customer.
  • - *
  • `payment_chargeback_settled`: Behaves the same as the `payment_charged_back` simulator, - * except that the charged back payment is additionally included as a debit item in a payout, - * thereby settling the charged back payment.
  • - *
  • `payment_late_failure`: Transitions a payment through to `late_failure`, having been - * apparently collected successfully beforehand. It must start in either the - * `pending_submission` or `paid_out` state, and its mandate must be in the `activated` state - * (unless it is a payment for ACH, BECS, BECS_NZ or SEPA, in which cases the mandate may be - * `pending_submission`, since their mandates are submitted with their first payment). Not - * compatible with Autogiro mandates.
  • - *
  • `payment_late_failure_settled`: Behaves the same as the `payment_late_failure` simulator, - * except that the late failure is additionally included as a debit item in a payout, thereby - * settling the late failure.
  • - *
  • `payment_submitted`: Transitions a payment to `submitted`, without proceeding any - * further. It must start in the `pending_submission` state.
  • - *
  • `mandate_activated`: Transitions a mandate through to `activated`, having been submitted - * to the banks and set up successfully. It must start in the `pending_submission` state. Not - * compatible with ACH, BECS, BECS_NZ and SEPA mandates, which are submitted and activated with - * their first payment.
  • - *
  • `mandate_customer_approval_granted`: Transitions a mandate through to - * `pending_submission`, as if the customer approved the mandate creation. It must start in the - * `pending_customer_approval` state. Compatible only with Bacs and SEPA mandates, which support - * customer signatures on the mandate. All payments associated with the mandate will be - * transitioned to `pending_submission`. All subscriptions associated with the mandate will - * become `active`.
  • - *
  • `mandate_customer_approval_skipped`: Transitions a mandate through to - * `pending_submission`, as if the customer skipped the mandate approval during the mandate - * creation process. It must start in the `pending_customer_approval` state. Compatible only - * with Bacs and SEPA mandates, which support customer signatures on the mandate. All payments - * associated with the mandate will be transitioned to `pending_submission`. All subscriptions - * associated with the mandate will become `active`.
  • - *
  • `mandate_failed`: Transitions a mandate through to `failed`, having been submitted to the - * banks but found to be invalid (for example due to invalid bank details). It must start in the - * `pending_submission` or `submitted` states. Not compatible with SEPA mandates, which are - * submitted with their first payment.
  • - *
  • `mandate_expired`: Transitions a mandate through to `expired`, having been submitted to - * the banks, set up successfully and then expired because no collection attempts were made - * against it for longer than the scheme's dormancy period (13 months for Bacs, 3 years for - * SEPA, 15 months for ACH, Betalingsservice, and BECS). It must start in the - * `pending_submission` state. Not compatible with Autogiro, BECS NZ, and PAD mandates, which do - * not expire.
  • - *
  • `mandate_transferred`: Transitions a mandate through to `transferred`, having been - * submitted to the banks, set up successfully and then moved to a new bank account due. It must - * start in the `pending_submission` state. Only compatible with Bacs and SEPA mandates.
  • - *
  • `mandate_transferred_with_resubmission`: Transitions a mandate through `transferred` and - * resubmits it to the banks, can be caused be the UK's Current Account Switching Service (CASS) - * or when a customer contacts GoCardless to change their bank details. It must start in the - * `pending_submission` state. Only compatible with Bacs mandates.
  • - *
  • `mandate_suspended_by_payer`: Transitions a mandate to `suspended_by_payer`, as if payer - * has suspended the mandate after it has been setup successfully. It must start in the - * `activated` state. Only compatible with PAY_TO mandates.
  • - *
  • `refund_paid`: Transitions a refund to `paid`. It must start in either the - * `pending_submission` or `submitted` state.
  • - *
  • `refund_settled`: Transitions a refund to `paid`, if it's not already, then generates a - * payout that includes the refund, thereby settling the funds. It must start in one of - * `pending_submission`, `submitted` or `paid` states.
  • - *
  • `refund_bounced`: Transitions a refund to `bounced`. It must start in either the - * `pending_submission`, `submitted`, or `paid` state.
  • - *
  • `refund_returned`: Transitions a refund to `refund_returned`. The refund must start in - * `pending_submission`.
  • - *
  • `payout_bounced`: Transitions a payout to `bounced`. It must start in the `paid` + *
  • creditor_verification_status_action_required: Sets a creditor's + * verification status to action required, meaning that the creditor + * must provide further information to GoCardless in order to verify their account to receive + * payouts.
  • + *
  • creditor_verification_status_in_review: Sets a creditor's verification + * status to in review, meaning that the creditor has provided all of the + * information requested by GoCardless to verify their account, and is now awaiting review.
  • + *
  • creditor_verification_status_successful: Sets a creditor's + * verification + * status to successful, meaning that the creditor is fully verified and can + * receive payouts.
  • + *
  • payment_confirmed: Transitions a payment through to confirmed. + * It must start in the pending_submission state, and its mandate must be in the + * activated state (unless it is a payment for ACH, BECS, BECS_NZ or SEPA, in which + * cases the mandate may be pending_submission, since their mandates are submitted + * with their first payment).
  • + *
  • payment_paid_out: Transitions a payment through to paid_out, + * having been collected successfully and paid out to you. It must start in the + * pending_submission state, and its mandate must be in the activated + * state (unless it is a payment for ACH, BECS, BECS_NZ or SEPA, in which cases the mandate may + * be pending_submission, since their mandates are submitted with their first + * payment).
  • + *
  • payment_failed: Transitions a payment through to failed. It + * must start in the pending_submission state, and its mandate must be in the + * activated state (unless it is a payment for ACH, BECS, BECS_NZ or SEPA, in which + * cases the mandate may be pending_submission, since their mandates are submitted + * with their first payment).
  • + *
  • payment_charged_back: Behaves the same as the payout_paid_out + * simulator, except that the payment is transitioned to charged_back after it is + * paid out, having been charged back by the customer.
  • + *
  • payment_chargeback_settled: Behaves the same as the + * payment_charged_back simulator, except that the charged back payment is + * additionally included as a debit item in a payout, thereby settling the charged back + * payment.
  • + *
  • payment_late_failure: Transitions a payment through to + * late_failure, having been apparently collected successfully beforehand. It must + * start in either the pending_submission or paid_out state, and its + * mandate must be in the activated state (unless it is a payment for ACH, BECS, + * BECS_NZ or SEPA, in which cases the mandate may be pending_submission, since + * their mandates are submitted with their first payment). Not compatible with Autogiro + * mandates.
  • + *
  • payment_late_failure_settled: Behaves the same as the + * payment_late_failure simulator, except that the late failure is additionally + * included as a debit item in a payout, thereby settling the late failure.
  • + *
  • payment_submitted: Transitions a payment to submitted, without + * proceeding any further. It must start in the pending_submission state.
  • + *
  • mandate_activated: Transitions a mandate through to activated, + * having been submitted to the banks and set up successfully. It must start in the + * pending_submission state. Not compatible with ACH, BECS, BECS_NZ and SEPA + * mandates, which are submitted and activated with their first payment.
  • + *
  • mandate_customer_approval_granted: Transitions a mandate through to + * pending_submission, as if the customer approved the mandate creation. It must + * start in the pending_customer_approval state. Compatible only with Bacs and SEPA + * mandates, which support customer signatures on the mandate. All payments associated with the + * mandate will be transitioned to pending_submission. All subscriptions associated + * with the mandate will become active.
  • + *
  • mandate_customer_approval_skipped: Transitions a mandate through to + * pending_submission, as if the customer skipped the mandate approval during the + * mandate creation process. It must start in the pending_customer_approval state. + * Compatible only with Bacs and SEPA mandates, which support customer signatures on the + * mandate. All payments associated with the mandate will be transitioned to + * pending_submission. All subscriptions associated with the mandate will become + * active.
  • + *
  • mandate_failed: Transitions a mandate through to failed, having + * been submitted to the banks but found to be invalid (for example due to invalid bank + * details). It must start in the pending_submission or submitted + * states. Not compatible with SEPA mandates, which are submitted with their first payment.
  • + *
  • mandate_expired: Transitions a mandate through to expired, + * having been submitted to the banks, set up successfully and then expired because no + * collection attempts were made against it for longer than the scheme's dormancy period (13 + * months for Bacs, 3 years for SEPA, 15 months for ACH, Betalingsservice, and BECS). It must + * start in the pending_submission state. Not compatible with Autogiro, BECS NZ, + * and PAD mandates, which do not expire.
  • + *
  • mandate_transferred: Transitions a mandate through to + * transferred, having been submitted to the banks, set up successfully and then + * moved to a new bank account due. It must start in the pending_submission state. + * Only compatible with Bacs and SEPA mandates.
  • + *
  • mandate_transferred_with_resubmission: Transitions a mandate through + * transferred and resubmits it to the banks, can be caused be the UK's Current + * Account Switching Service (CASS) or when a customer contacts GoCardless to change their bank + * details. It must start in the pending_submission state. Only compatible with + * Bacs mandates.
  • + *
  • mandate_suspended_by_payer: Transitions a mandate to + * suspended_by_payer, as if payer has suspended the mandate after it has been + * setup successfully. It must start in the activated state. Only compatible with + * PAY_TO mandates.
  • + *
  • refund_paid: Transitions a refund to paid. It must start in + * either the pending_submission or submitted state.
  • + *
  • refund_settled: Transitions a refund to paid, if it's not + * already, then generates a payout that includes the refund, thereby settling the funds. It + * must start in one of pending_submission, submitted or + * paid states.
  • + *
  • refund_bounced: Transitions a refund to bounced. It must start + * in either the pending_submission, submitted, or paid * state.
  • - *
  • `billing_request_fulfilled`: Authorises the billing request, and then fulfils it. The - * billing request must be in the `pending` state, with all actions completed except for - * `bank_authorisation`. Only billing requests with a `payment_request` are supported.
  • - *
  • `billing_request_fulfilled_and_payment_failed`: Authorises the billing request, fulfils - * it, and moves the associated payment to `failed`. The billing request must be in the - * `pending` state, with all actions completed except for `bank_authorisation`. Only billing - * requests with a `payment_request` are supported.
  • - *
  • `billing_request_fulfilled_and_payment_confirmed_to_failed`: Authorises the billing - * request, fulfils it, moves the associated payment to `confirmed` and then moves it to - * `failed`. The billing request must be in the `pending` state, with all actions completed - * except for `bank_authorisation`. Only billing requests with a `payment_request` are - * supported.
  • - *
  • `billing_request_fulfilled_and_payment_paid_out`: Authorises the billing request, fulfils - * it, and moves the associated payment to `paid_out`. The billing request must be in the - * `pending` state, with all actions completed except for `bank_authorisation`. Only billing - * requests with a `payment_request` are supported.
  • + *
  • refund_returned: Transitions a refund to refund_returned. The + * refund must start in pending_submission.
  • + *
  • payout_bounced: Transitions a payout to bounced. It must start + * in the paid state.
  • + *
  • billing_request_fulfilled: Authorises the billing request, and then fulfils + * it. The billing request must be in the pending state, with all actions completed + * except for bank_authorisation. Only billing requests with a + * payment_request are supported.
  • + *
  • billing_request_fulfilled_and_payment_failed: Authorises the billing + * request, fulfils it, and moves the associated payment to failed. The billing + * request must be in the pending state, with all actions completed except for + * bank_authorisation. Only billing requests with a payment_request + * are supported.
  • + *
  • billing_request_fulfilled_and_payment_confirmed_to_failed: Authorises the + * billing request, fulfils it, moves the associated payment to confirmed and then + * moves it to failed. The billing request must be in the pending + * state, with all actions completed except for bank_authorisation. Only billing + * requests with a payment_request are supported.
  • + *
  • billing_request_fulfilled_and_payment_paid_out: Authorises the billing + * request, fulfils it, and moves the associated payment to paid_out. The billing + * request must be in the pending state, with all actions completed except for + * bank_authorisation. Only billing requests with a payment_request + * are supported.
  • *
*/ public String getId() { diff --git a/src/main/java/com/gocardless/resources/SchemeIdentifier.java b/src/main/java/com/gocardless/resources/SchemeIdentifier.java index e3f4655d..cf2644fd 100644 --- a/src/main/java/com/gocardless/resources/SchemeIdentifier.java +++ b/src/main/java/com/gocardless/resources/SchemeIdentifier.java @@ -7,7 +7,6 @@ * * This represents a scheme identifier (e.g. a SUN in Bacs or a CID in SEPA). Scheme identifiers are * used to specify the beneficiary name that appears on customers' bank statements. - * */ public class SchemeIdentifier { private SchemeIdentifier() { @@ -69,15 +68,18 @@ public String getCity() { } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public String getCountryCode() { return countryCode; } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; @@ -108,8 +110,9 @@ public String getId() { * The minimum interval, in working days, between the sending of a pre-notification to the * customer, and the charge date of a payment using this scheme identifier. * - * By default, GoCardless sends these notifications automatically. Please see our [compliance - * requirements](#appendix-compliance-requirements) for more details. + * By default, GoCardless sends these notifications automatically. Please see our compliance + * requirements for more details. */ public Integer getMinimumAdvanceNotice() { return minimumAdvanceNotice; @@ -159,8 +162,8 @@ public Scheme getScheme() { } /** - * The status of the scheme identifier. Only `active` scheme identifiers will be applied to a - * creditor and used against payments. + * The status of the scheme identifier. Only active scheme identifiers will be + * applied to a creditor and used against payments. */ public Status getStatus() { return status; diff --git a/src/main/java/com/gocardless/resources/Subscription.java b/src/main/java/com/gocardless/resources/Subscription.java index ada34d0d..026ef6bf 100644 --- a/src/main/java/com/gocardless/resources/Subscription.java +++ b/src/main/java/com/gocardless/resources/Subscription.java @@ -7,39 +7,48 @@ /** * Represents a subscription resource returned from the API. * - * Subscriptions create [payments](#core-endpoints-payments) according to a schedule. + * Subscriptions create + * payments + * according to a schedule. * - * ### Recurrence Rules + *

Recurrence Rules

The following rules apply when specifying recurrence: * - * The following rules apply when specifying recurrence: - * - * - If `day_of_month` and `start_date` are not provided `start_date` will be the - * [mandate](#core-endpoints-mandates)'s `next_possible_charge_date` and the subscription will then - * recur based on the `interval` & `interval_unit` - If `month` or `day_of_month` are present the - * following validations apply: - * - * | __interval_unit__ | __month__ | __day_of_month__ | | :---------------- | - * :--------------------------------------------- | :----------------------------------------- | | - * yearly | optional (required if `day_of_month` provided) | optional (invalid if `month` not - * provided) | | monthly | invalid | optional | | weekly | invalid | invalid | + *
    + *
  • If day_of_month and start_date are not provided + * start_date will be the + * mandate's + * next_possible_charge_date and the subscription will then recur based on the + * interval & interval_unit
  • + *
  • If month or day_of_month are present the following validations + * apply:
  • + *
+ * | interval_unit | month | day_of_month | | + * :---------------- | :--------------------------------------------- | + * :----------------------------------------- | | yearly | optional (required if + * day_of_month provided) | optional (invalid if month not provided) | | + * monthly | invalid | optional | | weekly | invalid | invalid | * * Examples: * - * | __interval_unit__ | __interval__ | __month__ | __day_of_month__ | valid? | | :---------------- - * | :----------- | :-------- | :--------------- | - * :------------------------------------------------- | | yearly | 1 | january | -1 | valid | | - * monthly | 6 | | | valid | | monthly | 6 | | 12 | valid | | weekly | 2 | | | valid | | yearly | 1 - * | march | | invalid - missing `day_of_month` | | yearly | 1 | | 2 | invalid - missing `month` | | - * monthly | 6 | august | 12 | invalid - `month` must be blank | | weekly | 2 | october | 10 | - * invalid - `month` and `day_of_month` must be blank | - * - * ### Rolling dates + * | interval_unit | interval | month | + * day_of_month | valid? | | :---------------- | :----------- | :-------- | + * :--------------- | :------------------------------------------------- | | yearly | 1 | january | + * -1 | valid | | monthly | 6 | | | valid | | monthly | 6 | | 12 | valid | | weekly | 2 | | | valid + * | | yearly | 1 | march | | invalid - missing day_of_month | | yearly | 1 | | 2 | + * invalid - missing month | | monthly | 6 | august | 12 | invalid - month + * must be blank | | weekly | 2 | october | 10 | invalid - month and + * day_of_month must be blank | * - * When a charge date falls on a non-business day, one of two things will happen: + *

Rolling dates

When a charge date falls on a non-business day, one of two things will + * happen: * - * - if the recurrence rule specified `-1` as the `day_of_month`, the charge date will be rolled - * __backwards__ to the previous business day (i.e., the last working day of the month). - otherwise - * the charge date will be rolled __forwards__ to the next business day. + *
    + *
  • if the recurrence rule specified -1 as the day_of_month, the charge + * date will be rolled backwards to the previous business day (i.e., the last + * working day of the month).
  • + *
  • otherwise the charge date will be rolled forwards to the next business + * day.
  • + *
*/ public class Subscription { private Subscription() { @@ -92,44 +101,52 @@ public Integer getCount() { } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public String getCurrency() { return currency; } /** - * As per RFC 2445. The day of the month to charge customers on. `1`-`28` or `-1` to indicate - * the last day of the month. + * As per RFC 2445. The day of the month to charge customers on. 1 + *
    + *
  • + *
+ * 28 or -1 to indicate the last day of the month. */ public Integer getDayOfMonth() { return dayOfMonth; } /** - * The earliest date that will be used as a `charge_date` on payments created for this - * subscription if it is resumed. Only present for `paused` subscriptions. This value will - * change over time. + * The earliest date that will be used as a charge_date on payments created for + * this subscription if it is resumed. Only present for paused subscriptions. This + * value will change over time. */ public String getEarliestChargeDateAfterResume() { return earliestChargeDateAfterResume; } /** - * Date on or after which no further payments should be created.
- * If this field is blank and `count` is not specified, the subscription will continue forever. - *
+ * Date on or after which no further payments should be created.
+ *
+ * If this field is blank and count is not specified, the subscription will + * continue forever.
+ *
+ * *

- * Deprecated: This field will be removed in a future API version. Use `count` - * to specify a number of payments instead. + * Deprecated: This field will be removed in a future API version. Use + * count to specify a number of payments instead. *

*/ public String getEndDate() { @@ -144,15 +161,17 @@ public String getId() { } /** - * Number of `interval_units` between customer charge dates. Must be greater than or equal to - * `1`. Must result in at least one charge date per year. Defaults to `1`. + * Number of interval_units between customer charge dates. Must be greater than or + * equal to 1. Must result in at least one charge date per year. Defaults to + * 1. */ public Integer getInterval() { return interval; } /** - * The unit of time between customer charge dates. One of `weekly`, `monthly` or `yearly`. + * The unit of time between customer charge dates. One of weekly, + * monthly or yearly. */ public IntervalUnit getIntervalUnit() { return intervalUnit; @@ -172,8 +191,7 @@ public Map getMetadata() { /** * Name of the month on which to charge a customer. Must be lowercase. Only applies when the - * interval_unit is `yearly`. - * + * interval_unit is yearly. */ public Month getMonth() { return month; @@ -196,8 +214,11 @@ public Boolean getParentPlanPaused() { /** * An optional payment reference. This will be set as the reference on each payment created and - * will appear on your customer's bank statement. See the documentation for the [create payment - * endpoint](#payments-create-a-payment) for more details.
+ * will appear on your customer's bank statement. See the documentation for the + * create + * payment endpoint for more details.
+ *
+ * *

* Restricted: You need your own Service User Number to specify a payment * reference for Bacs payments. @@ -208,11 +229,12 @@ public String getPaymentReference() { } /** - * On failure, automatically retry payments using [intelligent retries](/success-plus/overview). - * Default is `false`. + * On failure, automatically retry payments using + * intelligent retries. + * Default is false. *

* Important: To be able to use intelligent retries, Success+ needs to be - * enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus). + * enabled in GoCardless dashboard. *

*/ public Boolean getRetryIfPossible() { @@ -220,11 +242,12 @@ public Boolean getRetryIfPossible() { } /** - * The date on which the first payment should be charged. Must be on or after the - * [mandate](#core-endpoints-mandates)'s `next_possible_charge_date`. When left blank and - * `month` or `day_of_month` are provided, this will be set to the date of the first payment. If - * created without `month` or `day_of_month` this will be set as the mandate's - * `next_possible_charge_date` + * The date on which the first payment should be charged. Must be on or after the mandate's + * next_possible_charge_date. When left blank and month or + * day_of_month are provided, this will be set to the date of the first payment. If + * created without month or day_of_month this will be set as the + * mandate's next_possible_charge_date */ public String getStartDate() { return startDate; @@ -232,15 +255,18 @@ public String getStartDate() { /** * One of: + * *
    - *
  • `pending_customer_approval`: the subscription is waiting for customer approval before - * becoming active
  • - *
  • `customer_approval_denied`: the customer did not approve the subscription
  • - *
  • `active`: the subscription is currently active and will continue to create payments
  • - *
  • `finished`: all of the payments scheduled for creation under this subscription have been - * created
  • - *
  • `cancelled`: the subscription has been cancelled and will no longer create payments
  • - *
  • `paused`: the subscription has been paused and will not create payments
  • + *
  • pending_customer_approval: the subscription is waiting for customer approval + * before becoming active
  • + *
  • customer_approval_denied: the customer did not approve the subscription
  • + *
  • active: the subscription is currently active and will continue to create + * payments
  • + *
  • finished: all of the payments scheduled for creation under this subscription + * have been created
  • + *
  • cancelled: the subscription has been cancelled and will no longer create + * payments
  • + *
  • paused: the subscription has been paused and will not create payments
  • *
*/ public Status getStatus() { @@ -303,8 +329,9 @@ private Links() { private String mandate; /** - * ID of the associated [mandate](#core-endpoints-mandates) which the subscription will - * create payments against. + * ID of the associated mandate + * which the subscription will create payments against. */ public String getMandate() { return mandate; diff --git a/src/main/java/com/gocardless/resources/TaxRate.java b/src/main/java/com/gocardless/resources/TaxRate.java index e8eca81a..bcc42683 100644 --- a/src/main/java/com/gocardless/resources/TaxRate.java +++ b/src/main/java/com/gocardless/resources/TaxRate.java @@ -5,7 +5,9 @@ * * Tax rates from tax authority. * - * We also maintain a [static list of the tax rates for each jurisdiction](#appendix-tax-rates). + * We also maintain a + * static list of the + * tax rates for each jurisdiction. */ public class TaxRate { private TaxRate() { diff --git a/src/main/java/com/gocardless/resources/TransferredMandate.java b/src/main/java/com/gocardless/resources/TransferredMandate.java index 26219732..ceb170b7 100644 --- a/src/main/java/com/gocardless/resources/TransferredMandate.java +++ b/src/main/java/com/gocardless/resources/TransferredMandate.java @@ -16,8 +16,9 @@ private TransferredMandate() { private String publicKeyId; /** - * Encrypted customer bank account details, containing: `iban`, `account_holder_name`, - * `swift_bank_code`, `swift_branch_code`, `swift_account_number` + * Encrypted customer bank account details, containing: iban, + * account_holder_name, swift_bank_code, + * swift_branch_code, swift_account_number */ public String getEncryptedCustomerBankDetails() { return encryptedCustomerBankDetails; @@ -56,7 +57,8 @@ private Links() { private String mandate; /** - * The ID of the updated [customer_bank_account](#core-endpoints-customer-bank-accounts) + * The ID of the updated customer_bank_account */ public String getCustomerBankAccount() { return customerBankAccount; diff --git a/src/main/java/com/gocardless/resources/VerificationDetail.java b/src/main/java/com/gocardless/resources/VerificationDetail.java index d0538d52..0d6ab436 100644 --- a/src/main/java/com/gocardless/resources/VerificationDetail.java +++ b/src/main/java/com/gocardless/resources/VerificationDetail.java @@ -9,8 +9,9 @@ * *

* Restricted: These endpoints are restricted to customers who want to collect - * their merchant's verification details and pass them to GoCardless via our API. Please [get in - * touch](mailto:help@gocardless.com) if you wish to enable this feature on your account. + * their merchant's verification details and pass them to GoCardless via our API. Please + * get in touch if you wish to enable this feature on your + * account. *

*/ public class VerificationDetail { @@ -23,11 +24,13 @@ private VerificationDetail() { private String addressLine3; private String city; private String companyNumber; + private String countryCode; private String description; private List directors; private Links links; private String name; private String postalCode; + private String region; /** * The first line of the company's address. @@ -64,6 +67,13 @@ public String getCompanyNumber() { return companyNumber; } + /** + * The country code of the company's address. + */ + public String getCountryCode() { + return countryCode; + } + /** * A summary describing what the company does. */ @@ -96,6 +106,13 @@ public String getPostalCode() { return postalCode; } + /** + * The region of the company's address. + */ + public String getRegion() { + return region; + } + /** * Represents a director resource returned from the API. * @@ -122,8 +139,9 @@ public String getCity() { } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public String getCountryCode() { return countryCode; @@ -178,7 +196,8 @@ private Links() { private String creditor; /** - * ID of the [creditor](#core-endpoints-creditors) + * ID of the creditor */ public String getCreditor() { return creditor; diff --git a/src/main/java/com/gocardless/resources/Webhook.java b/src/main/java/com/gocardless/resources/Webhook.java index 55d2135a..736efa20 100644 --- a/src/main/java/com/gocardless/resources/Webhook.java +++ b/src/main/java/com/gocardless/resources/Webhook.java @@ -27,7 +27,9 @@ private Webhook() { private String url; /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Fixed timestamp, + * recording when this resource was created. */ public String getCreatedAt() { return createdAt; diff --git a/src/main/java/com/gocardless/services/BalanceService.java b/src/main/java/com/gocardless/services/BalanceService.java index 84623533..7331575a 100644 --- a/src/main/java/com/gocardless/services/BalanceService.java +++ b/src/main/java/com/gocardless/services/BalanceService.java @@ -28,8 +28,10 @@ public BalanceService(HttpClient httpClient) { } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of balances for a given - * creditor. This endpoint is rate limited to 60 requests per minute. + * Returns a cursor-paginated + * list of balances for a given creditor. This endpoint is rate limited to 60 requests per + * minute. */ public BalanceListRequest> list() { return new BalanceListRequest<>(httpClient, ListRequest.pagingExecutor()); @@ -42,8 +44,10 @@ public BalanceListRequest> all() { /** * Request class for {@link BalanceService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of balances for a given - * creditor. This endpoint is rate limited to 60 requests per minute. + * Returns a cursor-paginated + * list of balances for a given creditor. This endpoint is rate limited to 60 requests per + * minute. */ public static final class BalanceListRequest extends ListRequest { private String creditor; @@ -65,7 +69,8 @@ public BalanceListRequest withBefore(String before) { } /** - * ID of a [creditor](#core-endpoints-creditors). + * ID of a creditor. */ public BalanceListRequest withCreditor(String creditor) { this.creditor = creditor; diff --git a/src/main/java/com/gocardless/services/BankAccountDetailService.java b/src/main/java/com/gocardless/services/BankAccountDetailService.java index 068075ae..ae896368 100644 --- a/src/main/java/com/gocardless/services/BankAccountDetailService.java +++ b/src/main/java/com/gocardless/services/BankAccountDetailService.java @@ -26,9 +26,9 @@ public BankAccountDetailService(HttpClient httpClient) { * Returns bank account details in the flattened JSON Web Encryption format described in RFC * 7516. * - * You must specify a `Gc-Key-Id` header when using this endpoint. See [Public Key - * Setup](https://developer.gocardless.com/gc-embed/bank-details-access#public_key_setup) for - * more details. + * You must specify a Gc-Key-Id header when using this endpoint. See Public Key + * Setup for more details. */ public BankAccountDetailGetRequest get(String identity) { return new BankAccountDetailGetRequest(httpClient, identity); @@ -40,9 +40,9 @@ public BankAccountDetailGetRequest get(String identity) { * Returns bank account details in the flattened JSON Web Encryption format described in RFC * 7516. * - * You must specify a `Gc-Key-Id` header when using this endpoint. See [Public Key - * Setup](https://developer.gocardless.com/gc-embed/bank-details-access#public_key_setup) for - * more details. + * You must specify a Gc-Key-Id header when using this endpoint. See Public Key + * Setup for more details. */ public static final class BankAccountDetailGetRequest extends GetRequest { @PathParam diff --git a/src/main/java/com/gocardless/services/BankAccountHolderVerificationService.java b/src/main/java/com/gocardless/services/BankAccountHolderVerificationService.java index a413932c..4e2b77e2 100644 --- a/src/main/java/com/gocardless/services/BankAccountHolderVerificationService.java +++ b/src/main/java/com/gocardless/services/BankAccountHolderVerificationService.java @@ -68,8 +68,9 @@ public BankAccountHolderVerificationCreateRequest withLinksBankAccount(String ba } /** - * Type of the verification that has been performed eg. [Confirmation of - * Payee](https://www.wearepay.uk/what-we-do/overlay-services/confirmation-of-payee/) + * Type of the verification that has been performed eg. Confirmation + * of Payee */ public BankAccountHolderVerificationCreateRequest withType(Type type) { this.type = type; diff --git a/src/main/java/com/gocardless/services/BankAuthorisationService.java b/src/main/java/com/gocardless/services/BankAuthorisationService.java index 2184e190..74cf403f 100644 --- a/src/main/java/com/gocardless/services/BankAuthorisationService.java +++ b/src/main/java/com/gocardless/services/BankAuthorisationService.java @@ -56,8 +56,9 @@ public BankAuthorisationCreateRequest withLinks(Links links) { } /** - * ID of the [billing request](#billing-requests-billing-requests) against which this - * authorisation was created. + * ID of the billing + * request against which this authorisation was created. */ public BankAuthorisationCreateRequest withLinksBillingRequest(String billingRequest) { if (links == null) { @@ -70,24 +71,27 @@ public BankAuthorisationCreateRequest withLinksBillingRequest(String billingRequ /** * URL that the payer can be redirected to after authorising the payment. * - * On completion of bank authorisation, the query parameter of either `outcome=success` or - * `outcome=failure` will be appended to the `redirect_uri` to indicate the result of the - * bank authorisation. If the bank authorisation is expired, the query parameter - * `outcome=timeout` will be appended to the `redirect_uri`, in which case you should prompt - * the user to try the bank authorisation step again. + * On completion of bank authorisation, the query parameter of either + * outcome=success or outcome=failure will be appended to the + * redirect_uri to indicate the result of the bank authorisation. If the bank + * authorisation is expired, the query parameter outcome=timeout will be + * appended to the redirect_uri, in which case you should prompt the user to + * try the bank authorisation step again. * - * Please note: bank authorisations can still fail despite an `outcome=success` on the - * `redirect_uri`. It is therefore recommended to wait for the relevant bank authorisation - * event, such as - * [`BANK_AUTHORISATION_AUTHORISED`](#billing-request-bankauthorisationauthorised), - * [`BANK_AUTHORISATION_DENIED`](#billing-request-bankauthorisationdenied), or - * [`BANK_AUTHORISATION_FAILED`](#billing-request-bankauthorisationfailed) in order to show - * the correct outcome to the user. + * Please note: bank authorisations can still fail despite an outcome=success + * on the redirect_uri. It is therefore recommended to wait for the relevant + * bank authorisation event, such as BANK_AUTHORISATION_AUTHORISED, + * BANK_AUTHORISATION_DENIED, + * or BANK_AUTHORISATION_FAILED + * in order to show the correct outcome to the user. * - * The BillingRequestFlow ID will also be appended to the `redirect_uri` as query parameter - * `id=BRF123`. + * The BillingRequestFlow ID will also be appended to the redirect_uri as query + * parameter id=BRF123. * - * Defaults to `https://pay.gocardless.com/billing/static/thankyou`. + * Defaults to https://pay.gocardless.com/billing/static/thankyou. */ public BankAuthorisationCreateRequest withRedirectUri(String redirectUri) { this.redirectUri = redirectUri; @@ -141,8 +145,9 @@ public static class Links { private String billingRequest; /** - * ID of the [billing request](#billing-requests-billing-requests) against which this - * authorisation was created. + * ID of the billing + * request against which this authorisation was created. */ public Links withBillingRequest(String billingRequest) { this.billingRequest = billingRequest; diff --git a/src/main/java/com/gocardless/services/BankDetailsLookupService.java b/src/main/java/com/gocardless/services/BankDetailsLookupService.java index 7e86c1da..f2664a58 100644 --- a/src/main/java/com/gocardless/services/BankDetailsLookupService.java +++ b/src/main/java/com/gocardless/services/BankDetailsLookupService.java @@ -28,21 +28,23 @@ public BankDetailsLookupService(HttpClient httpClient) { * a sort code or an iban are already present), we verify that the account holder name and bank * account number match the details held by the relevant bank. * - * If your request returns an [error](#api-usage-errors) or the `available_debit_schemes` - * attribute is an empty array, you will not be able to collect payments from the specified bank - * account. GoCardless may be able to collect payments from an account even if no `bic` is - * returned. + * If your request returns an + * error or the + * available_debit_schemes attribute is an empty array, you will not be able to + * collect payments from the specified bank account. GoCardless may be able to collect payments + * from an account even if no bic is returned. * - * Bank account details may be supplied using [local details](#appendix-local-bank-details) or - * an IBAN. + * Bank account details may be supplied using + * local + * details or an IBAN. * - * _ACH scheme_ For compliance reasons, an extra validation step is done using a third-party - * provider to make sure the customer's bank account can accept Direct Debit. If a bank account - * is discovered to be closed or invalid, the customer is requested to adjust the account - * number/routing number and succeed in this check to continue with the flow. + * ACH scheme For compliance reasons, an extra validation step is done using a + * third-party provider to make sure the customer's bank account can accept Direct Debit. If a + * bank account is discovered to be closed or invalid, the customer is requested to adjust the + * account number/routing number and succeed in this check to continue with the flow. * - * _Note:_ Usage of this endpoint is monitored. If your organisation relies on GoCardless for - * modulus or reachability checking but not for payment collection, please get in touch. + * Note: Usage of this endpoint is monitored. If your organisation relies on GoCardless + * for modulus or reachability checking but not for payment collection, please get in touch. */ public BankDetailsLookupCreateRequest create() { return new BankDetailsLookupCreateRequest(httpClient); @@ -58,21 +60,23 @@ public BankDetailsLookupCreateRequest create() { * a sort code or an iban are already present), we verify that the account holder name and bank * account number match the details held by the relevant bank. * - * If your request returns an [error](#api-usage-errors) or the `available_debit_schemes` - * attribute is an empty array, you will not be able to collect payments from the specified bank - * account. GoCardless may be able to collect payments from an account even if no `bic` is - * returned. + * If your request returns an + * error or the + * available_debit_schemes attribute is an empty array, you will not be able to + * collect payments from the specified bank account. GoCardless may be able to collect payments + * from an account even if no bic is returned. * - * Bank account details may be supplied using [local details](#appendix-local-bank-details) or - * an IBAN. + * Bank account details may be supplied using + * local + * details or an IBAN. * - * _ACH scheme_ For compliance reasons, an extra validation step is done using a third-party - * provider to make sure the customer's bank account can accept Direct Debit. If a bank account - * is discovered to be closed or invalid, the customer is requested to adjust the account - * number/routing number and succeed in this check to continue with the flow. + * ACH scheme For compliance reasons, an extra validation step is done using a + * third-party provider to make sure the customer's bank account can accept Direct Debit. If a + * bank account is discovered to be closed or invalid, the customer is requested to adjust the + * account number/routing number and succeed in this check to continue with the flow. * - * _Note:_ Usage of this endpoint is monitored. If your organisation relies on GoCardless for - * modulus or reachability checking but not for payment collection, please get in touch. + * Note: Usage of this endpoint is monitored. If your organisation relies on GoCardless + * for modulus or reachability checking but not for payment collection, please get in touch. */ public static final class BankDetailsLookupCreateRequest extends PostRequest { @@ -93,8 +97,9 @@ public BankDetailsLookupCreateRequest withAccountHolderName(String accountHolder } /** - * Bank account number - see [local details](#appendix-local-bank-details) for more - * information. Alternatively you can provide an `iban`. + * Bank account number - see local + * details for more information. Alternatively you can provide an iban. */ public BankDetailsLookupCreateRequest withAccountNumber(String accountNumber) { this.accountNumber = accountNumber; @@ -102,8 +107,9 @@ public BankDetailsLookupCreateRequest withAccountNumber(String accountNumber) { } /** - * Bank code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Bank code - see local + * details for more information. Alternatively you can provide an iban. */ public BankDetailsLookupCreateRequest withBankCode(String bankCode) { this.bankCode = bankCode; @@ -111,8 +117,9 @@ public BankDetailsLookupCreateRequest withBankCode(String bankCode) { } /** - * Branch code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Branch code - see local + * details for more information. Alternatively you can provide an iban. */ public BankDetailsLookupCreateRequest withBranchCode(String branchCode) { this.branchCode = branchCode; @@ -120,9 +127,9 @@ public BankDetailsLookupCreateRequest withBranchCode(String branchCode) { } /** - * [ISO - * 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) - * alpha-2 code. Must be provided if specifying local details. + * ISO + * 3166-1 alpha-2 code. Must be provided if specifying local details. */ public BankDetailsLookupCreateRequest withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -130,8 +137,9 @@ public BankDetailsLookupCreateRequest withCountryCode(String countryCode) { } /** - * International Bank Account Number. Alternatively you can provide [local - * details](#appendix-local-bank-details). + * International Bank Account Number. Alternatively you can provide local + * details. */ public BankDetailsLookupCreateRequest withIban(String iban) { this.iban = iban; diff --git a/src/main/java/com/gocardless/services/BillingRequestFlowService.java b/src/main/java/com/gocardless/services/BillingRequestFlowService.java index 8c0dd055..df6022ab 100644 --- a/src/main/java/com/gocardless/services/BillingRequestFlowService.java +++ b/src/main/java/com/gocardless/services/BillingRequestFlowService.java @@ -90,8 +90,8 @@ public BillingRequestFlowCreateRequest withExitUri(String exitUri) { } /** - * Sets the default language of the Billing Request Flow and the customer. [ISO - * 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code. + * Sets the default language of the Billing Request Flow and the customer. + * ISO 639-1 code. */ public BillingRequestFlowCreateRequest withLanguage(String language) { this.language = language; @@ -104,8 +104,9 @@ public BillingRequestFlowCreateRequest withLinks(Links links) { } /** - * ID of the [billing request](#billing-requests-billing-requests) against which this flow - * was created. + * ID of the billing + * request against which this flow was created. */ public BillingRequestFlowCreateRequest withLinksBillingRequest(String billingRequest) { if (links == null) { @@ -122,7 +123,6 @@ public BillingRequestFlowCreateRequest withLinksBillingRequest(String billingReq * * You can only lock bank account if these have already been completed as a part of the * billing request. - * */ public BillingRequestFlowCreateRequest withLockBankAccount(Boolean lockBankAccount) { this.lockBankAccount = lockBankAccount; @@ -146,7 +146,6 @@ public BillingRequestFlowCreateRequest withLockCurrency(Boolean lockCurrency) { * * You can only lock customer details if these have already been completed as a part of the * billing request. - * */ public BillingRequestFlowCreateRequest withLockCustomerDetails( Boolean lockCustomerDetails) { @@ -167,8 +166,9 @@ public BillingRequestFlowCreateRequest withPrefilledBankAccount( /** * Bank account type 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. + * accounts in other currencies. See local + * details for more information. */ public BillingRequestFlowCreateRequest withPrefilledBankAccountAccountType( PrefilledBankAccount.AccountType accountType) { @@ -238,8 +238,8 @@ public BillingRequestFlowCreateRequest withPrefilledCustomerCity(String city) { } /** - * Customer's company name. Company name should only be provided if `given_name` and - * `family_name` are null. + * Customer's company name. Company name should only be provided if given_name + * and family_name are null. */ public BillingRequestFlowCreateRequest withPrefilledCustomerCompanyName( String companyName) { @@ -251,8 +251,9 @@ public BillingRequestFlowCreateRequest withPrefilledCustomerCompanyName( } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public BillingRequestFlowCreateRequest withPrefilledCustomerCountryCode( String countryCode) { @@ -418,8 +419,9 @@ public static class Links { private String billingRequest; /** - * ID of the [billing request](#billing-requests-billing-requests) against which this - * flow was created. + * ID of the billing + * request against which this flow was created. */ public Links withBillingRequest(String billingRequest) { this.billingRequest = billingRequest; @@ -432,8 +434,9 @@ public static class PrefilledBankAccount { /** * Bank account type 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. + * accounts in other currencies. See local + * details for more information. */ public PrefilledBankAccount withAccountType(AccountType accountType) { this.accountType = accountType; @@ -501,8 +504,8 @@ public PrefilledCustomer withCity(String city) { } /** - * Customer's company name. Company name should only be provided if `given_name` and - * `family_name` are null. + * Customer's company name. Company name should only be provided if + * given_name and family_name are null. */ public PrefilledCustomer withCompanyName(String companyName) { this.companyName = companyName; @@ -510,8 +513,9 @@ public PrefilledCustomer withCompanyName(String companyName) { } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public PrefilledCustomer withCountryCode(String countryCode) { this.countryCode = countryCode; diff --git a/src/main/java/com/gocardless/services/BillingRequestService.java b/src/main/java/com/gocardless/services/BillingRequestService.java index c3ae4839..c7617a42 100644 --- a/src/main/java/com/gocardless/services/BillingRequestService.java +++ b/src/main/java/com/gocardless/services/BillingRequestService.java @@ -16,12 +16,11 @@ * of required input might be additional customer billing details, while an action would be asking a * customer to authorise a payment using their mobile banking app. * - * See [Billing Requests: - * Overview](https://developer.gocardless.com/getting-started/billing-requests/overview/) for - * how-to's, explanations and tutorials. + * See Billing + * Requests: Overview for how-to's, explanations and tutorials. *

- * Important: All properties associated with `subscription_request` and - * `instalment_schedule_request` are only supported for ACH and PAD schemes. + * Important: All properties associated with subscription_request and + * instalment_schedule_request are only supported for ACH and PAD schemes. *

*/ public class BillingRequestService { @@ -37,8 +36,8 @@ public BillingRequestService(HttpClient httpClient) { /** *

- * Important: All properties associated with `subscription_request` and - * `instalment_schedule_request` are only supported for ACH and PAD schemes. + * Important: All properties associated with subscription_request + * and instalment_schedule_request are only supported for ACH and PAD schemes. *

*/ public BillingRequestCreateRequest create() { @@ -69,15 +68,15 @@ public BillingRequestCollectCustomerDetailsRequest collectCustomerDetails(String * If the scheme is PayTo and the pay_id is available, this can be included in the payload along * with the country_code. * - * _ACH scheme_ For compliance reasons, an extra validation step is done using a third-party - * provider to make sure the customer's bank account can accept Direct Debit. If a bank account - * is discovered to be closed or invalid, the customer is requested to adjust the account - * number/routing number and succeed in this check to continue with the flow. + * ACH scheme For compliance reasons, an extra validation step is done using a + * third-party provider to make sure the customer's bank account can accept Direct Debit. If a + * bank account is discovered to be closed or invalid, the customer is requested to adjust the + * account number/routing number and succeed in this check to continue with the flow. * - * _BACS scheme_ [Payer Name - * Verification](https://hub.gocardless.com/s/article/Introduction-to-Payer-Name-Verification?language=en_GB) - * is enabled by default for UK based bank accounts, meaning we verify the account holder name - * and bank account number match the details held by the relevant bank. + * BACS scheme Payer + * Name Verification is enabled by default for UK based bank accounts, meaning we verify the + * account holder name and bank account number match the details held by the relevant bank. */ public BillingRequestCollectBankAccountRequest collectBankAccount(String identity) { return new BillingRequestCollectBankAccountRequest(httpClient, identity); @@ -107,7 +106,9 @@ public BillingRequestCancelRequest cancel(String identity) { } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your billing requests. + * Returns a cursor-paginated + * list of your billing requests. */ public BillingRequestListRequest> list() { return new BillingRequestListRequest<>(httpClient, @@ -165,8 +166,8 @@ public BillingRequestSelectInstitutionRequest selectInstitution(String identity) * Request class for {@link BillingRequestService#create }. * *

- * Important: All properties associated with `subscription_request` and - * `instalment_schedule_request` are only supported for ACH and PAD schemes. + * Important: All properties associated with subscription_request + * and instalment_schedule_request are only supported for ACH and PAD schemes. *

*/ public static final class BillingRequestCreateRequest @@ -186,9 +187,9 @@ public static final class BillingRequestCreateRequest * (Optional) If true, this billing request can fallback from instant payment to direct * debit. Should not be set if GoCardless payment intelligence feature is used. * - * See [Billing Requests: Retain customers with - * Fallbacks](https://developer.gocardless.com/billing-requests/retain-customers-with-fallbacks/) - * for more information. + * See Billing + * Requests: Retain customers with Fallbacks for more information. */ public BillingRequestCreateRequest withFallbackEnabled(Boolean fallbackEnabled) { this.fallbackEnabled = fallbackEnabled; @@ -215,8 +216,8 @@ public BillingRequestCreateRequest withInstalmentScheduleRequestAppFee(Integer a } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "USD" and "CAD" are supported. + * ISO 4217 currency code. + * Currently "USD" and "CAD" are supported. */ public BillingRequestCreateRequest withInstalmentScheduleRequestCurrency(String currency) { if (instalmentScheduleRequest == null) { @@ -227,8 +228,10 @@ public BillingRequestCreateRequest withInstalmentScheduleRequestCurrency(String } /** - * An explicit array of instalment payments, each specifying at least an `amount` and - * `charge_date`. See [create (with dates)](#instalment-schedules-create-with-dates) + * An explicit array of instalment payments, each specifying at least an amount + * and charge_date. See create + * (with dates) */ public BillingRequestCreateRequest withInstalmentScheduleRequestInstalmentsWithDates( List instalmentsWithDates) { @@ -241,9 +244,9 @@ public BillingRequestCreateRequest withInstalmentScheduleRequestInstalmentsWithD /** * Frequency of the payments you want to create, together with an array of payment amounts - * to be collected, with a specified start date for the first payment. See [create (with - * schedule)](#instalment-schedules-create-with-schedule) - * + * to be collected, with a specified start date for the first payment. See create + * (with schedule) */ public BillingRequestCreateRequest withInstalmentScheduleRequestInstalmentsWithSchedule( InstalmentsWithSchedule instalmentsWithSchedule) { @@ -281,8 +284,10 @@ public BillingRequestCreateRequest withInstalmentScheduleRequestName(String name /** * An optional payment reference. This will be set as the reference on each payment created - * and will appear on your customer's bank statement. See the documentation for the [create - * payment endpoint](#payments-create-a-payment) for more details.
+ * and will appear on your customer's bank statement. See the documentation for the create + * payment endpoint for more details.
+ *
*/ public BillingRequestCreateRequest withInstalmentScheduleRequestPaymentReference( String paymentReference) { @@ -294,11 +299,12 @@ public BillingRequestCreateRequest withInstalmentScheduleRequestPaymentReference } /** - * On failure, automatically retry payments using [intelligent - * retries](/success-plus/overview). Default is `false`. + * On failure, automatically retry payments using + * intelligent retries. + * Default is false. *

* Important: To be able to use intelligent retries, Success+ needs to be - * enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus). + * enabled in GoCardless dashboard. *

*/ public BillingRequestCreateRequest withInstalmentScheduleRequestRetryIfPossible( @@ -331,8 +337,9 @@ public BillingRequestCreateRequest withLinks(Links links) { } /** - * ID of the associated [creditor](#core-endpoints-creditors). Only required if your account - * manages multiple creditors. + * ID of the associated creditor. + * Only required if your account manages multiple creditors. */ public BillingRequestCreateRequest withLinksCreditor(String creditor) { if (links == null) { @@ -343,8 +350,9 @@ public BillingRequestCreateRequest withLinksCreditor(String creditor) { } /** - * ID of the [customer](#core-endpoints-customers) against which this request should be - * made. + * ID of the customer + * against which this request should be made. */ public BillingRequestCreateRequest withLinksCustomer(String customer) { if (links == null) { @@ -355,9 +363,9 @@ public BillingRequestCreateRequest withLinksCustomer(String customer) { } /** - * (Optional) ID of the [customer_bank_account](#core-endpoints-customer-bank-accounts) + * (Optional) ID of the customer_bank_account * against which this request should be made. - * */ public BillingRequestCreateRequest withLinksCustomerBankAccount( String customerBankAccount) { @@ -374,14 +382,13 @@ public BillingRequestCreateRequest withMandateRequest(MandateRequest mandateRequ } /** - * This field is ACH specific, sometimes referred to as [SEC - * code](https://www.moderntreasury.com/learn/sec-codes). + * This field is ACH specific, sometimes referred to as + * SEC code. * * This is the way that the payer gives authorisation to the merchant. web: Authorisation is * Internet Initiated or via Mobile Entry (maps to SEC code: WEB) telephone: Authorisation * is provided orally over telephone (maps to SEC code: TEL) paper: Authorisation is * provided in writing and signed, or similarly authenticated (maps to SEC code: PPD) - * */ public BillingRequestCreateRequest withMandateRequestAuthorisationSource( MandateRequest.AuthorisationSource authorisationSource) { @@ -394,9 +401,9 @@ public BillingRequestCreateRequest withMandateRequestAuthorisationSource( /** * This attribute represents the authorisation type between the payer and merchant. It can - * be set to `one_off`, `recurring` or `standing` for ACH scheme. And `single`, `recurring` - * and `sporadic` for PAD scheme. _Note:_ This is only supported for ACH and PAD schemes. - * + * be set to one_off, recurring or standing for ACH + * scheme. And single, recurring and sporadic for PAD + * scheme. Note: This is only supported for ACH and PAD schemes. */ public BillingRequestCreateRequest withMandateRequestConsentType(String consentType) { if (mandateRequest == null) { @@ -419,7 +426,7 @@ public BillingRequestCreateRequest withMandateRequestConstraints(Constraints con } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. + * ISO 4217 currency code. */ public BillingRequestCreateRequest withMandateRequestCurrency(String currency) { if (mandateRequest == null) { @@ -432,7 +439,6 @@ public BillingRequestCreateRequest withMandateRequestCurrency(String currency) { /** * A human-readable description of the payment and/or mandate. This will be displayed to the * payer when authorising the billing request. - * */ public BillingRequestCreateRequest withMandateRequestDescription(String description) { if (mandateRequest == null) { @@ -445,10 +451,12 @@ public BillingRequestCreateRequest withMandateRequestDescription(String descript /** * This field will decide how GoCardless handles settlement of funds from the customer. * - * - `managed` will be moved through GoCardless' account, batched, and payed out. - `direct` - * will be a direct transfer from the payer's account to the merchant where invoicing will - * be handled separately. - * + *
    + *
  • managed will be moved through GoCardless' account, batched, and payed + * out.
  • + *
  • direct will be a direct transfer from the payer's account to the + * merchant where invoicing will be handled separately.
  • + *
*/ public BillingRequestCreateRequest withMandateRequestFundsSettlement( MandateRequest.FundsSettlement fundsSettlement) { @@ -473,9 +481,10 @@ public BillingRequestCreateRequest withMandateRequestMetadata( } /** - * Unique reference. Different schemes have different length and [character - * set](#appendix-character-sets) requirements. GoCardless will generate a unique reference - * satisfying the different scheme requirements if this field is left blank. + * Unique reference. Different schemes have different length and character + * set requirements. GoCardless will generate a unique reference satisfying the + * different scheme requirements if this field is left blank. */ public BillingRequestCreateRequest withMandateRequestReference(String reference) { if (mandateRequest == null) { @@ -514,26 +523,29 @@ public BillingRequestCreateRequest withMandateRequestSweeping(Boolean sweeping) /** * Verification preference for the mandate. One of: + * *
    - *
  • `minimum`: only verify if absolutely required, such as when part of scheme rules
  • - *
  • `recommended`: in addition to `minimum`, use the GoCardless payment intelligence - * solution to decide if a payer should be verified
  • - *
  • `when_available`: if verification mechanisms are available, use them
  • - *
  • `always`: as `when_available`, but fail to create the Billing Request if a mechanism - * isn't available
  • + *
  • minimum: only verify if absolutely required, such as when part of scheme + * rules
  • + *
  • recommended: in addition to minimum, use the GoCardless + * payment intelligence solution to decide if a payer should be verified
  • + *
  • when_available: if verification mechanisms are available, use them
  • + *
  • always: as when_available, but fail to create the Billing + * Request if a mechanism isn't available
  • *
- * - * By default, all Billing Requests use the `recommended` verification preference. It uses - * GoCardless payment intelligence solution to determine if a payer is fraudulent or not. - * The verification mechanism is based on the response and the payer may be asked to verify - * themselves. If the feature is not available, `recommended` behaves like `minimum`. + * By default, all Billing Requests use the recommended verification + * preference. It uses GoCardless payment intelligence solution to determine if a payer is + * fraudulent or not. The verification mechanism is based on the response and the payer may + * be asked to verify themselves. If the feature is not available, recommended + * behaves like minimum. * * If you never wish to take advantage of our reduced risk products and Verified Mandates as - * they are released in new schemes, please use the `minimum` verification preference. + * they are released in new schemes, please use the minimum verification + * preference. * - * See [Billing Requests: Creating Verified - * Mandates](https://developer.gocardless.com/getting-started/billing-requests/verified-mandates/) - * for more information. + * See Billing + * Requests: Creating Verified Mandates for more information. */ public BillingRequestCreateRequest withMandateRequestVerify(MandateRequest.Verify verify) { if (mandateRequest == null) { @@ -579,9 +591,9 @@ public BillingRequestCreateRequest withPaymentContextCode( /** * Specifies the underlying purpose of the payment. Defines the specific reason or type of * service/goods the payment relates to, improving straight-through processing and - * compliance. See [VRP Commercial Payment Purpose - * Codes](https://developer.gocardless.com/vrp-commercial-payment-purpose-codes/) for the - * complete list of valid codes. + * compliance. See + * VRP + * Commercial Payment Purpose Codes for the complete list of valid codes. */ public BillingRequestCreateRequest withPaymentPurposeCode(String paymentPurposeCode) { this.paymentPurposeCode = paymentPurposeCode; @@ -618,9 +630,9 @@ public BillingRequestCreateRequest withPaymentRequestAppFee(Integer appFee) { } /** - * [ISO 4217](https://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 - * supported Eurozone countries only. + * ISO 4217 currency code. + * GBP and EUR supported; GBP with your customers in + * the UK and for EUR with your customers in supported Eurozone countries only. */ public BillingRequestCreateRequest withPaymentRequestCurrency(String currency) { if (paymentRequest == null) { @@ -633,7 +645,6 @@ public BillingRequestCreateRequest withPaymentRequestCurrency(String currency) { /** * A human-readable description of the payment and/or mandate. This will be displayed to the * payer when authorising the billing request. - * */ public BillingRequestCreateRequest withPaymentRequestDescription(String description) { if (paymentRequest == null) { @@ -646,10 +657,12 @@ public BillingRequestCreateRequest withPaymentRequestDescription(String descript /** * This field will decide how GoCardless handles settlement of funds from the customer. * - * - `managed` will be moved through GoCardless' account, batched, and payed out. - `direct` - * will be a direct transfer from the payer's account to the merchant where invoicing will - * be handled separately. - * + *
    + *
  • managed will be moved through GoCardless' account, batched, and payed + * out.
  • + *
  • direct will be a direct transfer from the payer's account to the + * merchant where invoicing will be handled separately.
  • + *
*/ public BillingRequestCreateRequest withPaymentRequestFundsSettlement( PaymentRequest.FundsSettlement fundsSettlement) { @@ -677,7 +690,6 @@ public BillingRequestCreateRequest withPaymentRequestMetadata( * A custom payment reference defined by the merchant. It is only available for payments on * the PayTo scheme or payments using the Direct Funds settlement model on the Faster * Payments scheme. - * */ public BillingRequestCreateRequest withPaymentRequestReference(String reference) { if (paymentRequest == null) { @@ -688,11 +700,12 @@ public BillingRequestCreateRequest withPaymentRequestReference(String reference) } /** - * On failure, automatically retry payments using [intelligent - * retries](/success-plus/overview). Default is `false`. + * On failure, automatically retry payments using + * intelligent retries. + * Default is false. *

* Important: To be able to use intelligent retries, Success+ needs to be - * enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus). + * enabled in GoCardless dashboard. *

*

* Important: This is not applicable to Pay by Bank and VRP payments. @@ -708,11 +721,12 @@ public BillingRequestCreateRequest withPaymentRequestRetryIfPossible( } /** - * (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 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. + * (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 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. */ public BillingRequestCreateRequest withPaymentRequestScheme(String scheme) { if (paymentRequest == null) { @@ -725,9 +739,9 @@ public BillingRequestCreateRequest withPaymentRequestScheme(String scheme) { /** * Specifies the high-level purpose/category of a mandate and/or payment using a set of * pre-defined categories. Provides context on the nature and reason for the payment to - * facilitate processing and compliance. See [Billing Request Purpose - * Codes](https://developer.gocardless.com/billing-request-purpose-codes/) for the complete - * list of valid codes. + * facilitate processing and compliance. See + * Billing Request + * Purpose Codes for the complete list of valid codes. */ public BillingRequestCreateRequest withPurposeCode(PurposeCode purposeCode) { this.purposeCode = purposeCode; @@ -776,8 +790,8 @@ public BillingRequestCreateRequest withSubscriptionRequestCount(Integer count) { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public BillingRequestCreateRequest withSubscriptionRequestCurrency(String currency) { if (subscriptionRequest == null) { @@ -788,8 +802,11 @@ public BillingRequestCreateRequest withSubscriptionRequestCurrency(String curren } /** - * As per RFC 2445. The day of the month to charge customers on. `1`-`28` or `-1` to - * indicate the last day of the month. + * As per RFC 2445. The day of the month to charge customers on. 1 + *

    + *
  • + *
+ * 28 or -1 to indicate the last day of the month. */ public BillingRequestCreateRequest withSubscriptionRequestDayOfMonth(Integer dayOfMonth) { if (subscriptionRequest == null) { @@ -800,8 +817,9 @@ public BillingRequestCreateRequest withSubscriptionRequestDayOfMonth(Integer day } /** - * Number of `interval_units` between customer charge dates. Must be greater than or equal - * to `1`. Must result in at least one charge date per year. Defaults to `1`. + * Number of interval_units between customer charge dates. Must be greater than + * or equal to 1. Must result in at least one charge date per year. Defaults to + * 1. */ public BillingRequestCreateRequest withSubscriptionRequestInterval(Integer interval) { if (subscriptionRequest == null) { @@ -812,7 +830,8 @@ public BillingRequestCreateRequest withSubscriptionRequestInterval(Integer inter } /** - * The unit of time between customer charge dates. One of `weekly`, `monthly` or `yearly`. + * The unit of time between customer charge dates. One of weekly, + * monthly or yearly. */ public BillingRequestCreateRequest withSubscriptionRequestIntervalUnit( SubscriptionRequest.IntervalUnit intervalUnit) { @@ -838,8 +857,7 @@ public BillingRequestCreateRequest withSubscriptionRequestMetadata( /** * Name of the month on which to charge a customer. Must be lowercase. Only applies when the - * interval_unit is `yearly`. - * + * interval_unit is yearly. */ public BillingRequestCreateRequest withSubscriptionRequestMonth( SubscriptionRequest.Month month) { @@ -864,8 +882,10 @@ public BillingRequestCreateRequest withSubscriptionRequestName(String name) { /** * An optional payment reference. This will be set as the reference on each payment created - * and will appear on your customer's bank statement. See the documentation for the [create - * payment endpoint](#payments-create-a-payment) for more details.
+ * and will appear on your customer's bank statement. See the documentation for the create + * payment endpoint for more details.
+ *
*/ public BillingRequestCreateRequest withSubscriptionRequestPaymentReference( String paymentReference) { @@ -877,11 +897,12 @@ public BillingRequestCreateRequest withSubscriptionRequestPaymentReference( } /** - * On failure, automatically retry payments using [intelligent - * retries](/success-plus/overview). Default is `false`. + * On failure, automatically retry payments using + * intelligent retries. + * Default is false. *

* Important: To be able to use intelligent retries, Success+ needs to be - * enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus). + * enabled in GoCardless dashboard. *

*/ public BillingRequestCreateRequest withSubscriptionRequestRetryIfPossible( @@ -895,11 +916,11 @@ public BillingRequestCreateRequest withSubscriptionRequestRetryIfPossible( /** * The date on which the first payment should be charged. If fulfilled after this date, this - * will be set as the mandate's `next_possible_charge_date`. When left blank and `month` or - * `day_of_month` are provided, this will be set to the date of the first payment. If - * created without `month` or `day_of_month` this will be set as the mandate's - * `next_possible_charge_date`. - * + * will be set as the mandate's next_possible_charge_date. When left blank and + * month or day_of_month are provided, this will be set to the + * date of the first payment. If created without month or + * day_of_month this will be set as the mandate's + * next_possible_charge_date. */ public BillingRequestCreateRequest withSubscriptionRequestStartDate(String startDate) { if (subscriptionRequest == null) { @@ -1041,6 +1062,14 @@ public static class InstalmentsWithDates { /** * Amount, in the lowest denomination for the currency (e.g. pence in GBP, cents in * EUR). + * + * Minimum and maximum amounts vary by payment scheme. For more information, see + * Transaction + * limits + * + * For Variable Recurring Payments (VRP), this must not exceed the mandate's + * max_amount_per_payment constraint. */ public InstalmentsWithDates withAmount(Integer amount) { this.amount = amount; @@ -1049,8 +1078,9 @@ public InstalmentsWithDates withAmount(Integer amount) { /** * A future date on which the payment should be collected. If the date is before the - * next_possible_charge_date on the [mandate](#core-endpoints-mandates), it will be - * automatically rolled forwards to that date. + * next_possible_charge_date on the mandate, + * it will be automatically rolled forwards to that date. */ public InstalmentsWithDates withChargeDate(String chargeDate) { this.chargeDate = chargeDate; @@ -1060,8 +1090,9 @@ public InstalmentsWithDates withChargeDate(String chargeDate) { /** * A human-readable description of the payment. This will be included in the * notification email GoCardless sends to your customer if your organisation does not - * send its own notifications (see [compliance - * requirements](#appendix-compliance-requirements)). + * send its own notifications (see compliance + * requirements). */ public InstalmentsWithDates withDescription(String description) { this.description = description; @@ -1092,7 +1123,6 @@ public static class InstalmentsWithSchedule { /** * List of amounts of each instalment, in the lowest denomination for the currency (e.g. * cents in USD). - * */ public InstalmentsWithSchedule withAmounts(List amounts) { this.amounts = amounts; @@ -1100,9 +1130,8 @@ public InstalmentsWithSchedule withAmounts(List amounts) { } /** - * Number of `interval_units` between charge dates. Must be greater than or equal to - * `1`. - * + * Number of interval_units between charge dates. Must be greater than or + * equal to 1. */ public InstalmentsWithSchedule withInterval(Integer interval) { this.interval = interval; @@ -1110,8 +1139,8 @@ public InstalmentsWithSchedule withInterval(Integer interval) { } /** - * The unit of time between customer charge dates. One of `weekly`, `monthly` or - * `yearly`. + * The unit of time between customer charge dates. One of weekly, + * monthly or yearly. */ public InstalmentsWithSchedule withIntervalUnit(IntervalUnit intervalUnit) { this.intervalUnit = intervalUnit; @@ -1120,10 +1149,12 @@ public InstalmentsWithSchedule withIntervalUnit(IntervalUnit intervalUnit) { /** * The date on which the first payment should be charged. Must be on or after the - * [mandate](#core-endpoints-mandates)'s `next_possible_charge_date`. When left blank - * and `month` or `day_of_month` are provided, this will be set to the date of the first - * payment. If created without `month` or `day_of_month` this will be set as the - * mandate's `next_possible_charge_date` + * mandate's + * next_possible_charge_date. When left blank and month or + * day_of_month are provided, this will be set to the date of the first + * payment. If created without month or day_of_month this will + * be set as the mandate's next_possible_charge_date */ public InstalmentsWithSchedule withStartDate(String startDate) { this.startDate = startDate; @@ -1183,8 +1214,8 @@ public InstalmentScheduleRequest withAppFee(Integer appFee) { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. - * Currently "USD" and "CAD" are supported. + * ISO 4217 currency + * code. Currently "USD" and "CAD" are supported. */ public InstalmentScheduleRequest withCurrency(String currency) { this.currency = currency; @@ -1192,8 +1223,10 @@ public InstalmentScheduleRequest withCurrency(String currency) { } /** - * An explicit array of instalment payments, each specifying at least an `amount` and - * `charge_date`. See [create (with dates)](#instalment-schedules-create-with-dates) + * An explicit array of instalment payments, each specifying at least an + * amount and charge_date. See create + * (with dates) */ public InstalmentScheduleRequest withInstalmentsWithDates( List instalmentsWithDates) { @@ -1204,8 +1237,9 @@ public InstalmentScheduleRequest withInstalmentsWithDates( /** * Frequency of the payments you want to create, together with an array of payment * amounts to be collected, with a specified start date for the first payment. See - * [create (with schedule)](#instalment-schedules-create-with-schedule) - * + * create + * (with schedule) */ public InstalmentScheduleRequest withInstalmentsWithSchedule( InstalmentsWithSchedule instalmentsWithSchedule) { @@ -1234,7 +1268,10 @@ public InstalmentScheduleRequest withName(String name) { /** * An optional payment reference. This will be set as the reference on each payment * created and will appear on your customer's bank statement. See the documentation for - * the [create payment endpoint](#payments-create-a-payment) for more details.
+ * the create + * payment endpoint for more details.
+ *
*/ public InstalmentScheduleRequest withPaymentReference(String paymentReference) { this.paymentReference = paymentReference; @@ -1242,11 +1279,13 @@ public InstalmentScheduleRequest withPaymentReference(String paymentReference) { } /** - * On failure, automatically retry payments using [intelligent - * retries](/success-plus/overview). Default is `false`. + * On failure, automatically retry payments using + * intelligent + * retries. Default is false. *

* Important: To be able to use intelligent retries, Success+ needs to - * be enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus). + * be enabled in GoCardless + * dashboard. *

*/ public InstalmentScheduleRequest withRetryIfPossible(Boolean retryIfPossible) { @@ -1272,8 +1311,9 @@ public static class Links { private String customerBankAccount; /** - * ID of the associated [creditor](#core-endpoints-creditors). Only required if your - * account manages multiple creditors. + * ID of the associated creditor. + * Only required if your account manages multiple creditors. */ public Links withCreditor(String creditor) { this.creditor = creditor; @@ -1281,8 +1321,9 @@ public Links withCreditor(String creditor) { } /** - * ID of the [customer](#core-endpoints-customers) against which this request should be - * made. + * ID of the customer + * against which this request should be made. */ public Links withCustomer(String customer) { this.customer = customer; @@ -1290,9 +1331,9 @@ public Links withCustomer(String customer) { } /** - * (Optional) ID of the [customer_bank_account](#core-endpoints-customer-bank-accounts) + * (Optional) ID of the customer_bank_account * against which this request should be made. - * */ public Links withCustomerBankAccount(String customerBankAccount) { this.customerBankAccount = customerBankAccount; @@ -1307,15 +1348,27 @@ public static class PeriodicLimits { private Period period; /** - * The alignment of the period. + * The alignment of the period. Defaults to creation_date if not specified. * - * `calendar` - this will finish on the end of the current period. For example this will - * expire on the Monday for the current week or the January for the next year. + * calendar + *
    + *
  • the period follows fixed calendar boundaries, the same for every mandate:
  • + *
+ * week runs Monday to Sunday, month runs from the 1st to the + * last day of the calendar month, and year runs from 1 January to 31 + * December. If the mandate starts partway through a period, the limit for that first + * period is reduced proportionally to the days remaining (e.g. a monthly limit starting + * on the 15th gives roughly half the limit for that first month). * - * `creation_date` - this will finish on the next instance of the current period. For - * example Monthly it will expire on the same day of the next month, or yearly the same - * day of the next year. + * creation_date + *
    + *
  • the period follows the mandate's own start date rather than the calendar. For + * example, if the mandate starts on the 15th, each monthly period runs from the 15th to + * the 14th of the following month. The first period is a full period, not reduced + * proportionally.
  • + *
* + * Note: Has no effect when period is flexible. */ public PeriodicLimits withAlignment(Alignment alignment) { this.alignment = alignment; @@ -1323,9 +1376,9 @@ public PeriodicLimits withAlignment(Alignment alignment) { } /** - * The maximum number of payments that can be collected in this periodic limit. _Note:_ - * This is only supported for the PayTo scheme, where it is required. + * The maximum number of payments that can be collected in this periodic limit. * + * Note: Only supported for the PayTo scheme, where it is optional. */ public PeriodicLimits withMaxPayments(Integer maxPayments) { this.maxPayments = maxPayments; @@ -1333,9 +1386,10 @@ public PeriodicLimits withMaxPayments(Integer maxPayments) { } /** - * The maximum total amount that can be charged for all payments in this periodic limit. - * Required for VRP. + * The maximum total amount that can be charged for all payments in this periodic limit, + * in the lowest denomination for the currency (e.g. pence in GBP, cents in EUR). * + * Note: Required for VRP. This is not permitted for the PayTo scheme. */ public PeriodicLimits withMaxTotalAmount(Integer maxTotalAmount) { this.maxTotalAmount = maxTotalAmount; @@ -1343,8 +1397,9 @@ public PeriodicLimits withMaxTotalAmount(Integer maxTotalAmount) { } /** - * The repeating period for this mandate. Defaults to flexible for PayTo if not - * specified. + * The repeating period for this mandate. Required whenever a periodic limit is provided + * (for both VRP and PayTo). If periodic_limits is omitted entirely for PayTo, this + * defaults to flexible. */ public PeriodicLimits withPeriod(Period period) { this.period = period; @@ -1410,7 +1465,6 @@ public static class Constraints { * This is an optional field and if it is not supplied the agreement will be considered * open and will not have an end date. Keep in mind the end date must take into account * how long it will take the user to set up this agreement via the Billing Request. - * */ public Constraints withEndDate(String endDate) { this.endDate = endDate; @@ -1418,8 +1472,9 @@ public Constraints withEndDate(String endDate) { } /** - * The maximum amount that can be charged for a single payment. Required for PayTo and - * VRP. + * The maximum amount that can be charged for a single payment in the lowest + * denomination for the currency (e.g. pence in GBP, cents in EUR). Note: + * Required for PayTo and VRP. */ public Constraints withMaxAmountPerPayment(Integer maxAmountPerPayment) { this.maxAmountPerPayment = maxAmountPerPayment; @@ -1428,8 +1483,8 @@ public Constraints withMaxAmountPerPayment(Integer maxAmountPerPayment) { /** * A constraint where you can specify info (free text string) about how payments are - * calculated. _Note:_ This is only supported for ACH and PAD schemes. - * + * calculated. For use when payments vary and cannot be expressed as a fixed amount and + * frequency. Note: This is only supported for ACH and PAD schemes. */ public Constraints withPaymentMethod(String paymentMethod) { this.paymentMethod = paymentMethod; @@ -1437,7 +1492,12 @@ public Constraints withPaymentMethod(String paymentMethod) { } /** - * List of periodic limits and constraints which apply to them + * Caps on the total amount and/or number of payments that can be collected within a + * repeating period (e.g. no more than a set amount per month), as opposed to + * max_amount_per_payment which caps a single payment. + * + * Note: Required for VRP, where exactly one periodic limit must be provided. + * Optional for PayTo. */ public Constraints withPeriodicLimits(List periodicLimits) { this.periodicLimits = periodicLimits; @@ -1449,7 +1509,6 @@ public Constraints withPeriodicLimits(List periodicLimits) { * * This is an optional field and if it is not supplied the start date will be set to the * day authorisation happens. - * */ public Constraints withStartDate(String startDate) { this.startDate = startDate; @@ -1491,15 +1550,14 @@ public static class MandateRequest { private Verify verify; /** - * This field is ACH specific, sometimes referred to as [SEC - * code](https://www.moderntreasury.com/learn/sec-codes). + * This field is ACH specific, sometimes referred to as + * SEC code. * * This is the way that the payer gives authorisation to the merchant. web: * Authorisation is Internet Initiated or via Mobile Entry (maps to SEC code: WEB) * telephone: Authorisation is provided orally over telephone (maps to SEC code: TEL) * paper: Authorisation is provided in writing and signed, or similarly authenticated * (maps to SEC code: PPD) - * */ public MandateRequest withAuthorisationSource(AuthorisationSource authorisationSource) { this.authorisationSource = authorisationSource; @@ -1508,10 +1566,10 @@ public MandateRequest withAuthorisationSource(AuthorisationSource authorisationS /** * This attribute represents the authorisation type between the payer and merchant. It - * can be set to `one_off`, `recurring` or `standing` for ACH scheme. And `single`, - * `recurring` and `sporadic` for PAD scheme. _Note:_ This is only supported for ACH and - * PAD schemes. - * + * can be set to one_off, recurring or standing + * for ACH scheme. And single, recurring and + * sporadic for PAD scheme. Note: This is only supported for ACH + * and PAD schemes. */ public MandateRequest withConsentType(String consentType) { this.consentType = consentType; @@ -1528,7 +1586,8 @@ public MandateRequest withConstraints(Constraints constraints) { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. + * ISO 4217 currency + * code. */ public MandateRequest withCurrency(String currency) { this.currency = currency; @@ -1538,7 +1597,6 @@ public MandateRequest withCurrency(String currency) { /** * A human-readable description of the payment and/or mandate. This will be displayed to * the payer when authorising the billing request. - * */ public MandateRequest withDescription(String description) { this.description = description; @@ -1548,10 +1606,12 @@ public MandateRequest withDescription(String description) { /** * This field will decide how GoCardless handles settlement of funds from the customer. * - * - `managed` will be moved through GoCardless' account, batched, and payed out. - - * `direct` will be a direct transfer from the payer's account to the merchant where - * invoicing will be handled separately. - * + *
    + *
  • managed will be moved through GoCardless' account, batched, and + * payed out.
  • + *
  • direct will be a direct transfer from the payer's account to the + * merchant where invoicing will be handled separately.
  • + *
*/ public MandateRequest withFundsSettlement(FundsSettlement fundsSettlement) { this.fundsSettlement = fundsSettlement; @@ -1568,9 +1628,10 @@ public MandateRequest withMetadata(Map metadata) { } /** - * Unique reference. Different schemes have different length and [character - * set](#appendix-character-sets) requirements. GoCardless will generate a unique - * reference satisfying the different scheme requirements if this field is left blank. + * Unique reference. Different schemes have different length and character + * set requirements. GoCardless will generate a unique reference satisfying the + * different scheme requirements if this field is left blank. */ public MandateRequest withReference(String reference) { this.reference = reference; @@ -1600,29 +1661,30 @@ public MandateRequest withSweeping(Boolean sweeping) { /** * Verification preference for the mandate. One of: + * *
    - *
  • `minimum`: only verify if absolutely required, such as when part of scheme - * rules
  • - *
  • `recommended`: in addition to `minimum`, use the GoCardless payment intelligence - * solution to decide if a payer should be verified
  • - *
  • `when_available`: if verification mechanisms are available, use them
  • - *
  • `always`: as `when_available`, but fail to create the Billing Request if a - * mechanism isn't available
  • + *
  • minimum: only verify if absolutely required, such as when part of + * scheme rules
  • + *
  • recommended: in addition to minimum, use the GoCardless + * payment intelligence solution to decide if a payer should be verified
  • + *
  • when_available: if verification mechanisms are available, use + * them
  • + *
  • always: as when_available, but fail to create the + * Billing Request if a mechanism isn't available
  • *
- * - * By default, all Billing Requests use the `recommended` verification preference. It - * uses GoCardless payment intelligence solution to determine if a payer is fraudulent - * or not. The verification mechanism is based on the response and the payer may be - * asked to verify themselves. If the feature is not available, `recommended` behaves - * like `minimum`. + * By default, all Billing Requests use the recommended verification + * preference. It uses GoCardless payment intelligence solution to determine if a payer + * is fraudulent or not. The verification mechanism is based on the response and the + * payer may be asked to verify themselves. If the feature is not available, + * recommended behaves like minimum. * * If you never wish to take advantage of our reduced risk products and Verified - * Mandates as they are released in new schemes, please use the `minimum` verification - * preference. + * Mandates as they are released in new schemes, please use the minimum + * verification preference. * - * See [Billing Requests: Creating Verified - * Mandates](https://developer.gocardless.com/getting-started/billing-requests/verified-mandates/) - * for more information. + * See Billing + * Requests: Creating Verified Mandates for more information. */ public MandateRequest withVerify(Verify verify) { this.verify = verify; @@ -1699,9 +1761,10 @@ public PaymentRequest withAppFee(Integer appFee) { } /** - * [ISO 4217](https://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 supported Eurozone countries only. + * ISO 4217 currency + * code. GBP and EUR supported; GBP with your + * customers in the UK and for EUR with your customers in supported + * Eurozone countries only. */ public PaymentRequest withCurrency(String currency) { this.currency = currency; @@ -1711,7 +1774,6 @@ public PaymentRequest withCurrency(String currency) { /** * A human-readable description of the payment and/or mandate. This will be displayed to * the payer when authorising the billing request. - * */ public PaymentRequest withDescription(String description) { this.description = description; @@ -1721,10 +1783,12 @@ public PaymentRequest withDescription(String description) { /** * This field will decide how GoCardless handles settlement of funds from the customer. * - * - `managed` will be moved through GoCardless' account, batched, and payed out. - - * `direct` will be a direct transfer from the payer's account to the merchant where - * invoicing will be handled separately. - * + *
    + *
  • managed will be moved through GoCardless' account, batched, and + * payed out.
  • + *
  • direct will be a direct transfer from the payer's account to the + * merchant where invoicing will be handled separately.
  • + *
*/ public PaymentRequest withFundsSettlement(FundsSettlement fundsSettlement) { this.fundsSettlement = fundsSettlement; @@ -1744,7 +1808,6 @@ public PaymentRequest withMetadata(Map metadata) { * A custom payment reference defined by the merchant. It is only available for payments * on the PayTo scheme or payments using the Direct Funds settlement model on the Faster * Payments scheme. - * */ public PaymentRequest withReference(String reference) { this.reference = reference; @@ -1752,11 +1815,13 @@ public PaymentRequest withReference(String reference) { } /** - * On failure, automatically retry payments using [intelligent - * retries](/success-plus/overview). Default is `false`. + * On failure, automatically retry payments using + * intelligent + * retries. Default is false. *

* Important: To be able to use intelligent retries, Success+ needs to - * be enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus). + * be enabled in GoCardless + * dashboard. *

*

* Important: This is not applicable to Pay by Bank and VRP payments. @@ -1768,11 +1833,12 @@ public PaymentRequest withRetryIfPossible(Boolean retryIfPossible) { } /** - * (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 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 + * (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 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. */ public PaymentRequest withScheme(String scheme) { @@ -1835,8 +1901,9 @@ public SubscriptionRequest withCount(Integer count) { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. - * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency + * code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are + * supported. */ public SubscriptionRequest withCurrency(String currency) { this.currency = currency; @@ -1844,8 +1911,11 @@ public SubscriptionRequest withCurrency(String currency) { } /** - * As per RFC 2445. The day of the month to charge customers on. `1`-`28` or `-1` to - * indicate the last day of the month. + * As per RFC 2445. The day of the month to charge customers on. 1 + *

    + *
  • + *
+ * 28 or -1 to indicate the last day of the month. */ public SubscriptionRequest withDayOfMonth(Integer dayOfMonth) { this.dayOfMonth = dayOfMonth; @@ -1853,8 +1923,9 @@ public SubscriptionRequest withDayOfMonth(Integer dayOfMonth) { } /** - * Number of `interval_units` between customer charge dates. Must be greater than or - * equal to `1`. Must result in at least one charge date per year. Defaults to `1`. + * Number of interval_units between customer charge dates. Must be greater + * than or equal to 1. Must result in at least one charge date per year. + * Defaults to 1. */ public SubscriptionRequest withInterval(Integer interval) { this.interval = interval; @@ -1862,8 +1933,8 @@ public SubscriptionRequest withInterval(Integer interval) { } /** - * The unit of time between customer charge dates. One of `weekly`, `monthly` or - * `yearly`. + * The unit of time between customer charge dates. One of weekly, + * monthly or yearly. */ public SubscriptionRequest withIntervalUnit(IntervalUnit intervalUnit) { this.intervalUnit = intervalUnit; @@ -1881,8 +1952,7 @@ public SubscriptionRequest withMetadata(Map metadata) { /** * Name of the month on which to charge a customer. Must be lowercase. Only applies when - * the interval_unit is `yearly`. - * + * the interval_unit is yearly. */ public SubscriptionRequest withMonth(Month month) { this.month = month; @@ -1901,7 +1971,10 @@ public SubscriptionRequest withName(String name) { /** * An optional payment reference. This will be set as the reference on each payment * created and will appear on your customer's bank statement. See the documentation for - * the [create payment endpoint](#payments-create-a-payment) for more details.
+ * the create + * payment endpoint for more details.
+ *
*/ public SubscriptionRequest withPaymentReference(String paymentReference) { this.paymentReference = paymentReference; @@ -1909,11 +1982,13 @@ public SubscriptionRequest withPaymentReference(String paymentReference) { } /** - * On failure, automatically retry payments using [intelligent - * retries](/success-plus/overview). Default is `false`. + * On failure, automatically retry payments using + * intelligent + * retries. Default is false. *

* Important: To be able to use intelligent retries, Success+ needs to - * be enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus). + * be enabled in GoCardless + * dashboard. *

*/ public SubscriptionRequest withRetryIfPossible(Boolean retryIfPossible) { @@ -1923,11 +1998,11 @@ public SubscriptionRequest withRetryIfPossible(Boolean retryIfPossible) { /** * The date on which the first payment should be charged. If fulfilled after this date, - * this will be set as the mandate's `next_possible_charge_date`. When left blank and - * `month` or `day_of_month` are provided, this will be set to the date of the first - * payment. If created without `month` or `day_of_month` this will be set as the - * mandate's `next_possible_charge_date`. - * + * this will be set as the mandate's next_possible_charge_date. When left + * blank and month or day_of_month are provided, this will be + * set to the date of the first payment. If created without month or + * day_of_month this will be set as the mandate's + * next_possible_charge_date. */ public SubscriptionRequest withStartDate(String startDate) { this.startDate = startDate; @@ -1996,10 +2071,11 @@ public BillingRequestCollectCustomerDetailsRequest withCustomer(Customer custome } /** - * Customer's company name. Required unless a `given_name` and `family_name` are provided. - * For Canadian customers, the use of a `company_name` value will mean that any mandate - * created from this customer will be considered to be a "Business PAD" (otherwise, any - * mandate will be considered to be a "Personal PAD"). + * Customer's company name. Required unless a given_name and + * family_name are provided. For Canadian customers, the use of a + * company_name value will mean that any mandate created from this customer + * will be considered to be a "Business PAD" (otherwise, any mandate will be considered to + * be a "Personal PAD"). */ public BillingRequestCollectCustomerDetailsRequest withCustomerCompanyName( String companyName) { @@ -2023,7 +2099,7 @@ public BillingRequestCollectCustomerDetailsRequest withCustomerEmail(String emai } /** - * Customer's surname. Required unless a `company_name` is provided. + * Customer's surname. Required unless a company_name is provided. */ public BillingRequestCollectCustomerDetailsRequest withCustomerFamilyName( String familyName) { @@ -2035,7 +2111,7 @@ public BillingRequestCollectCustomerDetailsRequest withCustomerFamilyName( } /** - * Customer's first name. Required unless a `company_name` is provided. + * Customer's first name. Required unless a company_name is provided. */ public BillingRequestCollectCustomerDetailsRequest withCustomerGivenName(String givenName) { if (customer == null) { @@ -2046,12 +2122,14 @@ public BillingRequestCollectCustomerDetailsRequest withCustomerGivenName(String } /** - * [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code. Used as the - * language for notification emails sent by GoCardless if your organisation does not send - * its own (see [compliance requirements](#appendix-compliance-requirements)). Currently - * only "en", "fr", "de", "pt", "es", "it", "nl", "da", "nb", "sl", "sv" are supported. If - * this is not provided and a customer was linked during billing request creation, the - * linked customer language will be used. Otherwise, the language is default to "en". + * ISO 639-1 code. Used + * as the language for notification emails sent by GoCardless if your organisation does not + * send its own (see compliance + * requirements). Currently only "en", "fr", "de", "pt", "es", "it", "nl", "da", "nb", + * "sl", "sv" are supported. If this is not provided and a customer was linked during + * billing request creation, the linked customer language will be used. Otherwise, the + * language is default to "en". */ public BillingRequestCollectCustomerDetailsRequest withCustomerLanguage(String language) { if (customer == null) { @@ -2075,8 +2153,8 @@ public BillingRequestCollectCustomerDetailsRequest withCustomerMetadata( } /** - * [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone number, including - * country code. + * ITU E.123 formatted phone number, + * including country code. */ public BillingRequestCollectCustomerDetailsRequest withCustomerPhoneNumber( String phoneNumber) { @@ -2142,8 +2220,9 @@ public BillingRequestCollectCustomerDetailsRequest withCustomerBillingDetailCity } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public BillingRequestCollectCustomerDetailsRequest withCustomerBillingDetailCountryCode( String countryCode) { @@ -2172,9 +2251,8 @@ public BillingRequestCollectCustomerDetailsRequest withCustomerBillingDetailDani * the payer to whom the mandate belongs (i.e. as a result of their completion of a mandate * setup flow in their browser). * - * Not required for creating offline mandates where `authorisation_source` is set to - * telephone or paper. - * + * Not required for creating offline mandates where authorisation_source is set + * to telephone or paper. */ public BillingRequestCollectCustomerDetailsRequest withCustomerBillingDetailIpAddress( String ipAddress) { @@ -2199,8 +2277,8 @@ public BillingRequestCollectCustomerDetailsRequest withCustomerBillingDetailPost /** * The customer's address region, county or department. For US customers a 2 letter - * [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state code is required (e.g. - * `CA` for California). + * ISO3166-2:US state code is + * required (e.g. CA for California). */ public BillingRequestCollectCustomerDetailsRequest withCustomerBillingDetailRegion( String region) { @@ -2279,10 +2357,11 @@ public static class Customer { private String phoneNumber; /** - * Customer's company name. Required unless a `given_name` and `family_name` are - * provided. For Canadian customers, the use of a `company_name` value will mean that - * any mandate created from this customer will be considered to be a "Business PAD" - * (otherwise, any mandate will be considered to be a "Personal PAD"). + * Customer's company name. Required unless a given_name and + * family_name are provided. For Canadian customers, the use of a + * company_name value will mean that any mandate created from this customer + * will be considered to be a "Business PAD" (otherwise, any mandate will be considered + * to be a "Personal PAD"). */ public Customer withCompanyName(String companyName) { this.companyName = companyName; @@ -2299,7 +2378,7 @@ public Customer withEmail(String email) { } /** - * Customer's surname. Required unless a `company_name` is provided. + * Customer's surname. Required unless a company_name is provided. */ public Customer withFamilyName(String familyName) { this.familyName = familyName; @@ -2307,7 +2386,7 @@ public Customer withFamilyName(String familyName) { } /** - * Customer's first name. Required unless a `company_name` is provided. + * Customer's first name. Required unless a company_name is provided. */ public Customer withGivenName(String givenName) { this.givenName = givenName; @@ -2315,13 +2394,14 @@ public Customer withGivenName(String givenName) { } /** - * [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code. Used as the - * language for notification emails sent by GoCardless if your organisation does not - * send its own (see [compliance requirements](#appendix-compliance-requirements)). - * Currently only "en", "fr", "de", "pt", "es", "it", "nl", "da", "nb", "sl", "sv" are - * supported. If this is not provided and a customer was linked during billing request - * creation, the linked customer language will be used. Otherwise, the language is - * default to "en". + * ISO 639-1 code. + * Used as the language for notification emails sent by GoCardless if your organisation + * does not send its own (see compliance + * requirements). Currently only "en", "fr", "de", "pt", "es", "it", "nl", "da", + * "nb", "sl", "sv" are supported. If this is not provided and a customer was linked + * during billing request creation, the linked customer language will be used. + * Otherwise, the language is default to "en". */ public Customer withLanguage(String language) { this.language = language; @@ -2338,8 +2418,8 @@ public Customer withMetadata(Map metadata) { } /** - * [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone number, including - * country code. + * ITU E.123 formatted phone number, + * including country code. */ public Customer withPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; @@ -2392,8 +2472,9 @@ public CustomerBillingDetail withCity(String city) { } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public CustomerBillingDetail withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -2414,9 +2495,8 @@ public CustomerBillingDetail withDanishIdentityNumber(String danishIdentityNumbe * address of the payer to whom the mandate belongs (i.e. as a result of their * completion of a mandate setup flow in their browser). * - * Not required for creating offline mandates where `authorisation_source` is set to - * telephone or paper. - * + * Not required for creating offline mandates where authorisation_source is + * set to telephone or paper. */ public CustomerBillingDetail withIpAddress(String ipAddress) { this.ipAddress = ipAddress; @@ -2433,8 +2513,8 @@ public CustomerBillingDetail withPostalCode(String postalCode) { /** * The customer's address region, county or department. For US customers a 2 letter - * [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state code is required - * (e.g. `CA` for California). + * ISO3166-2:US state code is + * required (e.g. CA for California). */ public CustomerBillingDetail withRegion(String region) { this.region = region; @@ -2466,15 +2546,15 @@ public CustomerBillingDetail withSwedishIdentityNumber(String swedishIdentityNum * If the scheme is PayTo and the pay_id is available, this can be included in the payload along * with the country_code. * - * _ACH scheme_ For compliance reasons, an extra validation step is done using a third-party - * provider to make sure the customer's bank account can accept Direct Debit. If a bank account - * is discovered to be closed or invalid, the customer is requested to adjust the account - * number/routing number and succeed in this check to continue with the flow. + * ACH scheme For compliance reasons, an extra validation step is done using a + * third-party provider to make sure the customer's bank account can accept Direct Debit. If a + * bank account is discovered to be closed or invalid, the customer is requested to adjust the + * account number/routing number and succeed in this check to continue with the flow. * - * _BACS scheme_ [Payer Name - * Verification](https://hub.gocardless.com/s/article/Introduction-to-Payer-Name-Verification?language=en_GB) - * is enabled by default for UK based bank accounts, meaning we verify the account holder name - * and bank account number match the details held by the relevant bank. + * BACS scheme Payer + * Name Verification is enabled by default for UK based bank accounts, meaning we verify the + * account holder name and bank account number match the details held by the relevant bank. */ public static final class BillingRequestCollectBankAccountRequest extends PostRequest { @@ -2496,8 +2576,9 @@ public static final class BillingRequestCollectBankAccountRequest * Name of the account holder, as known by the bank. The full name provided when the * customer is created is stored and is available via the API, but is transliterated, * upcased, and truncated to 18 characters in bank submissions. This field is required - * unless the request includes a [customer bank account - * token](#javascript-flow-customer-bank-account-tokens). + * unless the request includes a customer + * bank account token. */ public BillingRequestCollectBankAccountRequest withAccountHolderName( String accountHolderName) { @@ -2506,8 +2587,9 @@ public BillingRequestCollectBankAccountRequest withAccountHolderName( } /** - * Bank account number - see [local details](#appendix-local-bank-details) for more - * information. Alternatively you can provide an `iban`. + * Bank account number - see local + * details for more information. Alternatively you can provide an iban. */ public BillingRequestCollectBankAccountRequest withAccountNumber(String accountNumber) { this.accountNumber = accountNumber; @@ -2515,8 +2597,9 @@ public BillingRequestCollectBankAccountRequest withAccountNumber(String accountN } /** - * Account number suffix (only for bank accounts denominated in NZD) - see [local - * details](#local-bank-details-new-zealand) for more information. + * Account number suffix (only for bank accounts denominated in NZD) - see local + * details for more information. */ public BillingRequestCollectBankAccountRequest withAccountNumberSuffix( String accountNumberSuffix) { @@ -2526,8 +2609,9 @@ public BillingRequestCollectBankAccountRequest withAccountNumberSuffix( /** * 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. + * bank accounts in other currencies. See local + * details for more information. */ public BillingRequestCollectBankAccountRequest withAccountType(AccountType accountType) { this.accountType = accountType; @@ -2535,8 +2619,9 @@ public BillingRequestCollectBankAccountRequest withAccountType(AccountType accou } /** - * Bank code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Bank code - see local + * details for more information. Alternatively you can provide an iban. */ public BillingRequestCollectBankAccountRequest withBankCode(String bankCode) { this.bankCode = bankCode; @@ -2544,8 +2629,9 @@ public BillingRequestCollectBankAccountRequest withBankCode(String bankCode) { } /** - * Branch code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Branch code - see local + * details for more information. Alternatively you can provide an iban. */ public BillingRequestCollectBankAccountRequest withBranchCode(String branchCode) { this.branchCode = branchCode; @@ -2553,9 +2639,10 @@ public BillingRequestCollectBankAccountRequest withBranchCode(String branchCode) } /** - * [ISO 3166-1 alpha-2 - * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). - * Defaults to the country code of the `iban` if supplied, otherwise is required. + * ISO + * 3166-1 alpha-2 code. Defaults to the country code of the iban if + * supplied, otherwise is required. */ public BillingRequestCollectBankAccountRequest withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -2563,8 +2650,8 @@ public BillingRequestCollectBankAccountRequest withCountryCode(String countryCod } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public BillingRequestCollectBankAccountRequest withCurrency(String currency) { this.currency = currency; @@ -2572,9 +2659,12 @@ public BillingRequestCollectBankAccountRequest withCurrency(String currency) { } /** - * International Bank Account Number. Alternatively you can provide [local - * details](#appendix-local-bank-details). IBANs are not accepted for Swedish bank accounts - * denominated in SEK - you must supply [local details](#local-bank-details-sweden). + * International Bank Account Number. Alternatively you can provide local + * details. IBANs are not accepted for Swedish bank accounts denominated in SEK - you + * must supply + * local + * details. */ public BillingRequestCollectBankAccountRequest withIban(String iban) { this.iban = iban; @@ -2910,10 +3000,11 @@ protected String getRequestEnvelope() { /** * Request class for {@link BillingRequestService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your billing requests. + * Returns a cursor-paginated + * list of your billing requests. */ public static final class BillingRequestListRequest extends ListRequest { - private String createdAt; private String customer; private String status; @@ -2934,16 +3025,9 @@ public BillingRequestListRequest withBefore(String before) { } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. - */ - public BillingRequestListRequest withCreatedAt(String createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * ID of a [customer](#core-endpoints-customers). If specified, this endpoint will return - * all requests for the given customer. + * ID of a customer. + * If specified, this endpoint will return all requests for the given customer. */ public BillingRequestListRequest withCustomer(String customer) { this.customer = customer; @@ -2960,12 +3044,15 @@ public BillingRequestListRequest withLimit(Integer limit) { /** * One of: + * *
    - *
  • `pending`: the billing request is pending and can be used
  • - *
  • `ready_to_fulfil`: the billing request is ready to fulfil
  • - *
  • `fulfilling`: the billing request is currently undergoing fulfilment
  • - *
  • `fulfilled`: the billing request has been fulfilled and a payment created
  • - *
  • `cancelled`: the billing request has been cancelled and cannot be used
  • + *
  • pending: the billing request is pending and can be used
  • + *
  • ready_to_fulfil: the billing request is ready to fulfil
  • + *
  • fulfilling: the billing request is currently undergoing fulfilment
  • + *
  • fulfilled: the billing request has been fulfilled and a payment + * created
  • + *
  • cancelled: the billing request has been cancelled and cannot be + * used
  • *
*/ public BillingRequestListRequest withStatus(String status) { @@ -2987,9 +3074,6 @@ public BillingRequestListRequest withHeader(String headerName, String headerV protected Map getQueryParams() { ImmutableMap.Builder params = ImmutableMap.builder(); params.putAll(super.getQueryParams()); - if (createdAt != null) { - params.put("created_at", createdAt); - } if (customer != null) { params.put("customer", customer); } @@ -3072,7 +3156,7 @@ public static final class BillingRequestNotifyRequest extends PostRequestemail. */ public BillingRequestNotifyRequest withNotificationType(String notificationType) { this.notificationType = notificationType; @@ -3199,8 +3283,8 @@ public static final class BillingRequestChooseCurrencyRequest private Map metadata; /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public BillingRequestChooseCurrencyRequest withCurrency(String currency) { this.currency = currency; @@ -3285,10 +3369,10 @@ public static final class BillingRequestSelectInstitutionRequest private String institution; /** - * [ISO - * 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) - * alpha-2 code. The country code of the institution. If nothing is provided, institutions - * with the country code 'GB' are returned by default. + * ISO + * 3166-1 alpha-2 code. The country code of the institution. If nothing is provided, + * institutions with the country code 'GB' are returned by default. */ public BillingRequestSelectInstitutionRequest withCountryCode(String countryCode) { this.countryCode = countryCode; diff --git a/src/main/java/com/gocardless/services/BillingRequestTemplateService.java b/src/main/java/com/gocardless/services/BillingRequestTemplateService.java index a30383cb..1d6a9a75 100644 --- a/src/main/java/com/gocardless/services/BillingRequestTemplateService.java +++ b/src/main/java/com/gocardless/services/BillingRequestTemplateService.java @@ -36,8 +36,9 @@ public BillingRequestTemplateService(HttpClient httpClient) { } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your Billing Request - * Templates. + * Returns a cursor-paginated + * list of your Billing Request Templates. */ public BillingRequestTemplateListRequest> list() { return new BillingRequestTemplateListRequest<>(httpClient, @@ -74,8 +75,9 @@ public BillingRequestTemplateUpdateRequest update(String identity) { /** * Request class for {@link BillingRequestTemplateService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your Billing Request - * Templates. + * Returns a cursor-paginated + * list of your Billing Request Templates. */ public static final class BillingRequestTemplateListRequest extends ListRequest { @@ -106,11 +108,12 @@ public BillingRequestTemplateListRequest withLimit(Integer limit) { } /** - * (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 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. + * (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 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. */ public BillingRequestTemplateListRequest withPaymentRequestScheme( String paymentRequestScheme) { @@ -211,7 +214,7 @@ public static final class BillingRequestTemplateCreateRequest private String mandateRequestDescription; private Map mandateRequestMetadata; private String mandateRequestScheme; - private MandateRequestVerify mandateRequestVerify; + private String mandateRequestVerify; private Map metadata; private String name; private String paymentRequestAmount; @@ -227,8 +230,9 @@ public BillingRequestTemplateCreateRequest withLinks(Links links) { } /** - * ID of the associated [creditor](#core-endpoints-creditors). Only required if your account - * manages multiple creditors. + * ID of the associated creditor. + * Only required if your account manages multiple creditors. */ public BillingRequestTemplateCreateRequest withLinksCreditor(String creditor) { if (links == null) { @@ -254,7 +258,6 @@ public BillingRequestTemplateCreateRequest withMandateRequestConstraints( * This is an optional field and if it is not supplied the agreement will be considered open * and will not have an end date. Keep in mind the end date must take into account how long * it will take the user to set up this agreement via the Billing Request. - * */ public BillingRequestTemplateCreateRequest withMandateRequestConstraintsEndDate( String endDate) { @@ -266,7 +269,9 @@ public BillingRequestTemplateCreateRequest withMandateRequestConstraintsEndDate( } /** - * The maximum amount that can be charged for a single payment. Required for PayTo and VRP. + * The maximum amount that can be charged for a single payment in the lowest denomination + * for the currency (e.g. pence in GBP, cents in EUR). Note: Required for PayTo and + * VRP. */ public BillingRequestTemplateCreateRequest withMandateRequestConstraintsMaxAmountPerPayment( Integer maxAmountPerPayment) { @@ -279,8 +284,8 @@ public BillingRequestTemplateCreateRequest withMandateRequestConstraintsMaxAmoun /** * A constraint where you can specify info (free text string) about how payments are - * calculated. _Note:_ This is only supported for ACH and PAD schemes. - * + * calculated. For use when payments vary and cannot be expressed as a fixed amount and + * frequency. Note: This is only supported for ACH and PAD schemes. */ public BillingRequestTemplateCreateRequest withMandateRequestConstraintsPaymentMethod( String paymentMethod) { @@ -292,7 +297,12 @@ public BillingRequestTemplateCreateRequest withMandateRequestConstraintsPaymentM } /** - * List of periodic limits and constraints which apply to them + * Caps on the total amount and/or number of payments that can be collected within a + * repeating period (e.g. no more than a set amount per month), as opposed to + * max_amount_per_payment which caps a single payment. + * + * Note: Required for VRP, where exactly one periodic limit must be provided. + * Optional for PayTo. */ public BillingRequestTemplateCreateRequest withMandateRequestConstraintsPeriodicLimits( List periodicLimits) { @@ -308,7 +318,6 @@ public BillingRequestTemplateCreateRequest withMandateRequestConstraintsPeriodic * * This is an optional field and if it is not supplied the start date will be set to the day * authorisation happens. - * */ public BillingRequestTemplateCreateRequest withMandateRequestConstraintsStartDate( String startDate) { @@ -320,7 +329,7 @@ public BillingRequestTemplateCreateRequest withMandateRequestConstraintsStartDat } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. + * ISO 4217 currency code. */ public BillingRequestTemplateCreateRequest withMandateRequestCurrency( String mandateRequestCurrency) { @@ -331,7 +340,6 @@ public BillingRequestTemplateCreateRequest withMandateRequestCurrency( /** * A human-readable description of the payment and/or mandate. This will be displayed to the * payer when authorising the billing request. - * */ public BillingRequestTemplateCreateRequest withMandateRequestDescription( String mandateRequestDescription) { @@ -377,30 +385,10 @@ public BillingRequestTemplateCreateRequest withMandateRequestScheme( } /** - * Verification preference for the mandate. One of: - *
    - *
  • `minimum`: only verify if absolutely required, such as when part of scheme rules
  • - *
  • `recommended`: in addition to `minimum`, use the GoCardless payment intelligence - * solution to decide if a payer should be verified
  • - *
  • `when_available`: if verification mechanisms are available, use them
  • - *
  • `always`: as `when_available`, but fail to create the Billing Request if a mechanism - * isn't available
  • - *
- * - * By default, all Billing Requests use the `recommended` verification preference. It uses - * GoCardless payment intelligence solution to determine if a payer is fraudulent or not. - * The verification mechanism is based on the response and the payer may be asked to verify - * themselves. If the feature is not available, `recommended` behaves like `minimum`. - * - * If you never wish to take advantage of our reduced risk products and Verified Mandates as - * they are released in new schemes, please use the `minimum` verification preference. - * - * See [Billing Requests: Creating Verified - * Mandates](https://developer.gocardless.com/getting-started/billing-requests/verified-mandates/) - * for more information. + * Verification preference for the mandate. */ public BillingRequestTemplateCreateRequest withMandateRequestVerify( - MandateRequestVerify mandateRequestVerify) { + String mandateRequestVerify) { this.mandateRequestVerify = mandateRequestVerify; return this; } @@ -445,9 +433,9 @@ public BillingRequestTemplateCreateRequest withPaymentRequestAmount( } /** - * [ISO 4217](https://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 - * supported Eurozone countries only. + * ISO 4217 currency code. + * GBP and EUR supported; GBP with your customers in + * the UK and for EUR with your customers in supported Eurozone countries only. */ public BillingRequestTemplateCreateRequest withPaymentRequestCurrency( String paymentRequestCurrency) { @@ -458,7 +446,6 @@ public BillingRequestTemplateCreateRequest withPaymentRequestCurrency( /** * A human-readable description of the payment and/or mandate. This will be displayed to the * payer when authorising the billing request. - * */ public BillingRequestTemplateCreateRequest withPaymentRequestDescription( String paymentRequestDescription) { @@ -492,11 +479,12 @@ public BillingRequestTemplateCreateRequest withPaymentRequestMetadata(String key } /** - * (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 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. + * (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 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. */ public BillingRequestTemplateCreateRequest withPaymentRequestScheme( String paymentRequestScheme) { @@ -558,26 +546,13 @@ protected boolean hasBody() { return true; } - public enum MandateRequestVerify { - @SerializedName("minimum") - MINIMUM, @SerializedName("recommended") - RECOMMENDED, @SerializedName("when_available") - WHEN_AVAILABLE, @SerializedName("always") - ALWAYS, @SerializedName("unknown") - UNKNOWN; - - @Override - public String toString() { - return name().toLowerCase(); - } - } - public static class Links { private String creditor; /** - * ID of the associated [creditor](#core-endpoints-creditors). Only required if your - * account manages multiple creditors. + * ID of the associated creditor. + * Only required if your account manages multiple creditors. */ public Links withCreditor(String creditor) { this.creditor = creditor; @@ -592,15 +567,27 @@ public static class PeriodicLimits { private Period period; /** - * The alignment of the period. + * The alignment of the period. Defaults to creation_date if not specified. * - * `calendar` - this will finish on the end of the current period. For example this will - * expire on the Monday for the current week or the January for the next year. + * calendar + *
    + *
  • the period follows fixed calendar boundaries, the same for every mandate:
  • + *
+ * week runs Monday to Sunday, month runs from the 1st to the + * last day of the calendar month, and year runs from 1 January to 31 + * December. If the mandate starts partway through a period, the limit for that first + * period is reduced proportionally to the days remaining (e.g. a monthly limit starting + * on the 15th gives roughly half the limit for that first month). * - * `creation_date` - this will finish on the next instance of the current period. For - * example Monthly it will expire on the same day of the next month, or yearly the same - * day of the next year. + * creation_date + *
    + *
  • the period follows the mandate's own start date rather than the calendar. For + * example, if the mandate starts on the 15th, each monthly period runs from the 15th to + * the 14th of the following month. The first period is a full period, not reduced + * proportionally.
  • + *
* + * Note: Has no effect when period is flexible. */ public PeriodicLimits withAlignment(Alignment alignment) { this.alignment = alignment; @@ -608,9 +595,9 @@ public PeriodicLimits withAlignment(Alignment alignment) { } /** - * The maximum number of payments that can be collected in this periodic limit. _Note:_ - * This is only supported for the PayTo scheme, where it is required. + * The maximum number of payments that can be collected in this periodic limit. * + * Note: Only supported for the PayTo scheme, where it is optional. */ public PeriodicLimits withMaxPayments(Integer maxPayments) { this.maxPayments = maxPayments; @@ -618,9 +605,10 @@ public PeriodicLimits withMaxPayments(Integer maxPayments) { } /** - * The maximum total amount that can be charged for all payments in this periodic limit. - * Required for VRP. + * The maximum total amount that can be charged for all payments in this periodic limit, + * in the lowest denomination for the currency (e.g. pence in GBP, cents in EUR). * + * Note: Required for VRP. This is not permitted for the PayTo scheme. */ public PeriodicLimits withMaxTotalAmount(Integer maxTotalAmount) { this.maxTotalAmount = maxTotalAmount; @@ -628,8 +616,9 @@ public PeriodicLimits withMaxTotalAmount(Integer maxTotalAmount) { } /** - * The repeating period for this mandate. Defaults to flexible for PayTo if not - * specified. + * The repeating period for this mandate. Required whenever a periodic limit is provided + * (for both VRP and PayTo). If periodic_limits is omitted entirely for PayTo, this + * defaults to flexible. */ public PeriodicLimits withPeriod(Period period) { this.period = period; @@ -695,7 +684,6 @@ public static class MandateRequestConstraints { * This is an optional field and if it is not supplied the agreement will be considered * open and will not have an end date. Keep in mind the end date must take into account * how long it will take the user to set up this agreement via the Billing Request. - * */ public MandateRequestConstraints withEndDate(String endDate) { this.endDate = endDate; @@ -703,8 +691,9 @@ public MandateRequestConstraints withEndDate(String endDate) { } /** - * The maximum amount that can be charged for a single payment. Required for PayTo and - * VRP. + * The maximum amount that can be charged for a single payment in the lowest + * denomination for the currency (e.g. pence in GBP, cents in EUR). Note: + * Required for PayTo and VRP. */ public MandateRequestConstraints withMaxAmountPerPayment(Integer maxAmountPerPayment) { this.maxAmountPerPayment = maxAmountPerPayment; @@ -713,8 +702,8 @@ public MandateRequestConstraints withMaxAmountPerPayment(Integer maxAmountPerPay /** * A constraint where you can specify info (free text string) about how payments are - * calculated. _Note:_ This is only supported for ACH and PAD schemes. - * + * calculated. For use when payments vary and cannot be expressed as a fixed amount and + * frequency. Note: This is only supported for ACH and PAD schemes. */ public MandateRequestConstraints withPaymentMethod(String paymentMethod) { this.paymentMethod = paymentMethod; @@ -722,7 +711,12 @@ public MandateRequestConstraints withPaymentMethod(String paymentMethod) { } /** - * List of periodic limits and constraints which apply to them + * Caps on the total amount and/or number of payments that can be collected within a + * repeating period (e.g. no more than a set amount per month), as opposed to + * max_amount_per_payment which caps a single payment. + * + * Note: Required for VRP, where exactly one periodic limit must be provided. + * Optional for PayTo. */ public MandateRequestConstraints withPeriodicLimits( List periodicLimits) { @@ -735,7 +729,6 @@ public MandateRequestConstraints withPeriodicLimits( * * This is an optional field and if it is not supplied the start date will be set to the * day authorisation happens. - * */ public MandateRequestConstraints withStartDate(String startDate) { this.startDate = startDate; @@ -759,7 +752,7 @@ public static final class BillingRequestTemplateUpdateRequest private String mandateRequestDescription; private Map mandateRequestMetadata; private String mandateRequestScheme; - private MandateRequestVerify mandateRequestVerify; + private String mandateRequestVerify; private Map metadata; private String name; private String paymentRequestAmount; @@ -785,7 +778,6 @@ public BillingRequestTemplateUpdateRequest withMandateRequestConstraints( * This is an optional field and if it is not supplied the agreement will be considered open * and will not have an end date. Keep in mind the end date must take into account how long * it will take the user to set up this agreement via the Billing Request. - * */ public BillingRequestTemplateUpdateRequest withMandateRequestConstraintsEndDate( String endDate) { @@ -797,7 +789,9 @@ public BillingRequestTemplateUpdateRequest withMandateRequestConstraintsEndDate( } /** - * The maximum amount that can be charged for a single payment. Required for PayTo and VRP. + * The maximum amount that can be charged for a single payment in the lowest denomination + * for the currency (e.g. pence in GBP, cents in EUR). Note: Required for PayTo and + * VRP. */ public BillingRequestTemplateUpdateRequest withMandateRequestConstraintsMaxAmountPerPayment( Integer maxAmountPerPayment) { @@ -810,8 +804,8 @@ public BillingRequestTemplateUpdateRequest withMandateRequestConstraintsMaxAmoun /** * A constraint where you can specify info (free text string) about how payments are - * calculated. _Note:_ This is only supported for ACH and PAD schemes. - * + * calculated. For use when payments vary and cannot be expressed as a fixed amount and + * frequency. Note: This is only supported for ACH and PAD schemes. */ public BillingRequestTemplateUpdateRequest withMandateRequestConstraintsPaymentMethod( String paymentMethod) { @@ -823,7 +817,12 @@ public BillingRequestTemplateUpdateRequest withMandateRequestConstraintsPaymentM } /** - * List of periodic limits and constraints which apply to them + * Caps on the total amount and/or number of payments that can be collected within a + * repeating period (e.g. no more than a set amount per month), as opposed to + * max_amount_per_payment which caps a single payment. + * + * Note: Required for VRP, where exactly one periodic limit must be provided. + * Optional for PayTo. */ public BillingRequestTemplateUpdateRequest withMandateRequestConstraintsPeriodicLimits( List periodicLimits) { @@ -839,7 +838,6 @@ public BillingRequestTemplateUpdateRequest withMandateRequestConstraintsPeriodic * * This is an optional field and if it is not supplied the start date will be set to the day * authorisation happens. - * */ public BillingRequestTemplateUpdateRequest withMandateRequestConstraintsStartDate( String startDate) { @@ -851,7 +849,7 @@ public BillingRequestTemplateUpdateRequest withMandateRequestConstraintsStartDat } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. + * ISO 4217 currency code. */ public BillingRequestTemplateUpdateRequest withMandateRequestCurrency( String mandateRequestCurrency) { @@ -862,7 +860,6 @@ public BillingRequestTemplateUpdateRequest withMandateRequestCurrency( /** * A human-readable description of the payment and/or mandate. This will be displayed to the * payer when authorising the billing request. - * */ public BillingRequestTemplateUpdateRequest withMandateRequestDescription( String mandateRequestDescription) { @@ -908,30 +905,10 @@ public BillingRequestTemplateUpdateRequest withMandateRequestScheme( } /** - * Verification preference for the mandate. One of: - *
    - *
  • `minimum`: only verify if absolutely required, such as when part of scheme rules
  • - *
  • `recommended`: in addition to `minimum`, use the GoCardless payment intelligence - * solution to decide if a payer should be verified
  • - *
  • `when_available`: if verification mechanisms are available, use them
  • - *
  • `always`: as `when_available`, but fail to create the Billing Request if a mechanism - * isn't available
  • - *
- * - * By default, all Billing Requests use the `recommended` verification preference. It uses - * GoCardless payment intelligence solution to determine if a payer is fraudulent or not. - * The verification mechanism is based on the response and the payer may be asked to verify - * themselves. If the feature is not available, `recommended` behaves like `minimum`. - * - * If you never wish to take advantage of our reduced risk products and Verified Mandates as - * they are released in new schemes, please use the `minimum` verification preference. - * - * See [Billing Requests: Creating Verified - * Mandates](https://developer.gocardless.com/getting-started/billing-requests/verified-mandates/) - * for more information. + * Verification preference for the mandate. */ public BillingRequestTemplateUpdateRequest withMandateRequestVerify( - MandateRequestVerify mandateRequestVerify) { + String mandateRequestVerify) { this.mandateRequestVerify = mandateRequestVerify; return this; } @@ -976,9 +953,9 @@ public BillingRequestTemplateUpdateRequest withPaymentRequestAmount( } /** - * [ISO 4217](https://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 - * supported Eurozone countries only. + * ISO 4217 currency code. + * GBP and EUR supported; GBP with your customers in + * the UK and for EUR with your customers in supported Eurozone countries only. */ public BillingRequestTemplateUpdateRequest withPaymentRequestCurrency( String paymentRequestCurrency) { @@ -989,7 +966,6 @@ public BillingRequestTemplateUpdateRequest withPaymentRequestCurrency( /** * A human-readable description of the payment and/or mandate. This will be displayed to the * payer when authorising the billing request. - * */ public BillingRequestTemplateUpdateRequest withPaymentRequestDescription( String paymentRequestDescription) { @@ -1023,11 +999,12 @@ public BillingRequestTemplateUpdateRequest withPaymentRequestMetadata(String key } /** - * (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 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. + * (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 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. */ public BillingRequestTemplateUpdateRequest withPaymentRequestScheme( String paymentRequestScheme) { @@ -1081,20 +1058,6 @@ protected boolean hasBody() { return true; } - public enum MandateRequestVerify { - @SerializedName("minimum") - MINIMUM, @SerializedName("recommended") - RECOMMENDED, @SerializedName("when_available") - WHEN_AVAILABLE, @SerializedName("always") - ALWAYS, @SerializedName("unknown") - UNKNOWN; - - @Override - public String toString() { - return name().toLowerCase(); - } - } - public static class PeriodicLimits { private Alignment alignment; private Integer maxPayments; @@ -1102,15 +1065,27 @@ public static class PeriodicLimits { private Period period; /** - * The alignment of the period. + * The alignment of the period. Defaults to creation_date if not specified. * - * `calendar` - this will finish on the end of the current period. For example this will - * expire on the Monday for the current week or the January for the next year. + * calendar + *
    + *
  • the period follows fixed calendar boundaries, the same for every mandate:
  • + *
+ * week runs Monday to Sunday, month runs from the 1st to the + * last day of the calendar month, and year runs from 1 January to 31 + * December. If the mandate starts partway through a period, the limit for that first + * period is reduced proportionally to the days remaining (e.g. a monthly limit starting + * on the 15th gives roughly half the limit for that first month). * - * `creation_date` - this will finish on the next instance of the current period. For - * example Monthly it will expire on the same day of the next month, or yearly the same - * day of the next year. + * creation_date + *
    + *
  • the period follows the mandate's own start date rather than the calendar. For + * example, if the mandate starts on the 15th, each monthly period runs from the 15th to + * the 14th of the following month. The first period is a full period, not reduced + * proportionally.
  • + *
* + * Note: Has no effect when period is flexible. */ public PeriodicLimits withAlignment(Alignment alignment) { this.alignment = alignment; @@ -1118,9 +1093,9 @@ public PeriodicLimits withAlignment(Alignment alignment) { } /** - * The maximum number of payments that can be collected in this periodic limit. _Note:_ - * This is only supported for the PayTo scheme, where it is required. + * The maximum number of payments that can be collected in this periodic limit. * + * Note: Only supported for the PayTo scheme, where it is optional. */ public PeriodicLimits withMaxPayments(Integer maxPayments) { this.maxPayments = maxPayments; @@ -1128,9 +1103,10 @@ public PeriodicLimits withMaxPayments(Integer maxPayments) { } /** - * The maximum total amount that can be charged for all payments in this periodic limit. - * Required for VRP. + * The maximum total amount that can be charged for all payments in this periodic limit, + * in the lowest denomination for the currency (e.g. pence in GBP, cents in EUR). * + * Note: Required for VRP. This is not permitted for the PayTo scheme. */ public PeriodicLimits withMaxTotalAmount(Integer maxTotalAmount) { this.maxTotalAmount = maxTotalAmount; @@ -1138,8 +1114,9 @@ public PeriodicLimits withMaxTotalAmount(Integer maxTotalAmount) { } /** - * The repeating period for this mandate. Defaults to flexible for PayTo if not - * specified. + * The repeating period for this mandate. Required whenever a periodic limit is provided + * (for both VRP and PayTo). If periodic_limits is omitted entirely for PayTo, this + * defaults to flexible. */ public PeriodicLimits withPeriod(Period period) { this.period = period; @@ -1205,7 +1182,6 @@ public static class MandateRequestConstraints { * This is an optional field and if it is not supplied the agreement will be considered * open and will not have an end date. Keep in mind the end date must take into account * how long it will take the user to set up this agreement via the Billing Request. - * */ public MandateRequestConstraints withEndDate(String endDate) { this.endDate = endDate; @@ -1213,8 +1189,9 @@ public MandateRequestConstraints withEndDate(String endDate) { } /** - * The maximum amount that can be charged for a single payment. Required for PayTo and - * VRP. + * The maximum amount that can be charged for a single payment in the lowest + * denomination for the currency (e.g. pence in GBP, cents in EUR). Note: + * Required for PayTo and VRP. */ public MandateRequestConstraints withMaxAmountPerPayment(Integer maxAmountPerPayment) { this.maxAmountPerPayment = maxAmountPerPayment; @@ -1223,8 +1200,8 @@ public MandateRequestConstraints withMaxAmountPerPayment(Integer maxAmountPerPay /** * A constraint where you can specify info (free text string) about how payments are - * calculated. _Note:_ This is only supported for ACH and PAD schemes. - * + * calculated. For use when payments vary and cannot be expressed as a fixed amount and + * frequency. Note: This is only supported for ACH and PAD schemes. */ public MandateRequestConstraints withPaymentMethod(String paymentMethod) { this.paymentMethod = paymentMethod; @@ -1232,7 +1209,12 @@ public MandateRequestConstraints withPaymentMethod(String paymentMethod) { } /** - * List of periodic limits and constraints which apply to them + * Caps on the total amount and/or number of payments that can be collected within a + * repeating period (e.g. no more than a set amount per month), as opposed to + * max_amount_per_payment which caps a single payment. + * + * Note: Required for VRP, where exactly one periodic limit must be provided. + * Optional for PayTo. */ public MandateRequestConstraints withPeriodicLimits( List periodicLimits) { @@ -1245,7 +1227,6 @@ public MandateRequestConstraints withPeriodicLimits( * * This is an optional field and if it is not supplied the start date will be set to the * day authorisation happens. - * */ public MandateRequestConstraints withStartDate(String startDate) { this.startDate = startDate; diff --git a/src/main/java/com/gocardless/services/BillingRequestWithActionService.java b/src/main/java/com/gocardless/services/BillingRequestWithActionService.java index dee9a2d7..aa362f5b 100644 --- a/src/main/java/com/gocardless/services/BillingRequestWithActionService.java +++ b/src/main/java/com/gocardless/services/BillingRequestWithActionService.java @@ -15,9 +15,8 @@ * of required input might be additional customer billing details, while an action would be asking a * customer to authorise a payment using their mobile banking app. * - * See [Billing Requests: - * Overview](https://developer.gocardless.com/getting-started/billing-requests/overview/) for - * how-to's, explanations and tutorials. + * See Billing + * Requests: Overview for how-to's, explanations and tutorials. */ public class BillingRequestWithActionService { private final HttpClient httpClient; @@ -131,9 +130,9 @@ public BillingRequestWithActionCreateWithActionsRequest withActionsSelectInstitu * (Optional) If true, this billing request can fallback from instant payment to direct * debit. Should not be set if GoCardless payment intelligence feature is used. * - * See [Billing Requests: Retain customers with - * Fallbacks](https://developer.gocardless.com/billing-requests/retain-customers-with-fallbacks/) - * for more information. + * See Billing + * Requests: Retain customers with Fallbacks for more information. */ public BillingRequestWithActionCreateWithActionsRequest withFallbackEnabled( Boolean fallbackEnabled) { @@ -147,8 +146,9 @@ public BillingRequestWithActionCreateWithActionsRequest withLinks(Links links) { } /** - * ID of the associated [creditor](#core-endpoints-creditors). Only required if your account - * manages multiple creditors. + * ID of the associated creditor. + * Only required if your account manages multiple creditors. */ public BillingRequestWithActionCreateWithActionsRequest withLinksCreditor(String creditor) { if (links == null) { @@ -159,8 +159,9 @@ public BillingRequestWithActionCreateWithActionsRequest withLinksCreditor(String } /** - * ID of the [customer](#core-endpoints-customers) against which this request should be - * made. + * ID of the customer + * against which this request should be made. */ public BillingRequestWithActionCreateWithActionsRequest withLinksCustomer(String customer) { if (links == null) { @@ -171,9 +172,9 @@ public BillingRequestWithActionCreateWithActionsRequest withLinksCustomer(String } /** - * (Optional) ID of the [customer_bank_account](#core-endpoints-customer-bank-accounts) + * (Optional) ID of the customer_bank_account * against which this request should be made. - * */ public BillingRequestWithActionCreateWithActionsRequest withLinksCustomerBankAccount( String customerBankAccount) { @@ -191,14 +192,13 @@ public BillingRequestWithActionCreateWithActionsRequest withMandateRequest( } /** - * This field is ACH specific, sometimes referred to as [SEC - * code](https://www.moderntreasury.com/learn/sec-codes). + * This field is ACH specific, sometimes referred to as + * SEC code. * * This is the way that the payer gives authorisation to the merchant. web: Authorisation is * Internet Initiated or via Mobile Entry (maps to SEC code: WEB) telephone: Authorisation * is provided orally over telephone (maps to SEC code: TEL) paper: Authorisation is * provided in writing and signed, or similarly authenticated (maps to SEC code: PPD) - * */ public BillingRequestWithActionCreateWithActionsRequest withMandateRequestAuthorisationSource( MandateRequest.AuthorisationSource authorisationSource) { @@ -223,7 +223,7 @@ public BillingRequestWithActionCreateWithActionsRequest withMandateRequestConstr } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. + * ISO 4217 currency code. */ public BillingRequestWithActionCreateWithActionsRequest withMandateRequestCurrency( String currency) { @@ -237,7 +237,6 @@ public BillingRequestWithActionCreateWithActionsRequest withMandateRequestCurren /** * A human-readable description of the payment and/or mandate. This will be displayed to the * payer when authorising the billing request. - * */ public BillingRequestWithActionCreateWithActionsRequest withMandateRequestDescription( String description) { @@ -251,10 +250,12 @@ public BillingRequestWithActionCreateWithActionsRequest withMandateRequestDescri /** * This field will decide how GoCardless handles settlement of funds from the customer. * - * - `managed` will be moved through GoCardless' account, batched, and payed out. - `direct` - * will be a direct transfer from the payer's account to the merchant where invoicing will - * be handled separately. - * + *
    + *
  • managed will be moved through GoCardless' account, batched, and payed + * out.
  • + *
  • direct will be a direct transfer from the payer's account to the + * merchant where invoicing will be handled separately.
  • + *
*/ public BillingRequestWithActionCreateWithActionsRequest withMandateRequestFundsSettlement( MandateRequest.FundsSettlement fundsSettlement) { @@ -279,9 +280,10 @@ public BillingRequestWithActionCreateWithActionsRequest withMandateRequestMetada } /** - * Unique reference. Different schemes have different length and [character - * set](#appendix-character-sets) requirements. GoCardless will generate a unique reference - * satisfying the different scheme requirements if this field is left blank. + * Unique reference. Different schemes have different length and character + * set requirements. GoCardless will generate a unique reference satisfying the + * different scheme requirements if this field is left blank. */ public BillingRequestWithActionCreateWithActionsRequest withMandateRequestReference( String reference) { @@ -323,26 +325,29 @@ public BillingRequestWithActionCreateWithActionsRequest withMandateRequestSweepi /** * Verification preference for the mandate. One of: + * *
    - *
  • `minimum`: only verify if absolutely required, such as when part of scheme rules
  • - *
  • `recommended`: in addition to `minimum`, use the GoCardless payment intelligence - * solution to decide if a payer should be verified
  • - *
  • `when_available`: if verification mechanisms are available, use them
  • - *
  • `always`: as `when_available`, but fail to create the Billing Request if a mechanism - * isn't available
  • + *
  • minimum: only verify if absolutely required, such as when part of scheme + * rules
  • + *
  • recommended: in addition to minimum, use the GoCardless + * payment intelligence solution to decide if a payer should be verified
  • + *
  • when_available: if verification mechanisms are available, use them
  • + *
  • always: as when_available, but fail to create the Billing + * Request if a mechanism isn't available
  • *
- * - * By default, all Billing Requests use the `recommended` verification preference. It uses - * GoCardless payment intelligence solution to determine if a payer is fraudulent or not. - * The verification mechanism is based on the response and the payer may be asked to verify - * themselves. If the feature is not available, `recommended` behaves like `minimum`. + * By default, all Billing Requests use the recommended verification + * preference. It uses GoCardless payment intelligence solution to determine if a payer is + * fraudulent or not. The verification mechanism is based on the response and the payer may + * be asked to verify themselves. If the feature is not available, recommended + * behaves like minimum. * * If you never wish to take advantage of our reduced risk products and Verified Mandates as - * they are released in new schemes, please use the `minimum` verification preference. + * they are released in new schemes, please use the minimum verification + * preference. * - * See [Billing Requests: Creating Verified - * Mandates](https://developer.gocardless.com/getting-started/billing-requests/verified-mandates/) - * for more information. + * See Billing + * Requests: Creating Verified Mandates for more information. */ public BillingRequestWithActionCreateWithActionsRequest withMandateRequestVerify( MandateRequest.Verify verify) { @@ -391,9 +396,9 @@ public BillingRequestWithActionCreateWithActionsRequest withPaymentContextCode( /** * Specifies the underlying purpose of the payment. Defines the specific reason or type of * service/goods the payment relates to, improving straight-through processing and - * compliance. See [VRP Commercial Payment Purpose - * Codes](https://developer.gocardless.com/vrp-commercial-payment-purpose-codes/) for the - * complete list of valid codes. + * compliance. See + * VRP + * Commercial Payment Purpose Codes for the complete list of valid codes. */ public BillingRequestWithActionCreateWithActionsRequest withPaymentPurposeCode( String paymentPurposeCode) { @@ -434,9 +439,9 @@ public BillingRequestWithActionCreateWithActionsRequest withPaymentRequestAppFee } /** - * [ISO 4217](https://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 - * supported Eurozone countries only. + * ISO 4217 currency code. + * GBP and EUR supported; GBP with your customers in + * the UK and for EUR with your customers in supported Eurozone countries only. */ public BillingRequestWithActionCreateWithActionsRequest withPaymentRequestCurrency( String currency) { @@ -450,7 +455,6 @@ public BillingRequestWithActionCreateWithActionsRequest withPaymentRequestCurren /** * A human-readable description of the payment and/or mandate. This will be displayed to the * payer when authorising the billing request. - * */ public BillingRequestWithActionCreateWithActionsRequest withPaymentRequestDescription( String description) { @@ -464,10 +468,12 @@ public BillingRequestWithActionCreateWithActionsRequest withPaymentRequestDescri /** * This field will decide how GoCardless handles settlement of funds from the customer. * - * - `managed` will be moved through GoCardless' account, batched, and payed out. - `direct` - * will be a direct transfer from the payer's account to the merchant where invoicing will - * be handled separately. - * + *
    + *
  • managed will be moved through GoCardless' account, batched, and payed + * out.
  • + *
  • direct will be a direct transfer from the payer's account to the + * merchant where invoicing will be handled separately.
  • + *
*/ public BillingRequestWithActionCreateWithActionsRequest withPaymentRequestFundsSettlement( PaymentRequest.FundsSettlement fundsSettlement) { @@ -495,7 +501,6 @@ public BillingRequestWithActionCreateWithActionsRequest withPaymentRequestMetada * A custom payment reference defined by the merchant. It is only available for payments on * the PayTo scheme or payments using the Direct Funds settlement model on the Faster * Payments scheme. - * */ public BillingRequestWithActionCreateWithActionsRequest withPaymentRequestReference( String reference) { @@ -507,11 +512,12 @@ public BillingRequestWithActionCreateWithActionsRequest withPaymentRequestRefere } /** - * On failure, automatically retry payments using [intelligent - * retries](/success-plus/overview). Default is `false`. + * On failure, automatically retry payments using + * intelligent retries. + * Default is false. *

* Important: To be able to use intelligent retries, Success+ needs to be - * enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus). + * enabled in GoCardless dashboard. *

*

* Important: This is not applicable to Pay by Bank and VRP payments. @@ -527,11 +533,12 @@ public BillingRequestWithActionCreateWithActionsRequest withPaymentRequestRetryI } /** - * (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 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. + * (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 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. */ public BillingRequestWithActionCreateWithActionsRequest withPaymentRequestScheme( String scheme) { @@ -545,9 +552,9 @@ public BillingRequestWithActionCreateWithActionsRequest withPaymentRequestScheme /** * Specifies the high-level purpose/category of a mandate and/or payment using a set of * pre-defined categories. Provides context on the nature and reason for the payment to - * facilitate processing and compliance. See [Billing Request Purpose - * Codes](https://developer.gocardless.com/billing-request-purpose-codes/) for the complete - * list of valid codes. + * facilitate processing and compliance. See + * Billing Request + * Purpose Codes for the complete list of valid codes. */ public BillingRequestWithActionCreateWithActionsRequest withPurposeCode( PurposeCode purposeCode) { @@ -683,8 +690,9 @@ public static class CollectBankAccount { * Name of the account holder, as known by the bank. The full name provided when the * customer is created is stored and is available via the API, but is transliterated, * upcased, and truncated to 18 characters in bank submissions. This field is required - * unless the request includes a [customer bank account - * token](#javascript-flow-customer-bank-account-tokens). + * unless the request includes a customer + * bank account token. */ public CollectBankAccount withAccountHolderName(String accountHolderName) { this.accountHolderName = accountHolderName; @@ -692,8 +700,9 @@ public CollectBankAccount withAccountHolderName(String accountHolderName) { } /** - * Bank account number - see [local details](#appendix-local-bank-details) for more - * information. Alternatively you can provide an `iban`. + * Bank account number - see local + * details for more information. Alternatively you can provide an iban. */ public CollectBankAccount withAccountNumber(String accountNumber) { this.accountNumber = accountNumber; @@ -701,8 +710,9 @@ public CollectBankAccount withAccountNumber(String accountNumber) { } /** - * Account number suffix (only for bank accounts denominated in NZD) - see [local - * details](#local-bank-details-new-zealand) for more information. + * Account number suffix (only for bank accounts denominated in NZD) - see local + * details for more information. */ public CollectBankAccount withAccountNumberSuffix(String accountNumberSuffix) { this.accountNumberSuffix = accountNumberSuffix; @@ -711,8 +721,9 @@ public CollectBankAccount withAccountNumberSuffix(String accountNumberSuffix) { /** * 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. + * for bank accounts in other currencies. See local + * details for more information. */ public CollectBankAccount withAccountType(AccountType accountType) { this.accountType = accountType; @@ -720,8 +731,9 @@ public CollectBankAccount withAccountType(AccountType accountType) { } /** - * Bank code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Bank code - see local + * details for more information. Alternatively you can provide an iban. */ public CollectBankAccount withBankCode(String bankCode) { this.bankCode = bankCode; @@ -729,8 +741,9 @@ public CollectBankAccount withBankCode(String bankCode) { } /** - * Branch code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Branch code - see local + * details for more information. Alternatively you can provide an iban. */ public CollectBankAccount withBranchCode(String branchCode) { this.branchCode = branchCode; @@ -738,9 +751,10 @@ public CollectBankAccount withBranchCode(String branchCode) { } /** - * [ISO 3166-1 alpha-2 - * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). - * Defaults to the country code of the `iban` if supplied, otherwise is required. + * ISO + * 3166-1 alpha-2 code. Defaults to the country code of the iban if + * supplied, otherwise is required. */ public CollectBankAccount withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -748,8 +762,9 @@ public CollectBankAccount withCountryCode(String countryCode) { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. - * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency + * code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are + * supported. */ public CollectBankAccount withCurrency(String currency) { this.currency = currency; @@ -757,10 +772,12 @@ public CollectBankAccount withCurrency(String currency) { } /** - * International Bank Account Number. Alternatively you can provide [local - * details](#appendix-local-bank-details). IBANs are not accepted for Swedish bank - * accounts denominated in SEK - you must supply [local - * details](#local-bank-details-sweden). + * International Bank Account Number. Alternatively you can provide local + * details. IBANs are not accepted for Swedish bank accounts denominated in SEK - + * you must supply local + * details. */ public CollectBankAccount withIban(String iban) { this.iban = iban; @@ -846,10 +863,11 @@ public static class Customer { private String phoneNumber; /** - * Customer's company name. Required unless a `given_name` and `family_name` are - * provided. For Canadian customers, the use of a `company_name` value will mean that - * any mandate created from this customer will be considered to be a "Business PAD" - * (otherwise, any mandate will be considered to be a "Personal PAD"). + * Customer's company name. Required unless a given_name and + * family_name are provided. For Canadian customers, the use of a + * company_name value will mean that any mandate created from this customer + * will be considered to be a "Business PAD" (otherwise, any mandate will be considered + * to be a "Personal PAD"). */ public Customer withCompanyName(String companyName) { this.companyName = companyName; @@ -866,7 +884,7 @@ public Customer withEmail(String email) { } /** - * Customer's surname. Required unless a `company_name` is provided. + * Customer's surname. Required unless a company_name is provided. */ public Customer withFamilyName(String familyName) { this.familyName = familyName; @@ -874,7 +892,7 @@ public Customer withFamilyName(String familyName) { } /** - * Customer's first name. Required unless a `company_name` is provided. + * Customer's first name. Required unless a company_name is provided. */ public Customer withGivenName(String givenName) { this.givenName = givenName; @@ -882,13 +900,14 @@ public Customer withGivenName(String givenName) { } /** - * [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code. Used as the - * language for notification emails sent by GoCardless if your organisation does not - * send its own (see [compliance requirements](#appendix-compliance-requirements)). - * Currently only "en", "fr", "de", "pt", "es", "it", "nl", "da", "nb", "sl", "sv" are - * supported. If this is not provided and a customer was linked during billing request - * creation, the linked customer language will be used. Otherwise, the language is - * default to "en". + * ISO 639-1 code. + * Used as the language for notification emails sent by GoCardless if your organisation + * does not send its own (see compliance + * requirements). Currently only "en", "fr", "de", "pt", "es", "it", "nl", "da", + * "nb", "sl", "sv" are supported. If this is not provided and a customer was linked + * during billing request creation, the linked customer language will be used. + * Otherwise, the language is default to "en". */ public Customer withLanguage(String language) { this.language = language; @@ -905,8 +924,8 @@ public Customer withMetadata(Map metadata) { } /** - * [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone number, including - * country code. + * ITU E.123 formatted phone number, + * including country code. */ public Customer withPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; @@ -985,8 +1004,9 @@ public CustomerBillingDetail withCity(String city) { } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public CustomerBillingDetail withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -1007,9 +1027,8 @@ public CustomerBillingDetail withDanishIdentityNumber(String danishIdentityNumbe * address of the payer to whom the mandate belongs (i.e. as a result of their * completion of a mandate setup flow in their browser). * - * Not required for creating offline mandates where `authorisation_source` is set to - * telephone or paper. - * + * Not required for creating offline mandates where authorisation_source is + * set to telephone or paper. */ public CustomerBillingDetail withIpAddress(String ipAddress) { this.ipAddress = ipAddress; @@ -1026,8 +1045,8 @@ public CustomerBillingDetail withPostalCode(String postalCode) { /** * The customer's address region, county or department. For US customers a 2 letter - * [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state code is required - * (e.g. `CA` for California). + * ISO3166-2:US state code is + * required (e.g. CA for California). */ public CustomerBillingDetail withRegion(String region) { this.region = region; @@ -1155,9 +1174,9 @@ public static class SelectInstitution { private String institution; /** - * [ISO - * 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) - * alpha-2 code. The country code of the institution. If nothing is provided, + * ISO + * 3166-1 alpha-2 code. The country code of the institution. If nothing is provided, * institutions with the country code 'GB' are returned by default. */ public SelectInstitution withCountryCode(String countryCode) { @@ -1237,8 +1256,9 @@ public static class Links { private String customerBankAccount; /** - * ID of the associated [creditor](#core-endpoints-creditors). Only required if your - * account manages multiple creditors. + * ID of the associated creditor. + * Only required if your account manages multiple creditors. */ public Links withCreditor(String creditor) { this.creditor = creditor; @@ -1246,8 +1266,9 @@ public Links withCreditor(String creditor) { } /** - * ID of the [customer](#core-endpoints-customers) against which this request should be - * made. + * ID of the customer + * against which this request should be made. */ public Links withCustomer(String customer) { this.customer = customer; @@ -1255,9 +1276,9 @@ public Links withCustomer(String customer) { } /** - * (Optional) ID of the [customer_bank_account](#core-endpoints-customer-bank-accounts) + * (Optional) ID of the customer_bank_account * against which this request should be made. - * */ public Links withCustomerBankAccount(String customerBankAccount) { this.customerBankAccount = customerBankAccount; @@ -1272,15 +1293,27 @@ public static class PeriodicLimits { private Period period; /** - * The alignment of the period. + * The alignment of the period. Defaults to creation_date if not specified. * - * `calendar` - this will finish on the end of the current period. For example this will - * expire on the Monday for the current week or the January for the next year. + * calendar + *

    + *
  • the period follows fixed calendar boundaries, the same for every mandate:
  • + *
+ * week runs Monday to Sunday, month runs from the 1st to the + * last day of the calendar month, and year runs from 1 January to 31 + * December. If the mandate starts partway through a period, the limit for that first + * period is reduced proportionally to the days remaining (e.g. a monthly limit starting + * on the 15th gives roughly half the limit for that first month). * - * `creation_date` - this will finish on the next instance of the current period. For - * example Monthly it will expire on the same day of the next month, or yearly the same - * day of the next year. + * creation_date + *
    + *
  • the period follows the mandate's own start date rather than the calendar. For + * example, if the mandate starts on the 15th, each monthly period runs from the 15th to + * the 14th of the following month. The first period is a full period, not reduced + * proportionally.
  • + *
* + * Note: Has no effect when period is flexible. */ public PeriodicLimits withAlignment(Alignment alignment) { this.alignment = alignment; @@ -1288,9 +1321,9 @@ public PeriodicLimits withAlignment(Alignment alignment) { } /** - * The maximum number of payments that can be collected in this periodic limit. _Note:_ - * This is only supported for the PayTo scheme, where it is required. + * The maximum number of payments that can be collected in this periodic limit. * + * Note: Only supported for the PayTo scheme, where it is optional. */ public PeriodicLimits withMaxPayments(Integer maxPayments) { this.maxPayments = maxPayments; @@ -1298,9 +1331,10 @@ public PeriodicLimits withMaxPayments(Integer maxPayments) { } /** - * The maximum total amount that can be charged for all payments in this periodic limit. - * Required for VRP. + * The maximum total amount that can be charged for all payments in this periodic limit, + * in the lowest denomination for the currency (e.g. pence in GBP, cents in EUR). * + * Note: Required for VRP. This is not permitted for the PayTo scheme. */ public PeriodicLimits withMaxTotalAmount(Integer maxTotalAmount) { this.maxTotalAmount = maxTotalAmount; @@ -1308,8 +1342,9 @@ public PeriodicLimits withMaxTotalAmount(Integer maxTotalAmount) { } /** - * The repeating period for this mandate. Defaults to flexible for PayTo if not - * specified. + * The repeating period for this mandate. Required whenever a periodic limit is provided + * (for both VRP and PayTo). If periodic_limits is omitted entirely for PayTo, this + * defaults to flexible. */ public PeriodicLimits withPeriod(Period period) { this.period = period; @@ -1375,7 +1410,6 @@ public static class Constraints { * This is an optional field and if it is not supplied the agreement will be considered * open and will not have an end date. Keep in mind the end date must take into account * how long it will take the user to set up this agreement via the Billing Request. - * */ public Constraints withEndDate(String endDate) { this.endDate = endDate; @@ -1383,8 +1417,9 @@ public Constraints withEndDate(String endDate) { } /** - * The maximum amount that can be charged for a single payment. Required for PayTo and - * VRP. + * The maximum amount that can be charged for a single payment in the lowest + * denomination for the currency (e.g. pence in GBP, cents in EUR). Note: + * Required for PayTo and VRP. */ public Constraints withMaxAmountPerPayment(Integer maxAmountPerPayment) { this.maxAmountPerPayment = maxAmountPerPayment; @@ -1393,8 +1428,8 @@ public Constraints withMaxAmountPerPayment(Integer maxAmountPerPayment) { /** * A constraint where you can specify info (free text string) about how payments are - * calculated. _Note:_ This is only supported for ACH and PAD schemes. - * + * calculated. For use when payments vary and cannot be expressed as a fixed amount and + * frequency. Note: This is only supported for ACH and PAD schemes. */ public Constraints withPaymentMethod(String paymentMethod) { this.paymentMethod = paymentMethod; @@ -1402,7 +1437,12 @@ public Constraints withPaymentMethod(String paymentMethod) { } /** - * List of periodic limits and constraints which apply to them + * Caps on the total amount and/or number of payments that can be collected within a + * repeating period (e.g. no more than a set amount per month), as opposed to + * max_amount_per_payment which caps a single payment. + * + * Note: Required for VRP, where exactly one periodic limit must be provided. + * Optional for PayTo. */ public Constraints withPeriodicLimits(List periodicLimits) { this.periodicLimits = periodicLimits; @@ -1414,7 +1454,6 @@ public Constraints withPeriodicLimits(List periodicLimits) { * * This is an optional field and if it is not supplied the start date will be set to the * day authorisation happens. - * */ public Constraints withStartDate(String startDate) { this.startDate = startDate; @@ -1455,15 +1494,14 @@ public static class MandateRequest { private Verify verify; /** - * This field is ACH specific, sometimes referred to as [SEC - * code](https://www.moderntreasury.com/learn/sec-codes). + * This field is ACH specific, sometimes referred to as + * SEC code. * * This is the way that the payer gives authorisation to the merchant. web: * Authorisation is Internet Initiated or via Mobile Entry (maps to SEC code: WEB) * telephone: Authorisation is provided orally over telephone (maps to SEC code: TEL) * paper: Authorisation is provided in writing and signed, or similarly authenticated * (maps to SEC code: PPD) - * */ public MandateRequest withAuthorisationSource(AuthorisationSource authorisationSource) { this.authorisationSource = authorisationSource; @@ -1480,7 +1518,8 @@ public MandateRequest withConstraints(Constraints constraints) { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. + * ISO 4217 currency + * code. */ public MandateRequest withCurrency(String currency) { this.currency = currency; @@ -1490,7 +1529,6 @@ public MandateRequest withCurrency(String currency) { /** * A human-readable description of the payment and/or mandate. This will be displayed to * the payer when authorising the billing request. - * */ public MandateRequest withDescription(String description) { this.description = description; @@ -1500,10 +1538,12 @@ public MandateRequest withDescription(String description) { /** * This field will decide how GoCardless handles settlement of funds from the customer. * - * - `managed` will be moved through GoCardless' account, batched, and payed out. - - * `direct` will be a direct transfer from the payer's account to the merchant where - * invoicing will be handled separately. - * + *
    + *
  • managed will be moved through GoCardless' account, batched, and + * payed out.
  • + *
  • direct will be a direct transfer from the payer's account to the + * merchant where invoicing will be handled separately.
  • + *
*/ public MandateRequest withFundsSettlement(FundsSettlement fundsSettlement) { this.fundsSettlement = fundsSettlement; @@ -1520,9 +1560,10 @@ public MandateRequest withMetadata(Map metadata) { } /** - * Unique reference. Different schemes have different length and [character - * set](#appendix-character-sets) requirements. GoCardless will generate a unique - * reference satisfying the different scheme requirements if this field is left blank. + * Unique reference. Different schemes have different length and character + * set requirements. GoCardless will generate a unique reference satisfying the + * different scheme requirements if this field is left blank. */ public MandateRequest withReference(String reference) { this.reference = reference; @@ -1552,29 +1593,30 @@ public MandateRequest withSweeping(Boolean sweeping) { /** * Verification preference for the mandate. One of: + * *
    - *
  • `minimum`: only verify if absolutely required, such as when part of scheme - * rules
  • - *
  • `recommended`: in addition to `minimum`, use the GoCardless payment intelligence - * solution to decide if a payer should be verified
  • - *
  • `when_available`: if verification mechanisms are available, use them
  • - *
  • `always`: as `when_available`, but fail to create the Billing Request if a - * mechanism isn't available
  • + *
  • minimum: only verify if absolutely required, such as when part of + * scheme rules
  • + *
  • recommended: in addition to minimum, use the GoCardless + * payment intelligence solution to decide if a payer should be verified
  • + *
  • when_available: if verification mechanisms are available, use + * them
  • + *
  • always: as when_available, but fail to create the + * Billing Request if a mechanism isn't available
  • *
- * - * By default, all Billing Requests use the `recommended` verification preference. It - * uses GoCardless payment intelligence solution to determine if a payer is fraudulent - * or not. The verification mechanism is based on the response and the payer may be - * asked to verify themselves. If the feature is not available, `recommended` behaves - * like `minimum`. + * By default, all Billing Requests use the recommended verification + * preference. It uses GoCardless payment intelligence solution to determine if a payer + * is fraudulent or not. The verification mechanism is based on the response and the + * payer may be asked to verify themselves. If the feature is not available, + * recommended behaves like minimum. * * If you never wish to take advantage of our reduced risk products and Verified - * Mandates as they are released in new schemes, please use the `minimum` verification - * preference. + * Mandates as they are released in new schemes, please use the minimum + * verification preference. * - * See [Billing Requests: Creating Verified - * Mandates](https://developer.gocardless.com/getting-started/billing-requests/verified-mandates/) - * for more information. + * See Billing + * Requests: Creating Verified Mandates for more information. */ public MandateRequest withVerify(Verify verify) { this.verify = verify; @@ -1651,9 +1693,10 @@ public PaymentRequest withAppFee(Integer appFee) { } /** - * [ISO 4217](https://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 supported Eurozone countries only. + * ISO 4217 currency + * code. GBP and EUR supported; GBP with your + * customers in the UK and for EUR with your customers in supported + * Eurozone countries only. */ public PaymentRequest withCurrency(String currency) { this.currency = currency; @@ -1663,7 +1706,6 @@ public PaymentRequest withCurrency(String currency) { /** * A human-readable description of the payment and/or mandate. This will be displayed to * the payer when authorising the billing request. - * */ public PaymentRequest withDescription(String description) { this.description = description; @@ -1673,10 +1715,12 @@ public PaymentRequest withDescription(String description) { /** * This field will decide how GoCardless handles settlement of funds from the customer. * - * - `managed` will be moved through GoCardless' account, batched, and payed out. - - * `direct` will be a direct transfer from the payer's account to the merchant where - * invoicing will be handled separately. - * + *
    + *
  • managed will be moved through GoCardless' account, batched, and + * payed out.
  • + *
  • direct will be a direct transfer from the payer's account to the + * merchant where invoicing will be handled separately.
  • + *
*/ public PaymentRequest withFundsSettlement(FundsSettlement fundsSettlement) { this.fundsSettlement = fundsSettlement; @@ -1696,7 +1740,6 @@ public PaymentRequest withMetadata(Map metadata) { * A custom payment reference defined by the merchant. It is only available for payments * on the PayTo scheme or payments using the Direct Funds settlement model on the Faster * Payments scheme. - * */ public PaymentRequest withReference(String reference) { this.reference = reference; @@ -1704,11 +1747,13 @@ public PaymentRequest withReference(String reference) { } /** - * On failure, automatically retry payments using [intelligent - * retries](/success-plus/overview). Default is `false`. + * On failure, automatically retry payments using + * intelligent + * retries. Default is false. *

* Important: To be able to use intelligent retries, Success+ needs to - * be enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus). + * be enabled in GoCardless + * dashboard. *

*

* Important: This is not applicable to Pay by Bank and VRP payments. @@ -1720,11 +1765,12 @@ public PaymentRequest withRetryIfPossible(Boolean retryIfPossible) { } /** - * (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 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 + * (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 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. */ public PaymentRequest withScheme(String scheme) { diff --git a/src/main/java/com/gocardless/services/BlockService.java b/src/main/java/com/gocardless/services/BlockService.java index bfc91b68..72faec67 100644 --- a/src/main/java/com/gocardless/services/BlockService.java +++ b/src/main/java/com/gocardless/services/BlockService.java @@ -23,9 +23,10 @@ * * Please note: * - * - Payments and subscriptions cannot be created against a mandate in blocked state. - A mandate - * can never be transitioned out of the blocked state. - * + *

    + *
  • Payments and subscriptions cannot be created against a mandate in blocked state.
  • + *
  • A mandate can never be transitioned out of the blocked state.
  • + *
* The one exception to this is when blocking a 'bank_name'. This block will prevent bank accounts * from being created for banks that match the given name. To ensure we match bank names correctly * an existing bank account must be used when creating this block. Please be aware that we cannot @@ -62,7 +63,9 @@ public BlockGetRequest get(String identity) { } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your blocks. + * Returns a cursor-paginated + * list of your blocks. */ public BlockListRequest> list() { return new BlockListRequest<>(httpClient, ListRequest.pagingExecutor()); @@ -244,14 +247,14 @@ protected Class getResponseClass() { /** * Request class for {@link BlockService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your blocks. + * Returns a cursor-paginated + * list of your blocks. */ public static final class BlockListRequest extends ListRequest { - private String block; private String blockType; - private String createdAt; + private CreatedAt createdAt; private String reasonType; - private String updatedAt; /** * Cursor pointing to the start of the desired set. @@ -270,27 +273,60 @@ public BlockListRequest withBefore(String before) { } /** - * ID of a [Block](#core-endpoints-blocks). + * Type of entity we will seek to match against when blocking the mandate. This can + * currently be one of 'email', 'email_domain', 'bank_account', or 'bank_name'. */ - public BlockListRequest withBlock(String block) { - this.block = block; + public BlockListRequest withBlockType(String blockType) { + this.blockType = blockType; + return this; + } + + public BlockListRequest withCreatedAt(CreatedAt createdAt) { + this.createdAt = createdAt; return this; } /** - * Type of entity we will seek to match against when blocking the mandate. This can - * currently be one of 'email', 'email_domain', 'bank_account', or 'bank_name'. + * Limit to records created after the specified date-time. */ - public BlockListRequest withBlockType(String blockType) { - this.blockType = blockType; + public BlockListRequest withCreatedAtGt(String gt) { + if (createdAt == null) { + createdAt = new CreatedAt(); + } + createdAt.withGt(gt); return this; } /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was created. + * Limit to records created on or after the specified date-time. */ - public BlockListRequest withCreatedAt(String createdAt) { - this.createdAt = createdAt; + public BlockListRequest withCreatedAtGte(String gte) { + if (createdAt == null) { + createdAt = new CreatedAt(); + } + createdAt.withGte(gte); + return this; + } + + /** + * Limit to records created before the specified date-time. + */ + public BlockListRequest withCreatedAtLt(String lt) { + if (createdAt == null) { + createdAt = new CreatedAt(); + } + createdAt.withLt(lt); + return this; + } + + /** + * Limit to records created on or before the specified date-time. + */ + public BlockListRequest withCreatedAtLte(String lte) { + if (createdAt == null) { + createdAt = new CreatedAt(); + } + createdAt.withLte(lte); return this; } @@ -312,14 +348,6 @@ public BlockListRequest withReasonType(String reasonType) { return this; } - /** - * Fixed [timestamp](#api-usage-dates-and-times), recording when this resource was updated. - */ - public BlockListRequest withUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - return this; - } - private BlockListRequest(HttpClient httpClient, ListRequestExecutor executor) { super(httpClient, executor); } @@ -333,21 +361,15 @@ public BlockListRequest withHeader(String headerName, String headerValue) { protected Map getQueryParams() { ImmutableMap.Builder params = ImmutableMap.builder(); params.putAll(super.getQueryParams()); - if (block != null) { - params.put("block", block); - } if (blockType != null) { params.put("block_type", blockType); } if (createdAt != null) { - params.put("created_at", createdAt); + params.putAll(createdAt.getQueryParams()); } if (reasonType != null) { params.put("reason_type", reasonType); } - if (updatedAt != null) { - params.put("updated_at", updatedAt); - } return params.build(); } @@ -365,6 +387,62 @@ protected String getEnvelope() { protected TypeToken> getTypeToken() { return new TypeToken>() {}; } + + public static class CreatedAt { + private String gt; + private String gte; + private String lt; + private String lte; + + /** + * Limit to records created after the specified date-time. + */ + public CreatedAt withGt(String gt) { + this.gt = gt; + return this; + } + + /** + * Limit to records created on or after the specified date-time. + */ + public CreatedAt withGte(String gte) { + this.gte = gte; + return this; + } + + /** + * Limit to records created before the specified date-time. + */ + public CreatedAt withLt(String lt) { + this.lt = lt; + return this; + } + + /** + * Limit to records created on or before the specified date-time. + */ + public CreatedAt withLte(String lte) { + this.lte = lte; + return this; + } + + public Map getQueryParams() { + ImmutableMap.Builder params = ImmutableMap.builder(); + if (gt != null) { + params.put("created_at[gt]", gt); + } + if (gte != null) { + params.put("created_at[gte]", gte); + } + if (lt != null) { + params.put("created_at[lt]", lt); + } + if (lte != null) { + params.put("created_at[lte]", lte); + } + return params.build(); + } + } } /** diff --git a/src/main/java/com/gocardless/services/CreditorBankAccountService.java b/src/main/java/com/gocardless/services/CreditorBankAccountService.java index 35f8b688..1cd2b03e 100644 --- a/src/main/java/com/gocardless/services/CreditorBankAccountService.java +++ b/src/main/java/com/gocardless/services/CreditorBankAccountService.java @@ -12,13 +12,16 @@ /** * Service class for working with creditor bank account resources. * - * Creditor Bank Accounts hold the bank details of a [creditor](#core-endpoints-creditors). These - * are the bank accounts which your [payouts](#core-endpoints-payouts) will be sent to. + * Creditor Bank Accounts hold the bank details of a + * creditor. + * These are the bank accounts which your + * payouts will + * be sent to. * * Note that creditor bank accounts must be unique, and so you will encounter a - * `bank_account_exists` error if you try to create a duplicate bank account. You may wish to handle - * this by updating the existing record instead, the ID of which will be provided as - * `links[creditor_bank_account]` in the error response. + * bank_account_exists error if you try to create a duplicate bank account. You may + * wish to handle this by updating the existing record instead, the ID of which will be provided as + * links[creditor_bank_account] in the error response. * *

* Restricted: This API is not available for partner integrations. @@ -44,8 +47,9 @@ public CreditorBankAccountCreateRequest create() { } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your creditor bank - * accounts. + * Returns a cursor-paginated + * list of your creditor bank accounts. */ public CreditorBankAccountListRequest> list() { return new CreditorBankAccountListRequest<>(httpClient, @@ -67,7 +71,8 @@ public CreditorBankAccountGetRequest get(String identity) { /** * Immediately disables the bank account, no money can be paid out to a disabled account. * - * This will return a `disable_failed` error if the bank account has already been disabled. + * This will return a disable_failed error if the bank account has already been + * disabled. * * A disabled bank account can be re-enabled by creating a new bank account resource with the * same details. @@ -97,8 +102,9 @@ public static final class CreditorBankAccountCreateRequest /** * 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. + * stored with the linked creditor. + * This field will be transliterated, upcased and truncated to 18 characters. */ public CreditorBankAccountCreateRequest withAccountHolderName(String accountHolderName) { this.accountHolderName = accountHolderName; @@ -106,8 +112,9 @@ public CreditorBankAccountCreateRequest withAccountHolderName(String accountHold } /** - * Bank account number - see [local details](#appendix-local-bank-details) for more - * information. Alternatively you can provide an `iban`. + * Bank account number - see local + * details for more information. Alternatively you can provide an iban. */ public CreditorBankAccountCreateRequest withAccountNumber(String accountNumber) { this.accountNumber = accountNumber; @@ -116,8 +123,9 @@ public CreditorBankAccountCreateRequest withAccountNumber(String accountNumber) /** * 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. + * bank accounts in other currencies. See local + * details for more information. */ public CreditorBankAccountCreateRequest withAccountType(AccountType accountType) { this.accountType = accountType; @@ -125,8 +133,9 @@ public CreditorBankAccountCreateRequest withAccountType(AccountType accountType) } /** - * Bank code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Bank code - see local + * details for more information. Alternatively you can provide an iban. */ public CreditorBankAccountCreateRequest withBankCode(String bankCode) { this.bankCode = bankCode; @@ -134,8 +143,9 @@ public CreditorBankAccountCreateRequest withBankCode(String bankCode) { } /** - * Branch code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Branch code - see local + * details for more information. Alternatively you can provide an iban. */ public CreditorBankAccountCreateRequest withBranchCode(String branchCode) { this.branchCode = branchCode; @@ -143,9 +153,10 @@ public CreditorBankAccountCreateRequest withBranchCode(String branchCode) { } /** - * [ISO 3166-1 alpha-2 - * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). - * Defaults to the country code of the `iban` if supplied, otherwise is required. + * ISO + * 3166-1 alpha-2 code. Defaults to the country code of the iban if + * supplied, otherwise is required. */ public CreditorBankAccountCreateRequest withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -153,8 +164,8 @@ public CreditorBankAccountCreateRequest withCountryCode(String countryCode) { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public CreditorBankAccountCreateRequest withCurrency(String currency) { this.currency = currency; @@ -162,9 +173,12 @@ public CreditorBankAccountCreateRequest withCurrency(String currency) { } /** - * International Bank Account Number. Alternatively you can provide [local - * details](#appendix-local-bank-details). IBANs are not accepted for Swedish bank accounts - * denominated in SEK - you must supply [local details](#local-bank-details-sweden). + * International Bank Account Number. Alternatively you can provide local + * details. IBANs are not accepted for Swedish bank accounts denominated in SEK - you + * must supply + * local + * details. */ public CreditorBankAccountCreateRequest withIban(String iban) { this.iban = iban; @@ -177,7 +191,9 @@ public CreditorBankAccountCreateRequest withLinks(Links links) { } /** - * ID of the [creditor](#core-endpoints-creditors) that owns this bank account. + * ID of the creditor + * that owns this bank account. */ public CreditorBankAccountCreateRequest withLinksCreditor(String creditor) { if (links == null) { @@ -209,8 +225,8 @@ public CreditorBankAccountCreateRequest withMetadata(String key, String value) { } /** - * Defaults to `true`. When this is set to `true`, it will cause this bank account to be set - * as the account that GoCardless will pay out to. + * Defaults to true. When this is set to true, it will cause this + * bank account to be set as the account that GoCardless will pay out to. */ public CreditorBankAccountCreateRequest withSetAsDefaultPayoutAccount( Boolean setAsDefaultPayoutAccount) { @@ -278,7 +294,9 @@ public static class Links { private String creditor; /** - * ID of the [creditor](#core-endpoints-creditors) that owns this bank account. + * ID of the creditor + * that owns this bank account. */ public Links withCreditor(String creditor) { this.creditor = creditor; @@ -290,8 +308,9 @@ public Links withCreditor(String creditor) { /** * Request class for {@link CreditorBankAccountService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your creditor bank - * accounts. + * Returns a cursor-paginated + * list of your creditor bank accounts. */ public static final class CreditorBankAccountListRequest extends ListRequest { @@ -373,8 +392,8 @@ public CreditorBankAccountListRequest withCreditor(String creditor) { } /** - * If `true`, only return enabled bank accounts. If `false`, only return disabled bank - * accounts. + * If true, only return enabled bank accounts. If false, only + * return disabled bank accounts. */ public CreditorBankAccountListRequest withEnabled(Boolean enabled) { this.enabled = enabled; @@ -535,7 +554,8 @@ protected Class getResponseClass() { * * Immediately disables the bank account, no money can be paid out to a disabled account. * - * This will return a `disable_failed` error if the bank account has already been disabled. + * This will return a disable_failed error if the bank account has already been + * disabled. * * A disabled bank account can be re-enabled by creating a new bank account resource with the * same details. diff --git a/src/main/java/com/gocardless/services/CreditorService.java b/src/main/java/com/gocardless/services/CreditorService.java index 6f442726..cadb7b6e 100644 --- a/src/main/java/com/gocardless/services/CreditorService.java +++ b/src/main/java/com/gocardless/services/CreditorService.java @@ -12,9 +12,11 @@ /** * Service class for working with creditor resources. * - * Each [payment](#core-endpoints-payments) taken through the API is linked to a "creditor", to whom - * the payment is then paid out. In most cases your organisation will have a single "creditor", but - * the API also supports collecting payments on behalf of others. + * Each + * payment + * taken through the API is linked to a "creditor", to whom the payment is then paid out. In most + * cases your organisation will have a single "creditor", but the API also supports collecting + * payments on behalf of others. * * Currently, for Anti Money Laundering reasons, any creditors you add must be directly related to * your organisation. @@ -38,7 +40,9 @@ public CreditorCreateRequest create() { } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your creditors. + * Returns a cursor-paginated + * list of your creditors. */ public CreditorListRequest> list() { return new CreditorListRequest<>(httpClient, ListRequest.pagingExecutor()); @@ -76,11 +80,10 @@ public static final class CreditorCreateRequest extends IdempotentPostRequestbank_reference_prefix was ACME, the bank reference + * of a payout sent to that creditor could be ACME-8G7Q8. * * This prefix is also used for refunds in EUR and GBP. - * */ public CreditorCreateRequest withBankReferencePrefix(String bankReferencePrefix) { this.bankReferencePrefix = bankReferencePrefix; @@ -88,8 +91,9 @@ public CreditorCreateRequest withBankReferencePrefix(String bankReferencePrefix) } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public CreditorCreateRequest withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -97,8 +101,9 @@ public CreditorCreateRequest withCountryCode(String countryCode) { } /** - * The type of business of the creditor. Currently, `individual`, `company`, `charity`, - * `partnership`, and `trust` are supported. + * The type of business of the creditor. Currently, individual, + * company, charity, partnership, and + * trust are supported. */ public CreditorCreateRequest withCreditorType(CreditorType creditorType) { this.creditorType = creditorType; @@ -188,7 +193,9 @@ public String toString() { /** * Request class for {@link CreditorService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your creditors. + * Returns a cursor-paginated + * list of your creditors. */ public static final class CreditorListRequest extends ListRequest { private CreatedAt createdAt; @@ -452,11 +459,10 @@ public CreditorUpdateRequest withAddressLine3(String addressLine3) { /** * Prefix for the bank reference of payouts sent to this creditor. For instance, if the - * creditor's `bank_reference_prefix` was `ACME`, the bank reference of a payout sent to - * that creditor could be `ACME-8G7Q8`. + * creditor's bank_reference_prefix was ACME, the bank reference + * of a payout sent to that creditor could be ACME-8G7Q8. * * This prefix is also used for refunds in EUR and GBP. - * */ public CreditorUpdateRequest withBankReferencePrefix(String bankReferencePrefix) { this.bankReferencePrefix = bankReferencePrefix; @@ -472,8 +478,9 @@ public CreditorUpdateRequest withCity(String city) { } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public CreditorUpdateRequest withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -486,8 +493,9 @@ public CreditorUpdateRequest withLinks(Links links) { } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in AUD. + * ID of the bank + * account which is set up to receive payouts in AUD. */ public CreditorUpdateRequest withLinksDefaultAudPayoutAccount( String defaultAudPayoutAccount) { @@ -499,8 +507,9 @@ public CreditorUpdateRequest withLinksDefaultAudPayoutAccount( } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in CAD. + * ID of the bank + * account which is set up to receive payouts in CAD. */ public CreditorUpdateRequest withLinksDefaultCadPayoutAccount( String defaultCadPayoutAccount) { @@ -512,8 +521,9 @@ public CreditorUpdateRequest withLinksDefaultCadPayoutAccount( } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in DKK. + * ID of the bank + * account which is set up to receive payouts in DKK. */ public CreditorUpdateRequest withLinksDefaultDkkPayoutAccount( String defaultDkkPayoutAccount) { @@ -525,8 +535,9 @@ public CreditorUpdateRequest withLinksDefaultDkkPayoutAccount( } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in EUR. + * ID of the bank + * account which is set up to receive payouts in EUR. */ public CreditorUpdateRequest withLinksDefaultEurPayoutAccount( String defaultEurPayoutAccount) { @@ -538,8 +549,9 @@ public CreditorUpdateRequest withLinksDefaultEurPayoutAccount( } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in GBP. + * ID of the bank + * account which is set up to receive payouts in GBP. */ public CreditorUpdateRequest withLinksDefaultGbpPayoutAccount( String defaultGbpPayoutAccount) { @@ -551,8 +563,9 @@ public CreditorUpdateRequest withLinksDefaultGbpPayoutAccount( } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in NZD. + * ID of the bank + * account which is set up to receive payouts in NZD. */ public CreditorUpdateRequest withLinksDefaultNzdPayoutAccount( String defaultNzdPayoutAccount) { @@ -564,8 +577,9 @@ public CreditorUpdateRequest withLinksDefaultNzdPayoutAccount( } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in SEK. + * ID of the bank + * account which is set up to receive payouts in SEK. */ public CreditorUpdateRequest withLinksDefaultSekPayoutAccount( String defaultSekPayoutAccount) { @@ -577,8 +591,9 @@ public CreditorUpdateRequest withLinksDefaultSekPayoutAccount( } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in USD. + * ID of the bank + * account which is set up to receive payouts in USD. */ public CreditorUpdateRequest withLinksDefaultUsdPayoutAccount( String defaultUsdPayoutAccount) { @@ -661,8 +676,9 @@ public static class Links { private String defaultUsdPayoutAccount; /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in AUD. + * ID of the bank + * account which is set up to receive payouts in AUD. */ public Links withDefaultAudPayoutAccount(String defaultAudPayoutAccount) { this.defaultAudPayoutAccount = defaultAudPayoutAccount; @@ -670,8 +686,9 @@ public Links withDefaultAudPayoutAccount(String defaultAudPayoutAccount) { } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in CAD. + * ID of the bank + * account which is set up to receive payouts in CAD. */ public Links withDefaultCadPayoutAccount(String defaultCadPayoutAccount) { this.defaultCadPayoutAccount = defaultCadPayoutAccount; @@ -679,8 +696,9 @@ public Links withDefaultCadPayoutAccount(String defaultCadPayoutAccount) { } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in DKK. + * ID of the bank + * account which is set up to receive payouts in DKK. */ public Links withDefaultDkkPayoutAccount(String defaultDkkPayoutAccount) { this.defaultDkkPayoutAccount = defaultDkkPayoutAccount; @@ -688,8 +706,9 @@ public Links withDefaultDkkPayoutAccount(String defaultDkkPayoutAccount) { } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in EUR. + * ID of the bank + * account which is set up to receive payouts in EUR. */ public Links withDefaultEurPayoutAccount(String defaultEurPayoutAccount) { this.defaultEurPayoutAccount = defaultEurPayoutAccount; @@ -697,8 +716,9 @@ public Links withDefaultEurPayoutAccount(String defaultEurPayoutAccount) { } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in GBP. + * ID of the bank + * account which is set up to receive payouts in GBP. */ public Links withDefaultGbpPayoutAccount(String defaultGbpPayoutAccount) { this.defaultGbpPayoutAccount = defaultGbpPayoutAccount; @@ -706,8 +726,9 @@ public Links withDefaultGbpPayoutAccount(String defaultGbpPayoutAccount) { } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in NZD. + * ID of the bank + * account which is set up to receive payouts in NZD. */ public Links withDefaultNzdPayoutAccount(String defaultNzdPayoutAccount) { this.defaultNzdPayoutAccount = defaultNzdPayoutAccount; @@ -715,8 +736,9 @@ public Links withDefaultNzdPayoutAccount(String defaultNzdPayoutAccount) { } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in SEK. + * ID of the bank + * account which is set up to receive payouts in SEK. */ public Links withDefaultSekPayoutAccount(String defaultSekPayoutAccount) { this.defaultSekPayoutAccount = defaultSekPayoutAccount; @@ -724,8 +746,9 @@ public Links withDefaultSekPayoutAccount(String defaultSekPayoutAccount) { } /** - * ID of the [bank account](#core-endpoints-creditor-bank-accounts) which is set up to - * receive payouts in USD. + * ID of the bank + * account which is set up to receive payouts in USD. */ public Links withDefaultUsdPayoutAccount(String defaultUsdPayoutAccount) { this.defaultUsdPayoutAccount = defaultUsdPayoutAccount; diff --git a/src/main/java/com/gocardless/services/CurrencyExchangeRateService.java b/src/main/java/com/gocardless/services/CurrencyExchangeRateService.java index 6270d55f..7b8e4a13 100644 --- a/src/main/java/com/gocardless/services/CurrencyExchangeRateService.java +++ b/src/main/java/com/gocardless/services/CurrencyExchangeRateService.java @@ -25,7 +25,9 @@ public CurrencyExchangeRateService(HttpClient httpClient) { } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of all exchange rates. + * Returns a cursor-paginated + * list of all exchange rates. */ public CurrencyExchangeRateListRequest> list() { return new CurrencyExchangeRateListRequest<>(httpClient, @@ -40,7 +42,9 @@ public CurrencyExchangeRateListRequest> all() { /** * Request class for {@link CurrencyExchangeRateService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of all exchange rates. + * Returns a cursor-paginated + * list of all exchange rates. */ public static final class CurrencyExchangeRateListRequest extends ListRequest { diff --git a/src/main/java/com/gocardless/services/CustomerBankAccountService.java b/src/main/java/com/gocardless/services/CustomerBankAccountService.java index 3522c73f..f66055cd 100644 --- a/src/main/java/com/gocardless/services/CustomerBankAccountService.java +++ b/src/main/java/com/gocardless/services/CustomerBankAccountService.java @@ -12,18 +12,21 @@ /** * Service class for working with customer bank account resources. * - * Customer Bank Accounts hold the bank details of a [customer](#core-endpoints-customers). They - * always belong to a [customer](#core-endpoints-customers), and may be linked to several Direct - * Debit [mandates](#core-endpoints-mandates). + * Customer Bank Accounts hold the bank details of a + * customer. + * They always belong to a + * customer, + * and may be linked to several Direct Debit + * mandates. * * Note that customer bank accounts must be unique, and so you will encounter a - * `bank_account_exists` error if you try to create a duplicate bank account. You may wish to handle - * this by updating the existing record instead, the ID of which will be provided as - * `links[customer_bank_account]` in the error response. + * bank_account_exists error if you try to create a duplicate bank account. You may + * wish to handle this by updating the existing record instead, the ID of which will be provided as + * links[customer_bank_account] in the error response. * - * _Note:_ To ensure the customer's bank accounts are valid, verify them first using - * [bank_details_lookups](#bank-details-lookups-perform-a-bank-details-lookup), before proceeding - * with creating the accounts + * Note: To ensure the customer's bank accounts are valid, verify them first using bank_details_lookups, + * before proceeding with creating the accounts */ public class CustomerBankAccountService { private final HttpClient httpClient; @@ -42,21 +45,27 @@ public CustomerBankAccountService(HttpClient httpClient) { * * There are three different ways to supply bank account details: * - * - [Local details](#appendix-local-bank-details) - * - * - IBAN - * - * - [Customer Bank Account Tokens](#javascript-flow-create-a-customer-bank-account-token) - * - * For more information on the different fields required in each country, see [local bank - * details](#appendix-local-bank-details). + *

+ * For more information on the different fields required in each country, see + * local + * bank details. */ public CustomerBankAccountCreateRequest create() { return new CustomerBankAccountCreateRequest(httpClient); } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your bank accounts. + * Returns a cursor-paginated + * list of your bank accounts. */ public CustomerBankAccountListRequest> list() { return new CustomerBankAccountListRequest<>(httpClient, @@ -85,7 +94,8 @@ public CustomerBankAccountUpdateRequest update(String identity) { /** * Immediately cancels all associated mandates and cancellable payments. * - * This will return a `disable_failed` error if the bank account has already been disabled. + * This will return a disable_failed error if the bank account has already been + * disabled. * * A disabled bank account can be re-enabled by creating a new bank account resource with the * same details. @@ -101,14 +111,18 @@ public CustomerBankAccountDisableRequest disable(String identity) { * * There are three different ways to supply bank account details: * - * - [Local details](#appendix-local-bank-details) - * - * - IBAN - * - * - [Customer Bank Account Tokens](#javascript-flow-create-a-customer-bank-account-token) - * - * For more information on the different fields required in each country, see [local bank - * details](#appendix-local-bank-details). + * + * For more information on the different fields required in each country, see + * local + * bank details. */ public static final class CustomerBankAccountCreateRequest extends IdempotentPostRequest { @@ -127,8 +141,9 @@ public static final class CustomerBankAccountCreateRequest * Name of the account holder, as known by the bank. The full name provided when the * customer is created is stored and is available via the API, but is transliterated, * upcased, and truncated to 18 characters in bank submissions. This field is required - * unless the request includes a [customer bank account - * token](#javascript-flow-customer-bank-account-tokens). + * unless the request includes a customer + * bank account token. */ public CustomerBankAccountCreateRequest withAccountHolderName(String accountHolderName) { this.accountHolderName = accountHolderName; @@ -136,8 +151,9 @@ public CustomerBankAccountCreateRequest withAccountHolderName(String accountHold } /** - * Bank account number - see [local details](#appendix-local-bank-details) for more - * information. Alternatively you can provide an `iban`. + * Bank account number - see local + * details for more information. Alternatively you can provide an iban. */ public CustomerBankAccountCreateRequest withAccountNumber(String accountNumber) { this.accountNumber = accountNumber; @@ -146,8 +162,9 @@ public CustomerBankAccountCreateRequest withAccountNumber(String accountNumber) /** * 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. + * bank accounts in other currencies. See local + * details for more information. */ public CustomerBankAccountCreateRequest withAccountType(AccountType accountType) { this.accountType = accountType; @@ -155,8 +172,9 @@ public CustomerBankAccountCreateRequest withAccountType(AccountType accountType) } /** - * Bank code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Bank code - see local + * details for more information. Alternatively you can provide an iban. */ public CustomerBankAccountCreateRequest withBankCode(String bankCode) { this.bankCode = bankCode; @@ -164,8 +182,9 @@ public CustomerBankAccountCreateRequest withBankCode(String bankCode) { } /** - * Branch code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Branch code - see local + * details for more information. Alternatively you can provide an iban. */ public CustomerBankAccountCreateRequest withBranchCode(String branchCode) { this.branchCode = branchCode; @@ -173,9 +192,10 @@ public CustomerBankAccountCreateRequest withBranchCode(String branchCode) { } /** - * [ISO 3166-1 alpha-2 - * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). - * Defaults to the country code of the `iban` if supplied, otherwise is required. + * ISO + * 3166-1 alpha-2 code. Defaults to the country code of the iban if + * supplied, otherwise is required. */ public CustomerBankAccountCreateRequest withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -183,8 +203,8 @@ public CustomerBankAccountCreateRequest withCountryCode(String countryCode) { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public CustomerBankAccountCreateRequest withCurrency(String currency) { this.currency = currency; @@ -192,9 +212,12 @@ public CustomerBankAccountCreateRequest withCurrency(String currency) { } /** - * International Bank Account Number. Alternatively you can provide [local - * details](#appendix-local-bank-details). IBANs are not accepted for Swedish bank accounts - * denominated in SEK - you must supply [local details](#local-bank-details-sweden). + * International Bank Account Number. Alternatively you can provide local + * details. IBANs are not accepted for Swedish bank accounts denominated in SEK - you + * must supply + * local + * details. */ public CustomerBankAccountCreateRequest withIban(String iban) { this.iban = iban; @@ -207,7 +230,9 @@ public CustomerBankAccountCreateRequest withLinks(Links links) { } /** - * ID of the [customer](#core-endpoints-customers) that owns this bank account. + * ID of the customer + * that owns this bank account. */ public CustomerBankAccountCreateRequest withLinksCustomer(String customer) { if (links == null) { @@ -218,8 +243,9 @@ public CustomerBankAccountCreateRequest withLinksCustomer(String customer) { } /** - * ID of a [customer bank account token](#javascript-flow-customer-bank-account-tokens) to - * use in place of bank account parameters. + * ID of a customer + * bank account token to use in place of bank account parameters. */ public CustomerBankAccountCreateRequest withLinksCustomerBankAccountToken( String customerBankAccountToken) { @@ -312,7 +338,9 @@ public static class Links { private String customerBankAccountToken; /** - * ID of the [customer](#core-endpoints-customers) that owns this bank account. + * ID of the customer + * that owns this bank account. */ public Links withCustomer(String customer) { this.customer = customer; @@ -320,8 +348,9 @@ public Links withCustomer(String customer) { } /** - * ID of a [customer bank account token](#javascript-flow-customer-bank-account-tokens) - * to use in place of bank account parameters. + * ID of a customer + * bank account token to use in place of bank account parameters. */ public Links withCustomerBankAccountToken(String customerBankAccountToken) { this.customerBankAccountToken = customerBankAccountToken; @@ -333,7 +362,9 @@ public Links withCustomerBankAccountToken(String customerBankAccountToken) { /** * Request class for {@link CustomerBankAccountService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your bank accounts. + * Returns a cursor-paginated + * list of your bank accounts. */ public static final class CustomerBankAccountListRequest extends ListRequest { @@ -646,7 +677,8 @@ protected boolean hasBody() { * * Immediately cancels all associated mandates and cancellable payments. * - * This will return a `disable_failed` error if the bank account has already been disabled. + * This will return a disable_failed error if the bank account has already been + * disabled. * * A disabled bank account can be re-enabled by creating a new bank account resource with the * same details. diff --git a/src/main/java/com/gocardless/services/CustomerNotificationService.java b/src/main/java/com/gocardless/services/CustomerNotificationService.java index b8b9ecdf..565678ff 100644 --- a/src/main/java/com/gocardless/services/CustomerNotificationService.java +++ b/src/main/java/com/gocardless/services/CustomerNotificationService.java @@ -10,7 +10,7 @@ * * Customer Notifications represent the notification which is due to be sent to a customer after an * event has happened. The event, the resource and the customer to be notified are all identified in - * the `links` property. + * the links property. * * Note that these are ephemeral records - once the notification has been actioned in some way, it * is no longer visible using this API. @@ -35,9 +35,8 @@ public CustomerNotificationService(HttpClient httpClient) { /** * "Handling" a notification means that you have sent the notification yourself (and don't want * GoCardless to send it). If the notification has already been actioned, or the deadline to - * notify has passed, this endpoint will return an `already_actioned` error and you should not - * take further action. This endpoint takes no additional parameters. - * + * notify has passed, this endpoint will return an already_actioned error and you + * should not take further action. This endpoint takes no additional parameters. */ public CustomerNotificationHandleRequest handle(String identity) { return new CustomerNotificationHandleRequest(httpClient, identity); @@ -48,9 +47,8 @@ public CustomerNotificationHandleRequest handle(String identity) { * * "Handling" a notification means that you have sent the notification yourself (and don't want * GoCardless to send it). If the notification has already been actioned, or the deadline to - * notify has passed, this endpoint will return an `already_actioned` error and you should not - * take further action. This endpoint takes no additional parameters. - * + * notify has passed, this endpoint will return an already_actioned error and you + * should not take further action. This endpoint takes no additional parameters. */ public static final class CustomerNotificationHandleRequest extends PostRequest { diff --git a/src/main/java/com/gocardless/services/CustomerService.java b/src/main/java/com/gocardless/services/CustomerService.java index 9bbba6c9..16253bc8 100644 --- a/src/main/java/com/gocardless/services/CustomerService.java +++ b/src/main/java/com/gocardless/services/CustomerService.java @@ -12,9 +12,10 @@ /** * Service class for working with customer resources. * - * Customer objects hold the contact details for a customer. A customer can have several [customer - * bank accounts](#core-endpoints-customer-bank-accounts), which in turn can have several Direct - * Debit [mandates](#core-endpoints-mandates). + * Customer objects hold the contact details for a customer. A customer can have several customer + * bank accounts, which in turn can have several Direct Debit + * mandates. */ public class CustomerService { private final HttpClient httpClient; @@ -35,7 +36,9 @@ public CustomerCreateRequest create() { } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your customers. + * Returns a cursor-paginated + * list of your customers. */ public CustomerListRequest> list() { return new CustomerListRequest<>(httpClient, ListRequest.pagingExecutor()); @@ -128,10 +131,11 @@ public CustomerCreateRequest withCity(String city) { } /** - * Customer's company name. Required unless a `given_name` and `family_name` are provided. - * For Canadian customers, the use of a `company_name` value will mean that any mandate - * created from this customer will be considered to be a "Business PAD" (otherwise, any - * mandate will be considered to be a "Personal PAD"). + * Customer's company name. Required unless a given_name and + * family_name are provided. For Canadian customers, the use of a + * company_name value will mean that any mandate created from this customer + * will be considered to be a "Business PAD" (otherwise, any mandate will be considered to + * be a "Personal PAD"). */ public CustomerCreateRequest withCompanyName(String companyName) { this.companyName = companyName; @@ -139,8 +143,9 @@ public CustomerCreateRequest withCompanyName(String companyName) { } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public CustomerCreateRequest withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -166,7 +171,7 @@ public CustomerCreateRequest withEmail(String email) { } /** - * Customer's surname. Required unless a `company_name` is provided. + * Customer's surname. Required unless a company_name is provided. */ public CustomerCreateRequest withFamilyName(String familyName) { this.familyName = familyName; @@ -174,7 +179,7 @@ public CustomerCreateRequest withFamilyName(String familyName) { } /** - * Customer's first name. Required unless a `company_name` is provided. + * Customer's first name. Required unless a company_name is provided. */ public CustomerCreateRequest withGivenName(String givenName) { this.givenName = givenName; @@ -182,12 +187,13 @@ public CustomerCreateRequest withGivenName(String givenName) { } /** - * [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code. Used as the - * language for notification emails sent by GoCardless if your organisation does not send - * its own (see [compliance requirements](#appendix-compliance-requirements)). Currently - * only "en", "fr", "de", "pt", "es", "it", "nl", "da", "nb", "sl", "sv" are supported. If - * this is not provided, the language will be chosen based on the `country_code` (if - * supplied) or default to "en". + * ISO 639-1 code. Used + * as the language for notification emails sent by GoCardless if your organisation does not + * send its own (see compliance + * requirements). Currently only "en", "fr", "de", "pt", "es", "it", "nl", "da", "nb", + * "sl", "sv" are supported. If this is not provided, the language will be chosen based on + * the country_code (if supplied) or default to "en". */ public CustomerCreateRequest withLanguage(String language) { this.language = language; @@ -216,8 +222,8 @@ public CustomerCreateRequest withMetadata(String key, String value) { } /** - * [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone number, including - * country code. + * ITU E.123 formatted phone number, + * including country code. */ public CustomerCreateRequest withPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; @@ -234,8 +240,8 @@ public CustomerCreateRequest withPostalCode(String postalCode) { /** * The customer's address region, county or department. For US customers a 2 letter - * [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state code is required (e.g. - * `CA` for California). + * ISO3166-2:US state code is + * required (e.g. CA for California). */ public CustomerCreateRequest withRegion(String region) { this.region = region; @@ -299,7 +305,9 @@ protected boolean hasBody() { /** * Request class for {@link CustomerService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your customers. + * Returns a cursor-paginated + * list of your customers. */ public static final class CustomerListRequest extends ListRequest { private ActionRequired actionRequired; @@ -382,8 +390,8 @@ public CustomerListRequest withCreatedAtLte(String lte) { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public CustomerListRequest withCurrency(Currency currency) { this.currency = currency; @@ -400,9 +408,10 @@ public CustomerListRequest withLimit(Integer limit) { /** * The direction to sort in. One of: + * *
    - *
  • `asc`
  • - *
  • `desc`
  • + *
  • asc
  • + *
  • desc
  • *
*/ public CustomerListRequest withSortDirection(SortDirection sortDirection) { @@ -412,10 +421,11 @@ public CustomerListRequest withSortDirection(SortDirection sortDirection) { /** * Field by which to sort records. One of: + * *
    - *
  • `name`
  • - *
  • `company_name`
  • - *
  • `created_at`
  • + *
  • name
  • + *
  • company_name
  • + *
  • created_at
  • *
*/ public CustomerListRequest withSortField(SortField sortField) { @@ -682,10 +692,11 @@ public CustomerUpdateRequest withCity(String city) { } /** - * Customer's company name. Required unless a `given_name` and `family_name` are provided. - * For Canadian customers, the use of a `company_name` value will mean that any mandate - * created from this customer will be considered to be a "Business PAD" (otherwise, any - * mandate will be considered to be a "Personal PAD"). + * Customer's company name. Required unless a given_name and + * family_name are provided. For Canadian customers, the use of a + * company_name value will mean that any mandate created from this customer + * will be considered to be a "Business PAD" (otherwise, any mandate will be considered to + * be a "Personal PAD"). */ public CustomerUpdateRequest withCompanyName(String companyName) { this.companyName = companyName; @@ -693,8 +704,9 @@ public CustomerUpdateRequest withCompanyName(String companyName) { } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public CustomerUpdateRequest withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -720,7 +732,7 @@ public CustomerUpdateRequest withEmail(String email) { } /** - * Customer's surname. Required unless a `company_name` is provided. + * Customer's surname. Required unless a company_name is provided. */ public CustomerUpdateRequest withFamilyName(String familyName) { this.familyName = familyName; @@ -728,7 +740,7 @@ public CustomerUpdateRequest withFamilyName(String familyName) { } /** - * Customer's first name. Required unless a `company_name` is provided. + * Customer's first name. Required unless a company_name is provided. */ public CustomerUpdateRequest withGivenName(String givenName) { this.givenName = givenName; @@ -736,12 +748,13 @@ public CustomerUpdateRequest withGivenName(String givenName) { } /** - * [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code. Used as the - * language for notification emails sent by GoCardless if your organisation does not send - * its own (see [compliance requirements](#appendix-compliance-requirements)). Currently - * only "en", "fr", "de", "pt", "es", "it", "nl", "da", "nb", "sl", "sv" are supported. If - * this is not provided, the language will be chosen based on the `country_code` (if - * supplied) or default to "en". + * ISO 639-1 code. Used + * as the language for notification emails sent by GoCardless if your organisation does not + * send its own (see compliance + * requirements). Currently only "en", "fr", "de", "pt", "es", "it", "nl", "da", "nb", + * "sl", "sv" are supported. If this is not provided, the language will be chosen based on + * the country_code (if supplied) or default to "en". */ public CustomerUpdateRequest withLanguage(String language) { this.language = language; @@ -770,8 +783,8 @@ public CustomerUpdateRequest withMetadata(String key, String value) { } /** - * [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone number, including - * country code. + * ITU E.123 formatted phone number, + * including country code. */ public CustomerUpdateRequest withPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; @@ -788,8 +801,8 @@ public CustomerUpdateRequest withPostalCode(String postalCode) { /** * The customer's address region, county or department. For US customers a 2 letter - * [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state code is required (e.g. - * `CA` for California). + * ISO3166-2:US state code is + * required (e.g. CA for California). */ public CustomerUpdateRequest withRegion(String region) { this.region = region; diff --git a/src/main/java/com/gocardless/services/EventService.java b/src/main/java/com/gocardless/services/EventService.java index 77330865..bb4e53cd 100644 --- a/src/main/java/com/gocardless/services/EventService.java +++ b/src/main/java/com/gocardless/services/EventService.java @@ -14,8 +14,16 @@ * Events are stored for all webhooks. An event refers to a resource which has been updated, for * example a payment which has been collected, or a mandate which has been transferred. Event * creation is an asynchronous process, so it can take some time between an action occurring and its - * corresponding event getting included in API responses. See [here](#event-types) for a complete + * corresponding event getting included in API responses. See + * here for a complete * list of event types. + * + *

+ * Important: Events older than 18 months will be archived and no longer accessible + * via the API or exports. Archival will begin no sooner than 1 August 2026 in sandbox environments, + * and no sooner than 1 October 2026 in live environments. Events within the 18-month window are + * unaffected. If you need archived data, contact GoCardless support. + *

*/ public class EventService { private final HttpClient httpClient; @@ -29,7 +37,15 @@ public EventService(HttpClient httpClient) { } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your events. + * Returns a cursor-paginated + * list of your events. + * + *

+ * Important: This endpoint will no longer return events older than 18 months, + * including when filtering by resource. This takes effect no sooner than 1 August 2026 in + * sandbox environments, and no sooner than 1 October 2026 in live environments. + *

*/ public EventListRequest> list() { return new EventListRequest<>(httpClient, ListRequest.pagingExecutor()); @@ -49,7 +65,15 @@ public EventGetRequest get(String identity) { /** * Request class for {@link EventService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your events. + * Returns a cursor-paginated + * list of your events. + * + *

+ * Important: This endpoint will no longer return events older than 18 months, + * including when filtering by resource. This takes effect no sooner than 1 August 2026 in + * sandbox environments, and no sooner than 1 October 2026 in live environments. + *

*/ public static final class EventListRequest extends ListRequest { private String action; @@ -72,7 +96,7 @@ public static final class EventListRequest extends ListRequest { private String subscription; /** - * Limit to events with a given `action`. + * Limit to events with a given action. */ public EventListRequest withAction(String action) { this.action = action; @@ -96,8 +120,10 @@ public EventListRequest withBefore(String before) { } /** - * ID of a [billing request](#billing-requests-billing-requests). If specified, this - * endpoint will return all events for the given billing request. + * ID of a billing + * request. If specified, this endpoint will return all events for the given billing + * request. */ public EventListRequest withBillingRequest(String billingRequest) { this.billingRequest = billingRequest; @@ -154,8 +180,9 @@ public EventListRequest withCreatedAtLte(String lte) { } /** - * ID of an [creditor](#core-endpoints-creditors). If specified, this endpoint will return - * all events for the given creditor. + * ID of an creditor. + * If specified, this endpoint will return all events for the given creditor. */ public EventListRequest withCreditor(String creditor) { this.creditor = creditor; @@ -171,21 +198,22 @@ public EventListRequest withExport(String export) { } /** - * Includes linked resources in the response. Must be used with the `resource_type` - * parameter specified. The include should be one of: + * Includes linked resources in the response. Must be used with the + * resource_type parameter specified. The include should be one of: + * *
    - *
  • `billing_request`
  • - *
  • `creditor`
  • - *
  • `instalment_schedule`
  • - *
  • `mandate`
  • - *
  • `payer_authorisation`
  • - *
  • `payment`
  • - *
  • `payout`
  • - *
  • `refund`
  • - *
  • `scheme_identifier`
  • - *
  • `subscription`
  • - *
  • `outbound_payment`
  • - *
  • `payment_account_transaction`
  • + *
  • billing_request
  • + *
  • creditor
  • + *
  • instalment_schedule
  • + *
  • mandate
  • + *
  • payer_authorisation
  • + *
  • payment
  • + *
  • payout
  • + *
  • refund
  • + *
  • scheme_identifier
  • + *
  • subscription
  • + *
  • outbound_payment
  • + *
  • payment_account_transaction
  • *
*/ public EventListRequest withInclude(Include include) { @@ -194,8 +222,10 @@ public EventListRequest withInclude(Include include) { } /** - * ID of an [instalment schedule](#core-endpoints-instalment-schedules). If specified, this - * endpoint will return all events for the given instalment schedule. + * ID of an instalment + * schedule. If specified, this endpoint will return all events for the given instalment + * schedule. */ public EventListRequest withInstalmentSchedule(String instalmentSchedule) { this.instalmentSchedule = instalmentSchedule; @@ -211,8 +241,9 @@ public EventListRequest withLimit(Integer limit) { } /** - * ID of a [mandate](#core-endpoints-mandates). If specified, this endpoint will return all - * events for the given mandate. + * ID of a mandate. If + * specified, this endpoint will return all events for the given mandate. */ public EventListRequest withMandate(String mandate) { this.mandate = mandate; @@ -220,8 +251,9 @@ public EventListRequest withMandate(String mandate) { } /** - * ID of an [outbound_payment](#core-endpoints-outbound-payments). If specified, this - * endpoint will return all events for the given payment. + * ID of an outbound_payment. + * If specified, this endpoint will return all events for the given payment. */ public EventListRequest withOutboundPayment(String outboundPayment) { this.outboundPayment = outboundPayment; @@ -238,7 +270,9 @@ public EventListRequest withParentEvent(String parentEvent) { } /** - * ID of a [payer authorisation](#core-endpoints-payer-authorisations). + * ID of a payer + * authorisation. */ public EventListRequest withPayerAuthorisation(String payerAuthorisation) { this.payerAuthorisation = payerAuthorisation; @@ -246,8 +280,9 @@ public EventListRequest withPayerAuthorisation(String payerAuthorisation) { } /** - * ID of a [payment](#core-endpoints-payments). If specified, this endpoint will return all - * events for the given payment. + * ID of a payment. If + * specified, this endpoint will return all events for the given payment. */ public EventListRequest withPayment(String payment) { this.payment = payment; @@ -264,8 +299,9 @@ public EventListRequest withPaymentAccountTransaction(String paymentAccountTr } /** - * ID of a [payout](#core-endpoints-payouts). If specified, this endpoint will return all - * events for the given payout. + * ID of a payout. If + * specified, this endpoint will return all events for the given payout. */ public EventListRequest withPayout(String payout) { this.payout = payout; @@ -273,8 +309,9 @@ public EventListRequest withPayout(String payout) { } /** - * ID of a [refund](#core-endpoints-refunds). If specified, this endpoint will return all - * events for the given refund. + * ID of a refund. If + * specified, this endpoint will return all events for the given refund. */ public EventListRequest withRefund(String refund) { this.refund = refund; @@ -283,24 +320,27 @@ public EventListRequest withRefund(String refund) { /** * Type of resource that you'd like to get all events for. Cannot be used together with the - * `billing_request`, `creditor`, `export`,`instalment_schedule`, `mandate`, - * `payer_authorisation`, `payment`, `payout`, `refund`, `scheme_identifier`, - * `subscription`, `outbound_payment` or `payment_account_transaction` parameters. The type - * can be one of: + * billing_request, creditor, + * export,instalment_schedule, mandate, + * payer_authorisation, payment, payout, + * refund, scheme_identifier, subscription, + * outbound_payment or payment_account_transaction parameters. The + * type can be one of: + * *
    - *
  • `billing_requests`
  • - *
  • `creditors`
  • - *
  • `exports`
  • - *
  • `instalment_schedules`
  • - *
  • `mandates`
  • - *
  • `payer_authorisations`
  • - *
  • `payments`
  • - *
  • `payouts`
  • - *
  • `refunds`
  • - *
  • `scheme_identifiers`
  • - *
  • `subscriptions`
  • - *
  • `outbound_payments`
  • - *
  • `payment_account_transactions`
  • + *
  • billing_requests
  • + *
  • creditors
  • + *
  • exports
  • + *
  • instalment_schedules
  • + *
  • mandates
  • + *
  • payer_authorisations
  • + *
  • payments
  • + *
  • payouts
  • + *
  • refunds
  • + *
  • scheme_identifiers
  • + *
  • subscriptions
  • + *
  • outbound_payments
  • + *
  • payment_account_transactions
  • *
*/ public EventListRequest withResourceType(ResourceType resourceType) { @@ -309,8 +349,10 @@ public EventListRequest withResourceType(ResourceType resourceType) { } /** - * ID of a [scheme identifier](#core-endpoints-scheme-identifiers). If specified, this - * endpoint will return all events for the given scheme identifier. + * ID of a scheme + * identifier. If specified, this endpoint will return all events for the given scheme + * identifier. */ public EventListRequest withSchemeIdentifier(String schemeIdentifier) { this.schemeIdentifier = schemeIdentifier; @@ -318,8 +360,9 @@ public EventListRequest withSchemeIdentifier(String schemeIdentifier) { } /** - * ID of a [subscription](#core-endpoints-subscriptions). If specified, this endpoint will - * return all events for the given subscription. + * ID of a subscription. + * If specified, this endpoint will return all events for the given subscription. */ public EventListRequest withSubscription(String subscription) { this.subscription = subscription; diff --git a/src/main/java/com/gocardless/services/InstalmentScheduleService.java b/src/main/java/com/gocardless/services/InstalmentScheduleService.java index 7139fb23..460c7e7c 100644 --- a/src/main/java/com/gocardless/services/InstalmentScheduleService.java +++ b/src/main/java/com/gocardless/services/InstalmentScheduleService.java @@ -15,16 +15,15 @@ * 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. + * 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 final HttpClient httpClient; @@ -41,14 +40,18 @@ public InstalmentScheduleService(HttpClient httpClient) { /** * Creates a new instalment schedule object, along with the associated payments. This API is * recommended if you know the specific dates you wish to charge. Otherwise, please check out - * the [scheduling version](#instalment-schedules-create-with-schedule). + * the scheduling + * version. * - * The `instalments` property is an array of payment properties (`amount` and `charge_date`). + * The instalments property is an array of payment properties (amount + * and charge_date). * * 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. + * 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 InstalmentScheduleCreateWithDatesRequest createWithDates() { return new InstalmentScheduleCreateWithDatesRequest(httpClient); @@ -57,20 +60,24 @@ public InstalmentScheduleCreateWithDatesRequest createWithDates() { /** * Creates a new instalment schedule object, along with the associated payments. This API is * recommended if you wish to use the GoCardless scheduling logic. For finer control over the - * individual dates, please check out the [alternative - * version](#instalment-schedules-create-with-dates). + * individual dates, please check out the alternative + * version. * * 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. + * 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 InstalmentScheduleCreateWithScheduleRequest createWithSchedule() { return new InstalmentScheduleCreateWithScheduleRequest(httpClient); } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your instalment schedules. + * Returns a cursor-paginated + * list of your instalment schedules. */ public InstalmentScheduleListRequest> list() { return new InstalmentScheduleListRequest<>(httpClient, @@ -99,8 +106,8 @@ public InstalmentScheduleUpdateRequest update(String identity) { /** * 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. + * This will fail with a cancellation_failed error if the instalment schedule is + * already cancelled or has completed. */ public InstalmentScheduleCancelRequest cancel(String identity) { return new InstalmentScheduleCancelRequest(httpClient, identity); @@ -111,14 +118,18 @@ public InstalmentScheduleCancelRequest cancel(String identity) { * * Creates a new instalment schedule object, along with the associated payments. This API is * recommended if you know the specific dates you wish to charge. Otherwise, please check out - * the [scheduling version](#instalment-schedules-create-with-schedule). + * the scheduling + * version. * - * The `instalments` property is an array of payment properties (`amount` and `charge_date`). + * The instalments property is an array of payment properties (amount + * and charge_date). * * 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. + * 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 static final class InstalmentScheduleCreateWithDatesRequest extends IdempotentPostRequest { @@ -143,8 +154,8 @@ public InstalmentScheduleCreateWithDatesRequest withAppFee(Integer appFee) { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public InstalmentScheduleCreateWithDatesRequest withCurrency(Currency currency) { this.currency = currency; @@ -152,8 +163,10 @@ public InstalmentScheduleCreateWithDatesRequest withCurrency(Currency currency) } /** - * An explicit array of instalment payments, each specifying at least an `amount` and - * `charge_date`. See [create (with dates)](#instalment-schedules-create-with-dates) + * An explicit array of instalment payments, each specifying at least an amount + * and charge_date. See create + * (with dates) */ public InstalmentScheduleCreateWithDatesRequest withInstalments( List instalments) { @@ -162,8 +175,10 @@ public InstalmentScheduleCreateWithDatesRequest withInstalments( } /** - * An explicit array of instalment payments, each specifying at least an `amount` and - * `charge_date`. See [create (with dates)](#instalment-schedules-create-with-dates) + * An explicit array of instalment payments, each specifying at least an amount + * and charge_date. See create + * (with dates) */ public InstalmentScheduleCreateWithDatesRequest withInstalments(Instalments instalments) { if (this.instalments == null) { @@ -179,8 +194,9 @@ public InstalmentScheduleCreateWithDatesRequest withLinks(Links links) { } /** - * ID of the associated [mandate](#core-endpoints-mandates) which the instalment schedule - * will create payments against. + * ID of the associated mandate + * which the instalment schedule will create payments against. */ public InstalmentScheduleCreateWithDatesRequest withLinksMandate(String mandate) { if (links == null) { @@ -222,25 +238,76 @@ public InstalmentScheduleCreateWithDatesRequest withName(String name) { /** * 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
- * Faster Payments - 18 characters
- * PAD - scheme doesn't offer references
- * PayTo - 18 characters
- * SEPA - 140 characters
+ * 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
  • + *
+ *
+ *
+ * Faster Payments + *
    + *
  • 18 characters
  • + *
+ *
+ *
+ * PAD + *
    + *
  • scheme doesn't offer references
  • + *
+ *
+ *
+ * PayTo + *
    + *
  • 18 characters
  • + *
+ *
+ *
+ * SEPA + *
    + *
  • 140 characters
  • + *
+ *
+ *
* Note that this reference must be unique (for each merchant) for the BECS scheme as it is * a scheme requirement. - *

+ *

* 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. + * GoCardless Plus, Pro or Enterprise packages. *

- *

+ *

* Restricted: You can not specify a payment reference for Faster Payments. *

*/ @@ -251,11 +318,12 @@ public InstalmentScheduleCreateWithDatesRequest withPaymentReference( } /** - * On failure, automatically retry payments using [intelligent - * retries](/success-plus/overview). Default is `false`. + * On failure, automatically retry payments using + * intelligent retries. + * Default is false. *

* Important: To be able to use intelligent retries, Success+ needs to be - * enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus). + * enabled in GoCardless dashboard. *

*/ public InstalmentScheduleCreateWithDatesRequest withRetryIfPossible( @@ -345,6 +413,14 @@ public static class Instalments { /** * Amount, in the lowest denomination for the currency (e.g. pence in GBP, cents in * EUR). + * + * Minimum and maximum amounts vary by payment scheme. For more information, see + * Transaction + * limits + * + * For Variable Recurring Payments (VRP), this must not exceed the mandate's + * max_amount_per_payment constraint. */ public Instalments withAmount(Integer amount) { this.amount = amount; @@ -353,8 +429,9 @@ public Instalments withAmount(Integer amount) { /** * A future date on which the payment should be collected. If the date is before the - * next_possible_charge_date on the [mandate](#core-endpoints-mandates), it will be - * automatically rolled forwards to that date. + * next_possible_charge_date on the mandate, + * it will be automatically rolled forwards to that date. */ public Instalments withChargeDate(String chargeDate) { this.chargeDate = chargeDate; @@ -364,8 +441,9 @@ public Instalments withChargeDate(String chargeDate) { /** * A human-readable description of the payment. This will be included in the * notification email GoCardless sends to your customer if your organisation does not - * send its own notifications (see [compliance - * requirements](#appendix-compliance-requirements)). + * send its own notifications (see compliance + * requirements). */ public Instalments withDescription(String description) { this.description = description; @@ -377,8 +455,9 @@ public static class Links { private String mandate; /** - * ID of the associated [mandate](#core-endpoints-mandates) which the instalment - * schedule will create payments against. + * ID of the associated mandate + * which the instalment schedule will create payments against. */ public Links withMandate(String mandate) { this.mandate = mandate; @@ -392,13 +471,15 @@ public Links withMandate(String mandate) { * * Creates a new instalment schedule object, along with the associated payments. This API is * recommended if you wish to use the GoCardless scheduling logic. For finer control over the - * individual dates, please check out the [alternative - * version](#instalment-schedules-create-with-dates). + * individual dates, please check out the alternative + * version. * * 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. + * 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 static final class InstalmentScheduleCreateWithScheduleRequest extends IdempotentPostRequest { @@ -423,8 +504,8 @@ public InstalmentScheduleCreateWithScheduleRequest withAppFee(Integer appFee) { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public InstalmentScheduleCreateWithScheduleRequest withCurrency(Currency currency) { this.currency = currency; @@ -433,9 +514,9 @@ public InstalmentScheduleCreateWithScheduleRequest withCurrency(Currency currenc /** * Frequency of the payments you want to create, together with an array of payment amounts - * to be collected, with a specified start date for the first payment. See [create (with - * schedule)](#instalment-schedules-create-with-schedule) - * + * to be collected, with a specified start date for the first payment. See create + * (with schedule) */ public InstalmentScheduleCreateWithScheduleRequest withInstalments( Instalments instalments) { @@ -446,7 +527,6 @@ public InstalmentScheduleCreateWithScheduleRequest withInstalments( /** * List of amounts of each instalment, in the lowest denomination for the currency (e.g. * pence in GBP, cents in EUR). - * */ public InstalmentScheduleCreateWithScheduleRequest withInstalmentsAmounts( List amounts) { @@ -458,8 +538,8 @@ public InstalmentScheduleCreateWithScheduleRequest withInstalmentsAmounts( } /** - * Number of `interval_units` between charge dates. Must be greater than or equal to `1`. - * + * Number of interval_units between charge dates. Must be greater than or equal + * to 1. */ public InstalmentScheduleCreateWithScheduleRequest withInstalmentsInterval( Integer interval) { @@ -471,7 +551,8 @@ public InstalmentScheduleCreateWithScheduleRequest withInstalmentsInterval( } /** - * The unit of time between customer charge dates. One of `weekly`, `monthly` or `yearly`. + * The unit of time between customer charge dates. One of weekly, + * monthly or yearly. */ public InstalmentScheduleCreateWithScheduleRequest withInstalmentsIntervalUnit( Instalments.IntervalUnit intervalUnit) { @@ -483,11 +564,12 @@ public InstalmentScheduleCreateWithScheduleRequest withInstalmentsIntervalUnit( } /** - * The date on which the first payment should be charged. Must be on or after the - * [mandate](#core-endpoints-mandates)'s `next_possible_charge_date`. When left blank and - * `month` or `day_of_month` are provided, this will be set to the date of the first - * payment. If created without `month` or `day_of_month` this will be set as the mandate's - * `next_possible_charge_date` + * The date on which the first payment should be charged. Must be on or after the mandate's + * next_possible_charge_date. When left blank and month or + * day_of_month are provided, this will be set to the date of the first + * payment. If created without month or day_of_month this will be + * set as the mandate's next_possible_charge_date */ public InstalmentScheduleCreateWithScheduleRequest withInstalmentsStartDate( String startDate) { @@ -504,8 +586,9 @@ public InstalmentScheduleCreateWithScheduleRequest withLinks(Links links) { } /** - * ID of the associated [mandate](#core-endpoints-mandates) which the instalment schedule - * will create payments against. + * ID of the associated mandate + * which the instalment schedule will create payments against. */ public InstalmentScheduleCreateWithScheduleRequest withLinksMandate(String mandate) { if (links == null) { @@ -548,25 +631,76 @@ public InstalmentScheduleCreateWithScheduleRequest withName(String name) { /** * 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
- * Faster Payments - 18 characters
- * PAD - scheme doesn't offer references
- * PayTo - 18 characters
- * SEPA - 140 characters
+ * 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
  • + *
+ *
+ *
+ * Faster Payments + *
    + *
  • 18 characters
  • + *
+ *
+ *
+ * PAD + *
    + *
  • scheme doesn't offer references
  • + *
+ *
+ *
+ * PayTo + *
    + *
  • 18 characters
  • + *
+ *
+ *
+ * SEPA + *
    + *
  • 140 characters
  • + *
+ *
+ *
* Note that this reference must be unique (for each merchant) for the BECS scheme as it is * a scheme requirement. - *

+ *

* 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. + * GoCardless Plus, Pro or Enterprise packages. *

- *

+ *

* Restricted: You can not specify a payment reference for Faster Payments. *

*/ @@ -577,11 +711,12 @@ public InstalmentScheduleCreateWithScheduleRequest withPaymentReference( } /** - * On failure, automatically retry payments using [intelligent - * retries](/success-plus/overview). Default is `false`. + * On failure, automatically retry payments using + * intelligent retries. + * Default is false. *

* Important: To be able to use intelligent retries, Success+ needs to be - * enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus). + * enabled in GoCardless dashboard. *

*/ public InstalmentScheduleCreateWithScheduleRequest withRetryIfPossible( @@ -673,7 +808,6 @@ public static class Instalments { /** * List of amounts of each instalment, in the lowest denomination for the currency (e.g. * pence in GBP, cents in EUR). - * */ public Instalments withAmounts(List amounts) { this.amounts = amounts; @@ -681,9 +815,8 @@ public Instalments withAmounts(List amounts) { } /** - * Number of `interval_units` between charge dates. Must be greater than or equal to - * `1`. - * + * Number of interval_units between charge dates. Must be greater than or + * equal to 1. */ public Instalments withInterval(Integer interval) { this.interval = interval; @@ -691,8 +824,8 @@ public Instalments withInterval(Integer interval) { } /** - * The unit of time between customer charge dates. One of `weekly`, `monthly` or - * `yearly`. + * The unit of time between customer charge dates. One of weekly, + * monthly or yearly. */ public Instalments withIntervalUnit(IntervalUnit intervalUnit) { this.intervalUnit = intervalUnit; @@ -701,10 +834,12 @@ public Instalments withIntervalUnit(IntervalUnit intervalUnit) { /** * The date on which the first payment should be charged. Must be on or after the - * [mandate](#core-endpoints-mandates)'s `next_possible_charge_date`. When left blank - * and `month` or `day_of_month` are provided, this will be set to the date of the first - * payment. If created without `month` or `day_of_month` this will be set as the - * mandate's `next_possible_charge_date` + * mandate's + * next_possible_charge_date. When left blank and month or + * day_of_month are provided, this will be set to the date of the first + * payment. If created without month or day_of_month this will + * be set as the mandate's next_possible_charge_date */ public Instalments withStartDate(String startDate) { this.startDate = startDate; @@ -729,8 +864,9 @@ public static class Links { private String mandate; /** - * ID of the associated [mandate](#core-endpoints-mandates) which the instalment - * schedule will create payments against. + * ID of the associated mandate + * which the instalment schedule will create payments against. */ public Links withMandate(String mandate) { this.mandate = mandate; @@ -742,7 +878,9 @@ public Links withMandate(String mandate) { /** * Request class for {@link InstalmentScheduleService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your instalment schedules. + * Returns a cursor-paginated + * list of your instalment schedules. */ public static final class InstalmentScheduleListRequest extends ListRequest { @@ -817,7 +955,8 @@ public InstalmentScheduleListRequest withCreatedAtLte(String lte) { } /** - * ID of the associated [customer](#core-endpoints-customers). + * ID of the associated customer. */ public InstalmentScheduleListRequest withCustomer(String customer) { this.customer = customer; @@ -833,8 +972,9 @@ public InstalmentScheduleListRequest withLimit(Integer limit) { } /** - * ID of the associated [mandate](#core-endpoints-mandates) which the instalment schedule - * will create payments against. + * ID of the associated mandate + * which the instalment schedule will create payments against. */ public InstalmentScheduleListRequest withMandate(String mandate) { this.mandate = mandate; @@ -1094,8 +1234,8 @@ protected boolean hasBody() { * * 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. + * This will fail with a cancellation_failed error if the instalment schedule is + * already cancelled or has completed. */ public static final class InstalmentScheduleCancelRequest extends PostRequest { diff --git a/src/main/java/com/gocardless/services/InstitutionService.java b/src/main/java/com/gocardless/services/InstitutionService.java index 037d301c..a69dcbfe 100644 --- a/src/main/java/com/gocardless/services/InstitutionService.java +++ b/src/main/java/com/gocardless/services/InstitutionService.java @@ -12,8 +12,9 @@ /** * Service class for working with institution resources. * - * Institutions that are supported when creating [Bank - * Authorisations](#billing-requests-bank-authorisations) for a particular country or purpose. + * Institutions that are supported when creating Bank + * Authorisations for a particular country or purpose. * * Not all institutions support both Payment Initiation (PIS) and Account Information (AIS) * services. @@ -73,10 +74,10 @@ public InstitutionListRequest withBranchCode(String branchCode) { } /** - * [ISO - * 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) - * alpha-2 code. The country code of the institution. If nothing is provided, institutions - * with the country code 'GB' are returned by default. + * ISO + * 3166-1 alpha-2 code. The country code of the institution. If nothing is provided, + * institutions with the country code 'GB' are returned by default. */ public InstitutionListRequest withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -84,9 +85,9 @@ public InstitutionListRequest withCountryCode(String countryCode) { } /** - * The feature that institutions support. The available options include `pis`, and - * `vrp_sweeping`. If nothing is provided, institutions supporting 'pis' are returned by - * default. + * The feature that institutions support. The available options include pis, + * and vrp_sweeping. If nothing is provided, institutions supporting 'pis' are + * returned by default. */ public InstitutionListRequest withFeature(String feature) { this.feature = feature; @@ -94,9 +95,10 @@ public InstitutionListRequest withFeature(String feature) { } /** - * The scheme that institutions support. The available options include `faster_payments`, - * `sepa_credit_transfer`, and `sepa_instant_credit_transfer`. If nothing is provided, - * institutions supporting 'faster_payments' are returned by default. + * The scheme that institutions support. The available options include + * faster_payments, sepa_credit_transfer, and + * sepa_instant_credit_transfer. If nothing is provided, institutions + * supporting 'faster_payments' are returned by default. */ public InstitutionListRequest withScheme(String scheme) { this.scheme = scheme; @@ -165,10 +167,10 @@ public static final class InstitutionListForBillingRequestRequest private String search; /** - * [ISO - * 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) - * alpha-2 code. The country code of the institution. If nothing is provided, institutions - * with the country code 'GB' are returned by default. + * ISO + * 3166-1 alpha-2 code. The country code of the institution. If nothing is provided, + * institutions with the country code 'GB' are returned by default. */ public InstitutionListForBillingRequestRequest withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -199,7 +201,6 @@ public InstitutionListForBillingRequestRequest withIds(String ids) { /** * Indicates whether to include temporarily disabled institutions in the response. If not * provided or set to false, only enabled institutions will be returned. - * */ public InstitutionListForBillingRequestRequest withIncludeDisabled( Boolean includeDisabled) { diff --git a/src/main/java/com/gocardless/services/LogoService.java b/src/main/java/com/gocardless/services/LogoService.java index 0f9ba10a..602197ef 100644 --- a/src/main/java/com/gocardless/services/LogoService.java +++ b/src/main/java/com/gocardless/services/LogoService.java @@ -6,8 +6,9 @@ /** * Service class for working with logo resources. * - * Logos are image uploads that, when associated with a creditor, are shown on the [billing request - * flow](#billing-requests-billing-request-flows) payment pages. + * Logos are image uploads that, when associated with a creditor, are shown on the billing + * request flow payment pages. */ public class LogoService { private final HttpClient httpClient; @@ -26,8 +27,8 @@ public LogoService(HttpClient httpClient) { * * We support JPG and PNG formats. Your logo will be scaled to a maximum of 300px by 40px. For * more guidance on how to upload logos that will look great across your customer payment page - * and notification emails see - * [here](https://developer.gocardless.com/gc-embed/setting-up-branding#tips_for_uploading_your_logo). + * and notification emails see here. */ public LogoCreateForCreditorRequest createForCreditor() { return new LogoCreateForCreditorRequest(httpClient); @@ -41,8 +42,8 @@ public LogoCreateForCreditorRequest createForCreditor() { * * We support JPG and PNG formats. Your logo will be scaled to a maximum of 300px by 40px. For * more guidance on how to upload logos that will look great across your customer payment page - * and notification emails see - * [here](https://developer.gocardless.com/gc-embed/setting-up-branding#tips_for_uploading_your_logo). + * and notification emails see here. */ public static final class LogoCreateForCreditorRequest extends PostRequest { private String image; diff --git a/src/main/java/com/gocardless/services/MandateImportEntryService.java b/src/main/java/com/gocardless/services/MandateImportEntryService.java index 5b4b5c6b..67d76992 100644 --- a/src/main/java/com/gocardless/services/MandateImportEntryService.java +++ b/src/main/java/com/gocardless/services/MandateImportEntryService.java @@ -11,23 +11,26 @@ /** * Service class for working with mandate import entry resources. * - * Mandate Import Entries are added to a [Mandate Import](#core-endpoints-mandate-imports). Each - * entry corresponds to one mandate to be imported into GoCardless. + * Mandate Import Entries are added to a + * Mandate + * Import. Each entry corresponds to one mandate to be imported into GoCardless. * * To import a mandate you will need: + * *
    *
  1. Identifying information about the customer (name/company and address)
  2. *
  3. Bank account details, consisting of an account holder name and either an IBAN or - * local bank details
  4. + * local bank + * details *
  5. Amendment details (SEPA only)
  6. *
- * - * We suggest you provide a `record_identifier` (which is unique within the context of a single - * mandate import) to help you to identify mandates that have been created once the import has been - * processed by GoCardless. You can [list the mandate import - * entries](#mandate-import-entries-list-all-mandate-import-entries), match them up in your system - * using the `record_identifier`, and look at the `links` fields to find the mandate, customer and - * customer bank account that have been imported. + * We suggest you provide a record_identifier (which is unique within the context of a + * single mandate import) to help you to identify mandates that have been created once the import + * has been processed by GoCardless. You can list + * the mandate import entries, match them up in your system using the + * record_identifier, and look at the links fields to find the mandate, + * customer and customer bank account that have been imported. * *

* Restricted: This API is currently only available for approved integrators - @@ -47,11 +50,13 @@ public MandateImportEntryService(HttpClient httpClient) { } /** - * For an existing [mandate import](#core-endpoints-mandate-imports), this endpoint can be used - * to add individual mandates to be imported into GoCardless. + * For an existing mandate + * import, this endpoint can be used to add individual mandates to be imported into + * GoCardless. * * You can add no more than 30,000 rows to a single mandate import. If you attempt to go over - * this limit, the API will return a `record_limit_exceeded` error. + * this limit, the API will return a record_limit_exceeded error. */ public MandateImportEntryCreateRequest create() { return new MandateImportEntryCreateRequest(httpClient); @@ -61,9 +66,8 @@ public MandateImportEntryCreateRequest create() { * For an existing mandate import, this endpoint lists all of the entries attached. * * After a mandate import has been submitted, you can use this endpoint to associate records in - * your system (using the `record_identifier` that you provided when creating the mandate - * import). - * + * your system (using the record_identifier that you provided when creating the + * mandate import). */ public MandateImportEntryListRequest> list() { return new MandateImportEntryListRequest<>(httpClient, @@ -78,11 +82,13 @@ public MandateImportEntryListRequest> all() { /** * Request class for {@link MandateImportEntryService#create }. * - * For an existing [mandate import](#core-endpoints-mandate-imports), this endpoint can be used - * to add individual mandates to be imported into GoCardless. + * For an existing mandate + * import, this endpoint can be used to add individual mandates to be imported into + * GoCardless. * * You can add no more than 30,000 rows to a single mandate import. If you attempt to go over - * this limit, the API will return a `record_limit_exceeded` error. + * this limit, the API will return a record_limit_exceeded error. */ public static final class MandateImportEntryCreateRequest extends PostRequest { @@ -100,8 +106,7 @@ public MandateImportEntryCreateRequest withAmendment(Amendment amendment) { /** * The creditor identifier of the direct debit originator. Required if mandate import scheme - * is `sepa`. - * + * is sepa. */ public MandateImportEntryCreateRequest withAmendmentOriginalCreditorId( String originalCreditorId) { @@ -114,7 +119,6 @@ public MandateImportEntryCreateRequest withAmendmentOriginalCreditorId( /** * Data about the original mandate to be moved or modified. - * */ public MandateImportEntryCreateRequest withAmendmentOriginalCreditorName( String originalCreditorName) { @@ -127,8 +131,7 @@ public MandateImportEntryCreateRequest withAmendmentOriginalCreditorName( /** * The unique SEPA reference for the mandate being amended. Required if mandate import - * scheme is `sepa`. - * + * scheme is sepa. */ public MandateImportEntryCreateRequest withAmendmentOriginalMandateReference( String originalMandateReference) { @@ -148,8 +151,9 @@ public MandateImportEntryCreateRequest withBankAccount(BankAccount bankAccount) * Name of the account holder, as known by the bank. The full name provided when the * customer is created is stored and is available via the API, but is transliterated, * upcased, and truncated to 18 characters in bank submissions. This field is required - * unless the request includes a [customer bank account - * token](#javascript-flow-customer-bank-account-tokens). + * unless the request includes a customer + * bank account token. */ public MandateImportEntryCreateRequest withBankAccountAccountHolderName( String accountHolderName) { @@ -161,8 +165,9 @@ public MandateImportEntryCreateRequest withBankAccountAccountHolderName( } /** - * Bank account number - see [local details](#appendix-local-bank-details) for more - * information. Alternatively you can provide an `iban`. + * Bank account number - see local + * details for more information. Alternatively you can provide an iban. */ public MandateImportEntryCreateRequest withBankAccountAccountNumber(String accountNumber) { if (bankAccount == null) { @@ -174,8 +179,9 @@ public MandateImportEntryCreateRequest withBankAccountAccountNumber(String accou /** * 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. + * bank accounts in other currencies. See local + * details for more information. */ public MandateImportEntryCreateRequest withBankAccountAccountType( BankAccount.AccountType accountType) { @@ -187,8 +193,9 @@ public MandateImportEntryCreateRequest withBankAccountAccountType( } /** - * Bank code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Bank code - see local + * details for more information. Alternatively you can provide an iban. */ public MandateImportEntryCreateRequest withBankAccountBankCode(String bankCode) { if (bankAccount == null) { @@ -199,8 +206,9 @@ public MandateImportEntryCreateRequest withBankAccountBankCode(String bankCode) } /** - * Branch code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Branch code - see local + * details for more information. Alternatively you can provide an iban. */ public MandateImportEntryCreateRequest withBankAccountBranchCode(String branchCode) { if (bankAccount == null) { @@ -211,9 +219,10 @@ public MandateImportEntryCreateRequest withBankAccountBranchCode(String branchCo } /** - * [ISO 3166-1 alpha-2 - * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). - * Defaults to the country code of the `iban` if supplied, otherwise is required. + * ISO + * 3166-1 alpha-2 code. Defaults to the country code of the iban if + * supplied, otherwise is required. */ public MandateImportEntryCreateRequest withBankAccountCountryCode(String countryCode) { if (bankAccount == null) { @@ -224,9 +233,12 @@ public MandateImportEntryCreateRequest withBankAccountCountryCode(String country } /** - * International Bank Account Number. Alternatively you can provide [local - * details](#appendix-local-bank-details). IBANs are not accepted for Swedish bank accounts - * denominated in SEK - you must supply [local details](#local-bank-details-sweden). + * International Bank Account Number. Alternatively you can provide local + * details. IBANs are not accepted for Swedish bank accounts denominated in SEK - you + * must supply + * local + * details. */ public MandateImportEntryCreateRequest withBankAccountIban(String iban) { if (bankAccount == null) { @@ -256,8 +268,7 @@ public MandateImportEntryCreateRequest withCustomer(Customer customer) { /** * The first line of the customer's address. Required if mandate import scheme is either - * `bacs` or `sepa`. - * + * bacs or sepa. */ public MandateImportEntryCreateRequest withCustomerAddressLine1(String addressLine1) { if (customer == null) { @@ -301,10 +312,11 @@ public MandateImportEntryCreateRequest withCustomerCity(String city) { } /** - * Customer's company name. Required unless a `given_name` and `family_name` are provided. - * For Canadian customers, the use of a `company_name` value will mean that any mandate - * created from this customer will be considered to be a "Business PAD" (otherwise, any - * mandate will be considered to be a "Personal PAD"). + * Customer's company name. Required unless a given_name and + * family_name are provided. For Canadian customers, the use of a + * company_name value will mean that any mandate created from this customer + * will be considered to be a "Business PAD" (otherwise, any mandate will be considered to + * be a "Personal PAD"). */ public MandateImportEntryCreateRequest withCustomerCompanyName(String companyName) { if (customer == null) { @@ -315,8 +327,9 @@ public MandateImportEntryCreateRequest withCustomerCompanyName(String companyNam } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public MandateImportEntryCreateRequest withCustomerCountryCode(String countryCode) { if (customer == null) { @@ -352,7 +365,7 @@ public MandateImportEntryCreateRequest withCustomerEmail(String email) { } /** - * Customer's surname. Required unless a `company_name` is provided. + * Customer's surname. Required unless a company_name is provided. */ public MandateImportEntryCreateRequest withCustomerFamilyName(String familyName) { if (customer == null) { @@ -363,7 +376,7 @@ public MandateImportEntryCreateRequest withCustomerFamilyName(String familyName) } /** - * Customer's first name. Required unless a `company_name` is provided. + * Customer's first name. Required unless a company_name is provided. */ public MandateImportEntryCreateRequest withCustomerGivenName(String givenName) { if (customer == null) { @@ -374,12 +387,13 @@ public MandateImportEntryCreateRequest withCustomerGivenName(String givenName) { } /** - * [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code. Used as the - * language for notification emails sent by GoCardless if your organisation does not send - * its own (see [compliance requirements](#appendix-compliance-requirements)). Currently - * only "en", "fr", "de", "pt", "es", "it", "nl", "da", "nb", "sl", "sv" are supported. If - * this is not provided, the language will be chosen based on the `country_code` (if - * supplied) or default to "en". + * ISO 639-1 code. Used + * as the language for notification emails sent by GoCardless if your organisation does not + * send its own (see compliance + * requirements). Currently only "en", "fr", "de", "pt", "es", "it", "nl", "da", "nb", + * "sl", "sv" are supported. If this is not provided, the language will be chosen based on + * the country_code (if supplied) or default to "en". */ public MandateImportEntryCreateRequest withCustomerLanguage(String language) { if (customer == null) { @@ -402,8 +416,8 @@ public MandateImportEntryCreateRequest withCustomerMetadata(Map } /** - * [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone number, including - * country code. + * ITU E.123 formatted phone number, + * including country code. */ public MandateImportEntryCreateRequest withCustomerPhoneNumber(String phoneNumber) { if (customer == null) { @@ -414,8 +428,8 @@ public MandateImportEntryCreateRequest withCustomerPhoneNumber(String phoneNumbe } /** - * The customer's postal code. Required if mandate import scheme is either `bacs` or `sepa`. - * + * The customer's postal code. Required if mandate import scheme is either bacs + * or sepa. */ public MandateImportEntryCreateRequest withCustomerPostalCode(String postalCode) { if (customer == null) { @@ -427,8 +441,8 @@ public MandateImportEntryCreateRequest withCustomerPostalCode(String postalCode) /** * The customer's address region, county or department. For US customers a 2 letter - * [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state code is required (e.g. - * `CA` for California). + * ISO3166-2:US state code is + * required (e.g. CA for California). */ public MandateImportEntryCreateRequest withCustomerRegion(String region) { if (customer == null) { @@ -474,14 +488,13 @@ public MandateImportEntryCreateRequest withMandate(Mandate mandate) { } /** - * This field is ACH specific, sometimes referred to as [SEC - * code](https://www.moderntreasury.com/learn/sec-codes). + * This field is ACH specific, sometimes referred to as + * SEC code. * * This is the way that the payer gives authorisation to the merchant. web: Authorisation is * Internet Initiated or via Mobile Entry (maps to SEC code: WEB) telephone: Authorisation * is provided orally over telephone (maps to SEC code: TEL) paper: Authorisation is * provided in writing and signed, or similarly authenticated (maps to SEC code: PPD) - * */ public MandateImportEntryCreateRequest withMandateAuthorisationSource( Mandate.AuthorisationSource authorisationSource) { @@ -505,9 +518,10 @@ public MandateImportEntryCreateRequest withMandateMetadata(Map m } /** - * Unique reference. Different schemes have different length and [character - * set](#appendix-character-sets) requirements. GoCardless will generate a unique reference - * satisfying the different scheme requirements if this field is left blank. + * Unique reference. Different schemes have different length and character + * set requirements. GoCardless will generate a unique reference satisfying the + * different scheme requirements if this field is left blank. */ public MandateImportEntryCreateRequest withMandateReference(String reference) { if (mandate == null) { @@ -520,7 +534,6 @@ public MandateImportEntryCreateRequest withMandateReference(String reference) { /** * A unique identifier for this entry, which you can use (once the import has been processed * by GoCardless) to identify the records that have been created. Limited to 255 characters. - * */ public MandateImportEntryCreateRequest withRecordIdentifier(String recordIdentifier) { this.recordIdentifier = recordIdentifier; @@ -563,8 +576,7 @@ public static class Amendment { /** * The creditor identifier of the direct debit originator. Required if mandate import - * scheme is `sepa`. - * + * scheme is sepa. */ public Amendment withOriginalCreditorId(String originalCreditorId) { this.originalCreditorId = originalCreditorId; @@ -573,7 +585,6 @@ public Amendment withOriginalCreditorId(String originalCreditorId) { /** * Data about the original mandate to be moved or modified. - * */ public Amendment withOriginalCreditorName(String originalCreditorName) { this.originalCreditorName = originalCreditorName; @@ -582,8 +593,7 @@ public Amendment withOriginalCreditorName(String originalCreditorName) { /** * The unique SEPA reference for the mandate being amended. Required if mandate import - * scheme is `sepa`. - * + * scheme is sepa. */ public Amendment withOriginalMandateReference(String originalMandateReference) { this.originalMandateReference = originalMandateReference; @@ -605,8 +615,9 @@ public static class BankAccount { * Name of the account holder, as known by the bank. The full name provided when the * customer is created is stored and is available via the API, but is transliterated, * upcased, and truncated to 18 characters in bank submissions. This field is required - * unless the request includes a [customer bank account - * token](#javascript-flow-customer-bank-account-tokens). + * unless the request includes a customer + * bank account token. */ public BankAccount withAccountHolderName(String accountHolderName) { this.accountHolderName = accountHolderName; @@ -614,8 +625,9 @@ public BankAccount withAccountHolderName(String accountHolderName) { } /** - * Bank account number - see [local details](#appendix-local-bank-details) for more - * information. Alternatively you can provide an `iban`. + * Bank account number - see local + * details for more information. Alternatively you can provide an iban. */ public BankAccount withAccountNumber(String accountNumber) { this.accountNumber = accountNumber; @@ -624,8 +636,9 @@ public BankAccount withAccountNumber(String accountNumber) { /** * 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. + * for bank accounts in other currencies. See local + * details for more information. */ public BankAccount withAccountType(AccountType accountType) { this.accountType = accountType; @@ -633,8 +646,9 @@ public BankAccount withAccountType(AccountType accountType) { } /** - * Bank code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Bank code - see local + * details for more information. Alternatively you can provide an iban. */ public BankAccount withBankCode(String bankCode) { this.bankCode = bankCode; @@ -642,8 +656,9 @@ public BankAccount withBankCode(String bankCode) { } /** - * Branch code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Branch code - see local + * details for more information. Alternatively you can provide an iban. */ public BankAccount withBranchCode(String branchCode) { this.branchCode = branchCode; @@ -651,9 +666,10 @@ public BankAccount withBranchCode(String branchCode) { } /** - * [ISO 3166-1 alpha-2 - * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). - * Defaults to the country code of the `iban` if supplied, otherwise is required. + * ISO + * 3166-1 alpha-2 code. Defaults to the country code of the iban if + * supplied, otherwise is required. */ public BankAccount withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -661,10 +677,12 @@ public BankAccount withCountryCode(String countryCode) { } /** - * International Bank Account Number. Alternatively you can provide [local - * details](#appendix-local-bank-details). IBANs are not accepted for Swedish bank - * accounts denominated in SEK - you must supply [local - * details](#local-bank-details-sweden). + * International Bank Account Number. Alternatively you can provide local + * details. IBANs are not accepted for Swedish bank accounts denominated in SEK - + * you must supply local + * details. */ public BankAccount withIban(String iban) { this.iban = iban; @@ -713,8 +731,7 @@ public static class Customer { /** * The first line of the customer's address. Required if mandate import scheme is either - * `bacs` or `sepa`. - * + * bacs or sepa. */ public Customer withAddressLine1(String addressLine1) { this.addressLine1 = addressLine1; @@ -746,10 +763,11 @@ public Customer withCity(String city) { } /** - * Customer's company name. Required unless a `given_name` and `family_name` are - * provided. For Canadian customers, the use of a `company_name` value will mean that - * any mandate created from this customer will be considered to be a "Business PAD" - * (otherwise, any mandate will be considered to be a "Personal PAD"). + * Customer's company name. Required unless a given_name and + * family_name are provided. For Canadian customers, the use of a + * company_name value will mean that any mandate created from this customer + * will be considered to be a "Business PAD" (otherwise, any mandate will be considered + * to be a "Personal PAD"). */ public Customer withCompanyName(String companyName) { this.companyName = companyName; @@ -757,8 +775,9 @@ public Customer withCompanyName(String companyName) { } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public Customer withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -784,7 +803,7 @@ public Customer withEmail(String email) { } /** - * Customer's surname. Required unless a `company_name` is provided. + * Customer's surname. Required unless a company_name is provided. */ public Customer withFamilyName(String familyName) { this.familyName = familyName; @@ -792,7 +811,7 @@ public Customer withFamilyName(String familyName) { } /** - * Customer's first name. Required unless a `company_name` is provided. + * Customer's first name. Required unless a company_name is provided. */ public Customer withGivenName(String givenName) { this.givenName = givenName; @@ -800,12 +819,13 @@ public Customer withGivenName(String givenName) { } /** - * [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code. Used as the - * language for notification emails sent by GoCardless if your organisation does not - * send its own (see [compliance requirements](#appendix-compliance-requirements)). - * Currently only "en", "fr", "de", "pt", "es", "it", "nl", "da", "nb", "sl", "sv" are - * supported. If this is not provided, the language will be chosen based on the - * `country_code` (if supplied) or default to "en". + * ISO 639-1 code. + * Used as the language for notification emails sent by GoCardless if your organisation + * does not send its own (see compliance + * requirements). Currently only "en", "fr", "de", "pt", "es", "it", "nl", "da", + * "nb", "sl", "sv" are supported. If this is not provided, the language will be chosen + * based on the country_code (if supplied) or default to "en". */ public Customer withLanguage(String language) { this.language = language; @@ -822,8 +842,8 @@ public Customer withMetadata(Map metadata) { } /** - * [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone number, including - * country code. + * ITU E.123 formatted phone number, + * including country code. */ public Customer withPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; @@ -831,9 +851,8 @@ public Customer withPhoneNumber(String phoneNumber) { } /** - * The customer's postal code. Required if mandate import scheme is either `bacs` or - * `sepa`. - * + * The customer's postal code. Required if mandate import scheme is either + * bacs or sepa. */ public Customer withPostalCode(String postalCode) { this.postalCode = postalCode; @@ -842,8 +861,8 @@ public Customer withPostalCode(String postalCode) { /** * The customer's address region, county or department. For US customers a 2 letter - * [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state code is required - * (e.g. `CA` for California). + * ISO3166-2:US state code is + * required (e.g. CA for California). */ public Customer withRegion(String region) { this.region = region; @@ -880,15 +899,14 @@ public static class Mandate { private String reference; /** - * This field is ACH specific, sometimes referred to as [SEC - * code](https://www.moderntreasury.com/learn/sec-codes). + * This field is ACH specific, sometimes referred to as + * SEC code. * * This is the way that the payer gives authorisation to the merchant. web: * Authorisation is Internet Initiated or via Mobile Entry (maps to SEC code: WEB) * telephone: Authorisation is provided orally over telephone (maps to SEC code: TEL) * paper: Authorisation is provided in writing and signed, or similarly authenticated * (maps to SEC code: PPD) - * */ public Mandate withAuthorisationSource(AuthorisationSource authorisationSource) { this.authorisationSource = authorisationSource; @@ -905,9 +923,10 @@ public Mandate withMetadata(Map metadata) { } /** - * Unique reference. Different schemes have different length and [character - * set](#appendix-character-sets) requirements. GoCardless will generate a unique - * reference satisfying the different scheme requirements if this field is left blank. + * Unique reference. Different schemes have different length and character + * set requirements. GoCardless will generate a unique reference satisfying the + * different scheme requirements if this field is left blank. */ public Mandate withReference(String reference) { this.reference = reference; @@ -935,9 +954,8 @@ public String toString() { * For an existing mandate import, this endpoint lists all of the entries attached. * * After a mandate import has been submitted, you can use this endpoint to associate records in - * your system (using the `record_identifier` that you provided when creating the mandate - * import). - * + * your system (using the record_identifier that you provided when creating the + * mandate import). */ public static final class MandateImportEntryListRequest extends ListRequest { @@ -978,11 +996,12 @@ public MandateImportEntryListRequest withMandateImport(String mandateImport) /** * One of: + * *

    - *
  • `sucessfully_processed`: the entry has been imported and the associated records - * created.
  • - *
  • `unsuccessfully_processed`: the entry could not be processed due to an error, see the - * 'processing_errors' value
  • + *
  • sucessfully_processed: the entry has been imported and the associated + * records created.
  • + *
  • unsuccessfully_processed: the entry could not be processed due to an + * error, see the 'processing_errors' value
  • *
*/ public MandateImportEntryListRequest withStatus(Status status) { diff --git a/src/main/java/com/gocardless/services/MandateImportService.java b/src/main/java/com/gocardless/services/MandateImportService.java index 1e3abb82..a2c43acb 100644 --- a/src/main/java/com/gocardless/services/MandateImportService.java +++ b/src/main/java/com/gocardless/services/MandateImportService.java @@ -14,27 +14,40 @@ * * The process is as follows: * - * 1. [Create a mandate import](#mandate-imports-create-a-new-mandate-import) 2. [Add - * entries](#mandate-import-entries-add-a-mandate-import-entry) to the import 3. - * [Submit](#mandate-imports-submit-a-mandate-import) the import 4. Wait until a member of the - * GoCardless team approves the import, at which point the mandates will be created 5. [Link up the - * mandates](#mandate-import-entries-list-all-mandate-import-entries) in your system - * + *
    + *
  1. Create + * a mandate import
  2. + *
  3. Add + * entries to the import
  4. + *
  5. Submit + * the import
  6. + *
  7. Wait until a member of the GoCardless team approves the import, at which point the mandates + * will be created
  8. + *
  9. Link + * up the mandates in your system
  10. + *
* When you add entries to your mandate import, they are not turned into actual mandates until the * mandate import is submitted by you via the API, and then processed by a member of the GoCardless * team. When that happens, a mandate will be created for each entry in the import. * - * We will issue a `mandate_created` webhook for each entry, which will be the same as the webhooks - * triggered when [ creating a mandate ](#mandates-create-a-mandate) using the mandates API. Once - * these webhooks start arriving, any reconciliation can now be accomplished by [checking the - * current status](#mandate-imports-get-a-mandate-import) of the mandate import and [linking up the - * mandates to your system](#mandate-import-entries-list-all-mandate-import-entries). + * We will issue a mandate_created webhook for each entry, which will be the same as + * the webhooks triggered when + * creating a + * mandate using the mandates API. Once these webhooks start arriving, any reconciliation can + * now be accomplished by checking + * the current status of the mandate import and linking + * up the mandates to your system. * *

* Note that all Mandate Imports have an upper limit of 30,000 entries, so we recommend you split * your import into several smaller imports if you're planning to exceed this threshold. *

- * *

* Restricted: This API is currently only available for approved integrators - * please get in touch if you would like to use this API. @@ -54,7 +67,9 @@ public MandateImportService(HttpClient httpClient) { /** * Mandate imports are first created, before mandates are added one-at-a-time, so this endpoint * merely signals the start of the import process. Once you've finished adding entries to an - * import, you should [submit](#mandate-imports-submit-a-mandate-import) it. + * import, you should submit + * it. */ public MandateImportCreateRequest create() { return new MandateImportCreateRequest(httpClient); @@ -93,7 +108,9 @@ public MandateImportCancelRequest cancel(String identity) { * * Mandate imports are first created, before mandates are added one-at-a-time, so this endpoint * merely signals the start of the import process. Once you've finished adding entries to an - * import, you should [submit](#mandate-imports-submit-a-mandate-import) it. + * import, you should submit + * it. */ public static final class MandateImportCreateRequest extends IdempotentPostRequest { diff --git a/src/main/java/com/gocardless/services/MandatePdfService.java b/src/main/java/com/gocardless/services/MandatePdfService.java index a22ef4a7..79fc83b9 100644 --- a/src/main/java/com/gocardless/services/MandatePdfService.java +++ b/src/main/java/com/gocardless/services/MandatePdfService.java @@ -7,8 +7,9 @@ /** * Service class for working with mandate pdf resources. * - * Mandate PDFs allow you to easily display [scheme-rules - * compliant](#appendix-compliance-requirements) Direct Debit mandates to your customers. + * Mandate PDFs allow you to easily display scheme-rules + * compliant Direct Debit mandates to your customers. */ public class MandatePdfService { private final HttpClient httpClient; @@ -25,22 +26,25 @@ public MandatePdfService(HttpClient httpClient) { * Generates a PDF mandate and returns its temporary URL. * * Customer and bank account details can be left blank (for a blank mandate), provided manually, - * or inferred from the ID of an existing [mandate](#core-endpoints-mandates). + * or inferred from the ID of an existing mandate. * * By default, we'll generate PDF mandates in English. * - * To generate a PDF mandate in another language, set the `Accept-Language` header when creating - * the PDF mandate to the relevant [ISO - * 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code supported for the - * scheme. + * To generate a PDF mandate in another language, set the Accept-Language header + * when creating the PDF mandate to the relevant + * ISO 639-1 language code + * supported for the scheme. * * | Scheme | Supported languages | | :--------------- | * :------------------------------------------------------------------------------------------------------------------------------------------- - * | | ACH | English (`en`) | | Autogiro | English (`en`), Swedish (`sv`) | | Bacs | English - * (`en`) | | BECS | English (`en`) | | BECS NZ | English (`en`) | | Betalingsservice | Danish - * (`da`), English (`en`) | | PAD | English (`en`) | | SEPA Core | Danish (`da`), Dutch (`nl`), - * English (`en`), French (`fr`), German (`de`), Italian (`it`), Portuguese (`pt`), Spanish - * (`es`), Swedish (`sv`) | + * | | ACH | English (en) | | Autogiro | English (en), Swedish + * (sv) | | Bacs | English (en) | | BECS | English (en) | + * | BECS NZ | English (en) | | Betalingsservice | Danish (da), + * English (en) | | PAD | English (en) | | SEPA Core | Danish + * (da), Dutch (nl), English (en), French + * (fr), German (de), Italian (it), Portuguese + * (pt), Spanish (es), Swedish (sv) | */ public MandatePdfCreateRequest create() { return new MandatePdfCreateRequest(httpClient); @@ -52,22 +56,25 @@ public MandatePdfCreateRequest create() { * Generates a PDF mandate and returns its temporary URL. * * Customer and bank account details can be left blank (for a blank mandate), provided manually, - * or inferred from the ID of an existing [mandate](#core-endpoints-mandates). + * or inferred from the ID of an existing mandate. * * By default, we'll generate PDF mandates in English. * - * To generate a PDF mandate in another language, set the `Accept-Language` header when creating - * the PDF mandate to the relevant [ISO - * 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code supported for the - * scheme. + * To generate a PDF mandate in another language, set the Accept-Language header + * when creating the PDF mandate to the relevant + * ISO 639-1 language code + * supported for the scheme. * * | Scheme | Supported languages | | :--------------- | * :------------------------------------------------------------------------------------------------------------------------------------------- - * | | ACH | English (`en`) | | Autogiro | English (`en`), Swedish (`sv`) | | Bacs | English - * (`en`) | | BECS | English (`en`) | | BECS NZ | English (`en`) | | Betalingsservice | Danish - * (`da`), English (`en`) | | PAD | English (`en`) | | SEPA Core | Danish (`da`), Dutch (`nl`), - * English (`en`), French (`fr`), German (`de`), Italian (`it`), Portuguese (`pt`), Spanish - * (`es`), Swedish (`sv`) | + * | | ACH | English (en) | | Autogiro | English (en), Swedish + * (sv) | | Bacs | English (en) | | BECS | English (en) | + * | BECS NZ | English (en) | | Betalingsservice | Danish (da), + * English (en) | | PAD | English (en) | | SEPA Core | Danish + * (da), Dutch (nl), English (en), French + * (fr), German (de), Italian (it), Portuguese + * (pt), Spanish (es), Swedish (sv) | */ public static final class MandatePdfCreateRequest extends PostRequest { private String accountHolderName; @@ -100,7 +107,9 @@ public static final class MandatePdfCreateRequest extends PostRequestcustomer. + * This field cannot exceed 18 characters. */ public MandatePdfCreateRequest withAccountHolderName(String accountHolderName) { this.accountHolderName = accountHolderName; @@ -108,8 +117,9 @@ public MandatePdfCreateRequest withAccountHolderName(String accountHolderName) { } /** - * Bank account number - see [local details](#appendix-local-bank-details) for more - * information. Alternatively you can provide an `iban`. + * Bank account number - see local + * details for more information. Alternatively you can provide an iban. */ public MandatePdfCreateRequest withAccountNumber(String accountNumber) { this.accountNumber = accountNumber; @@ -118,8 +128,9 @@ public MandatePdfCreateRequest withAccountNumber(String accountNumber) { /** * 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. + * bank accounts in other currencies. See local + * details for more information. */ public MandatePdfCreateRequest withAccountType(AccountType accountType) { this.accountType = accountType; @@ -151,8 +162,9 @@ public MandatePdfCreateRequest withAddressLine3(String addressLine3) { } /** - * Bank code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Bank code - see local + * details for more information. Alternatively you can provide an iban. */ public MandatePdfCreateRequest withBankCode(String bankCode) { this.bankCode = bankCode; @@ -160,8 +172,9 @@ public MandatePdfCreateRequest withBankCode(String bankCode) { } /** - * SWIFT BIC. Will be derived automatically if a valid `iban` or [local - * details](#appendix-local-bank-details) are provided. + * SWIFT BIC. Will be derived automatically if a valid iban or local + * details are provided. */ public MandatePdfCreateRequest withBic(String bic) { this.bic = bic; @@ -169,8 +182,9 @@ public MandatePdfCreateRequest withBic(String bic) { } /** - * Branch code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Branch code - see local + * details for more information. Alternatively you can provide an iban. */ public MandatePdfCreateRequest withBranchCode(String branchCode) { this.branchCode = branchCode; @@ -195,9 +209,9 @@ public MandatePdfCreateRequest withCompanyName(String companyName) { } /** - * [ISO - * 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) - * alpha-2 code. Required if providing local details. + * ISO + * 3166-1 alpha-2 code. Required if providing local details. */ public MandatePdfCreateRequest withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -215,7 +229,7 @@ public MandatePdfCreateRequest withDanishIdentityNumber(String danishIdentityNum /** * The customer's family name (i.e. last name). Used to populate the "Customer Name or - * Company name" field on the PDF. Ignored if `company_name` is provided. + * Company name" field on the PDF. Ignored if company_name is provided. */ public MandatePdfCreateRequest withFamilyName(String familyName) { this.familyName = familyName; @@ -224,7 +238,7 @@ public MandatePdfCreateRequest withFamilyName(String familyName) { /** * The customer's given name (i.e. first name). Used to populate the "Customer Name or - * Company name" field on the PDF. Ignored if `company_name` is provided. + * Company name" field on the PDF. Ignored if company_name is provided. */ public MandatePdfCreateRequest withGivenName(String givenName) { this.givenName = givenName; @@ -232,8 +246,9 @@ public MandatePdfCreateRequest withGivenName(String givenName) { } /** - * International Bank Account Number. Alternatively you can provide [local - * details](#appendix-local-bank-details). IBANs cannot be provided for Autogiro mandates. + * International Bank Account Number. Alternatively you can provide local + * details. IBANs cannot be provided for Autogiro mandates. */ public MandatePdfCreateRequest withIban(String iban) { this.iban = iban; @@ -246,8 +261,9 @@ public MandatePdfCreateRequest withLinks(Links links) { } /** - * ID of an existing [creditor](#core-endpoints-creditors). Only required if your account - * manages multiple creditors. + * ID of an existing creditor. + * Only required if your account manages multiple creditors. */ public MandatePdfCreateRequest withLinksCreditor(String creditor) { if (links == null) { @@ -258,9 +274,10 @@ public MandatePdfCreateRequest withLinksCreditor(String creditor) { } /** - * ID of an existing [mandate](#core-endpoints-mandates) to build the PDF from. The - * customer's bank details will be censored in the generated PDF. No other parameters may be - * provided alongside this. + * ID of an existing mandate to + * build the PDF from. The customer's bank details will be censored in the generated PDF. No + * other parameters may be provided alongside this. */ public MandatePdfCreateRequest withLinksMandate(String mandate) { if (links == null) { @@ -306,8 +323,8 @@ public MandatePdfCreateRequest withPostalCode(String postalCode) { /** * The customer's address region, county or department. For US customers a 2 letter - * [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state code is required (e.g. - * `CA` for California). + * ISO3166-2:US state code is + * required (e.g. CA for California). */ public MandatePdfCreateRequest withRegion(String region) { this.region = region; @@ -317,7 +334,9 @@ public MandatePdfCreateRequest withRegion(String region) { /** * Direct Debit scheme. Can be supplied or automatically detected from the bank account * details provided. If you do not provide a scheme, you must provide either a mandate, an - * `iban`, or [local details](#appendix-local-bank-details) including a `country_code`. + * iban, or local + * details including a country_code. */ public MandatePdfCreateRequest withScheme(String scheme) { this.scheme = scheme; @@ -335,7 +354,7 @@ public MandatePdfCreateRequest withSignatureDate(String signatureDate) { /** * For American customers only. Subscription amount being authorised by the mandate. In the * lowest denomination for the currency (cents in USD). Is required if - * `subscription_frequency` has been provided. + * subscription_frequency has been provided. */ public MandatePdfCreateRequest withSubscriptionAmount(Integer subscriptionAmount) { this.subscriptionAmount = subscriptionAmount; @@ -344,8 +363,8 @@ public MandatePdfCreateRequest withSubscriptionAmount(Integer subscriptionAmount /** * For American customers only. Frequency of the subscription being authorised by the - * mandate. One of `weekly`, `monthly` or `yearly`. Is required if `subscription_amount` has - * been provided. + * mandate. One of weekly, monthly or yearly. Is + * required if subscription_amount has been provided. */ public MandatePdfCreateRequest withSubscriptionFrequency(String subscriptionFrequency) { this.subscriptionFrequency = subscriptionFrequency; @@ -407,8 +426,9 @@ public static class Links { private String mandate; /** - * ID of an existing [creditor](#core-endpoints-creditors). Only required if your - * account manages multiple creditors. + * ID of an existing creditor. + * Only required if your account manages multiple creditors. */ public Links withCreditor(String creditor) { this.creditor = creditor; @@ -416,9 +436,10 @@ public Links withCreditor(String creditor) { } /** - * ID of an existing [mandate](#core-endpoints-mandates) to build the PDF from. The - * customer's bank details will be censored in the generated PDF. No other parameters - * may be provided alongside this. + * ID of an existing mandate + * to build the PDF from. The customer's bank details will be censored in the generated + * PDF. No other parameters may be provided alongside this. */ public Links withMandate(String mandate) { this.mandate = mandate; diff --git a/src/main/java/com/gocardless/services/MandateService.java b/src/main/java/com/gocardless/services/MandateService.java index 1f7dd228..a535a148 100644 --- a/src/main/java/com/gocardless/services/MandateService.java +++ b/src/main/java/com/gocardless/services/MandateService.java @@ -14,10 +14,12 @@ /** * Service class for working with mandate resources. * - * Mandates represent the Direct Debit mandate with a [customer](#core-endpoints-customers). + * Mandates represent the Direct Debit mandate with a + * customer. * - * GoCardless will notify you via a [webhook](#appendix-webhooks) whenever the status of a mandate - * changes. + * GoCardless will notify you via a + * webhook whenever + * the status of a mandate changes. */ public class MandateService { private final HttpClient httpClient; @@ -38,7 +40,9 @@ public MandateCreateRequest create() { } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your mandates. + * Returns a cursor-paginated + * list of your mandates. */ public MandateListRequest> list() { return new MandateListRequest<>(httpClient, ListRequest.pagingExecutor()); @@ -66,7 +70,8 @@ public MandateUpdateRequest update(String identity) { * Immediately cancels a mandate and all associated cancellable payments. Any metadata supplied * to this endpoint will be stored on the mandate cancellation event it causes. * - * This will fail with a `cancellation_failed` error if the mandate is already cancelled. + * This will fail with a cancellation_failed error if the mandate is already + * cancelled. */ public MandateCancelRequest cancel(String identity) { return new MandateCancelRequest(httpClient, identity); @@ -74,13 +79,14 @@ public MandateCancelRequest cancel(String identity) { /** * Reinstates a cancelled or expired mandate to the banks. - * You will receive a `resubmission_requested` webhook, but after that reinstating the mandate - * follows the same process as its initial creation, so you will receive a `submitted` webhook, - * followed by a `reinstated` or `failed` webhook up to two working days later. Any metadata - * supplied to this endpoint will be stored on the `resubmission_requested` event it causes. + * You will receive a resubmission_requested webhook, but after that reinstating + * the mandate follows the same process as its initial creation, so you will receive a + * submitted webhook, followed by a reinstated or failed + * webhook up to two working days later. Any metadata supplied to this endpoint will be stored + * on the resubmission_requested event it causes. * - * This will fail with a `mandate_not_inactive` error if the mandate is already being submitted, - * or is active. + * This will fail with a mandate_not_inactive error if the mandate is already being + * submitted, or is active. * * Mandates can be resubmitted up to 10 times. */ @@ -102,14 +108,13 @@ public static final class MandateCreateRequest extends IdempotentPostRequestSEC code. * * This is the way that the payer gives authorisation to the merchant. web: Authorisation is * Internet Initiated or via Mobile Entry (maps to SEC code: WEB) telephone: Authorisation * is provided orally over telephone (maps to SEC code: TEL) paper: Authorisation is * provided in writing and signed, or similarly authenticated (maps to SEC code: PPD) - * */ public MandateCreateRequest withAuthorisationSource( AuthorisationSource authorisationSource) { @@ -123,8 +128,9 @@ public MandateCreateRequest withLinks(Links links) { } /** - * ID of the associated [creditor](#core-endpoints-creditors). Only required if your account - * manages multiple creditors. + * ID of the associated creditor. + * Only required if your account manages multiple creditors. */ public MandateCreateRequest withLinksCreditor(String creditor) { if (links == null) { @@ -135,8 +141,9 @@ public MandateCreateRequest withLinksCreditor(String creditor) { } /** - * ID of the associated [customer bank account](#core-endpoints-customer-bank-accounts) - * which the mandate is created and submits payments against. + * ID of the associated customer + * bank account which the mandate is created and submits payments against. */ public MandateCreateRequest withLinksCustomerBankAccount(String customerBankAccount) { if (links == null) { @@ -172,9 +179,8 @@ public MandateCreateRequest withMetadata(String key, String value) { * the payer to whom the mandate belongs (i.e. as a result of their completion of a mandate * setup flow in their browser). * - * Not required for creating offline mandates where `authorisation_source` is set to - * telephone or paper. - * + * Not required for creating offline mandates where authorisation_source is set + * to telephone or paper. */ public MandateCreateRequest withPayerIpAddress(String payerIpAddress) { this.payerIpAddress = payerIpAddress; @@ -182,9 +188,10 @@ public MandateCreateRequest withPayerIpAddress(String payerIpAddress) { } /** - * Unique reference. Different schemes have different length and [character - * set](#appendix-character-sets) requirements. GoCardless will generate a unique reference - * satisfying the different scheme requirements if this field is left blank. + * Unique reference. Different schemes have different length and character + * set requirements. GoCardless will generate a unique reference satisfying the + * different scheme requirements if this field is left blank. */ public MandateCreateRequest withReference(String reference) { this.reference = reference; @@ -262,8 +269,9 @@ public static class Links { private String customerBankAccount; /** - * ID of the associated [creditor](#core-endpoints-creditors). Only required if your - * account manages multiple creditors. + * ID of the associated creditor. + * Only required if your account manages multiple creditors. */ public Links withCreditor(String creditor) { this.creditor = creditor; @@ -271,8 +279,9 @@ public Links withCreditor(String creditor) { } /** - * ID of the associated [customer bank account](#core-endpoints-customer-bank-accounts) - * which the mandate is created and submits payments against. + * ID of the associated customer + * bank account which the mandate is created and submits payments against. */ public Links withCustomerBankAccount(String customerBankAccount) { this.customerBankAccount = customerBankAccount; @@ -284,7 +293,9 @@ public Links withCustomerBankAccount(String customerBankAccount) { /** * Request class for {@link MandateService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your mandates. + * Returns a cursor-paginated + * list of your mandates. */ public static final class MandateListRequest extends ListRequest { private CreatedAt createdAt; @@ -362,9 +373,10 @@ public MandateListRequest withCreatedAtLte(String lte) { } /** - * ID of a [creditor](#core-endpoints-creditors). If specified, this endpoint will return - * all mandates for the given creditor. Cannot be used in conjunction with `customer` or - * `customer_bank_account` + * ID of a creditor. + * If specified, this endpoint will return all mandates for the given creditor. Cannot be + * used in conjunction with customer or customer_bank_account */ public MandateListRequest withCreditor(String creditor) { this.creditor = creditor; @@ -372,9 +384,10 @@ public MandateListRequest withCreditor(String creditor) { } /** - * ID of a [customer](#core-endpoints-customers). If specified, this endpoint will return - * all mandates for the given customer. Cannot be used in conjunction with - * `customer_bank_account` or `creditor` + * ID of a customer. + * If specified, this endpoint will return all mandates for the given customer. Cannot be + * used in conjunction with customer_bank_account or creditor */ public MandateListRequest withCustomer(String customer) { this.customer = customer; @@ -382,9 +395,11 @@ public MandateListRequest withCustomer(String customer) { } /** - * ID of a [customer bank account](#core-endpoints-customer-bank-accounts). If specified, - * this endpoint will return all mandates for the given bank account. Cannot be used in - * conjunction with `customer` or `creditor` + * ID of a customer + * bank account. If specified, this endpoint will return all mandates for the given bank + * account. Cannot be used in conjunction with customer or + * creditor */ public MandateListRequest withCustomerBankAccount(String customerBankAccount) { this.customerBankAccount = customerBankAccount; @@ -408,9 +423,10 @@ public MandateListRequest withMandateType(String mandateType) { } /** - * Unique reference. Different schemes have different length and [character - * set](#appendix-character-sets) requirements. GoCardless will generate a unique reference - * satisfying the different scheme requirements if this field is left blank. + * Unique reference. Different schemes have different length and character + * set requirements. GoCardless will generate a unique reference satisfying the + * different scheme requirements if this field is left blank. */ public MandateListRequest withReference(String reference) { this.reference = reference; @@ -705,7 +721,8 @@ protected boolean hasBody() { * Immediately cancels a mandate and all associated cancellable payments. Any metadata supplied * to this endpoint will be stored on the mandate cancellation event it causes. * - * This will fail with a `cancellation_failed` error if the mandate is already cancelled. + * This will fail with a cancellation_failed error if the mandate is already + * cancelled. */ public static final class MandateCancelRequest extends PostRequest { @PathParam @@ -780,13 +797,14 @@ protected String getRequestEnvelope() { * Request class for {@link MandateService#reinstate }. * * Reinstates a cancelled or expired mandate to the banks. - * You will receive a `resubmission_requested` webhook, but after that reinstating the mandate - * follows the same process as its initial creation, so you will receive a `submitted` webhook, - * followed by a `reinstated` or `failed` webhook up to two working days later. Any metadata - * supplied to this endpoint will be stored on the `resubmission_requested` event it causes. + * You will receive a resubmission_requested webhook, but after that reinstating + * the mandate follows the same process as its initial creation, so you will receive a + * submitted webhook, followed by a reinstated or failed + * webhook up to two working days later. Any metadata supplied to this endpoint will be stored + * on the resubmission_requested event it causes. * - * This will fail with a `mandate_not_inactive` error if the mandate is already being submitted, - * or is active. + * This will fail with a mandate_not_inactive error if the mandate is already being + * submitted, or is active. * * Mandates can be resubmitted up to 10 times. */ diff --git a/src/main/java/com/gocardless/services/NegativeBalanceLimitService.java b/src/main/java/com/gocardless/services/NegativeBalanceLimitService.java index 75bbbe8e..161c26d2 100644 --- a/src/main/java/com/gocardless/services/NegativeBalanceLimitService.java +++ b/src/main/java/com/gocardless/services/NegativeBalanceLimitService.java @@ -14,7 +14,6 @@ * The negative balance limit is a threshold for the creditor balance beyond which refunds are not * permitted. The default limit is zero — refunds are not permitted if the creditor has a negative * balance. The limit can be changed on a per-creditor basis. - * */ public class NegativeBalanceLimitService { private final HttpClient httpClient; @@ -29,7 +28,9 @@ public NegativeBalanceLimitService(HttpClient httpClient) { } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of negative balance limits. + * Returns a cursor-paginated + * list of negative balance limits. */ public NegativeBalanceLimitListRequest> list() { return new NegativeBalanceLimitListRequest<>(httpClient, @@ -44,7 +45,9 @@ public NegativeBalanceLimitListRequest> all() { /** * Request class for {@link NegativeBalanceLimitService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of negative balance limits. + * Returns a cursor-paginated + * list of negative balance limits. */ public static final class NegativeBalanceLimitListRequest extends ListRequest { @@ -76,8 +79,8 @@ public NegativeBalanceLimitListRequest withCreditor(String creditor) { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public NegativeBalanceLimitListRequest withCurrency(Currency currency) { this.currency = currency; diff --git a/src/main/java/com/gocardless/services/OutboundPaymentImportEntryService.java b/src/main/java/com/gocardless/services/OutboundPaymentImportEntryService.java index e4ca2fcd..b558ff28 100644 --- a/src/main/java/com/gocardless/services/OutboundPaymentImportEntryService.java +++ b/src/main/java/com/gocardless/services/OutboundPaymentImportEntryService.java @@ -26,8 +26,9 @@ public OutboundPaymentImportEntryService(HttpClient httpClient) { } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of the entries for a given - * outbound payment import. + * Returns a cursor-paginated + * list of the entries for a given outbound payment import. */ public OutboundPaymentImportEntryListRequest> list() { return new OutboundPaymentImportEntryListRequest<>(httpClient, @@ -42,8 +43,9 @@ public OutboundPaymentImportEntryListRequestcursor-paginated + * list of the entries for a given outbound payment import. */ public static final class OutboundPaymentImportEntryListRequest extends ListRequest { diff --git a/src/main/java/com/gocardless/services/OutboundPaymentImportService.java b/src/main/java/com/gocardless/services/OutboundPaymentImportService.java index ddec34b4..4854f792 100644 --- a/src/main/java/com/gocardless/services/OutboundPaymentImportService.java +++ b/src/main/java/com/gocardless/services/OutboundPaymentImportService.java @@ -14,10 +14,15 @@ * * Outbound Payment Imports allow you to create multiple payments via a single API call. * - * The Workflow: 1. Create the outbound payment import. 2. Retrieve an authorisation link from the - * response. 3. Redirect the user to the link to authorise the import. 4. Once the user authorises - * the import, the individual outbound payments are automatically submitted. + * The Workflow: * + *

    + *
  1. Create the outbound payment import.
  2. + *
  3. Retrieve an authorisation link from the response.
  4. + *
  5. Redirect the user to the link to authorise the import.
  6. + *
  7. Once the user authorises the import, the individual outbound payments are automatically + * submitted.
  8. + *
* Import entries are not processed as actual payments until they are reviewed and authorised in * GoCardless Dashboard. Upon approval, a unique outbound payment is generated for every entry in * the import. @@ -54,8 +59,9 @@ public OutboundPaymentImportGetRequest get(String identity) { } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your outbound payment - * imports. + * Returns a cursor-paginated + * list of your outbound payment imports. */ public OutboundPaymentImportListRequest> list() { return new OutboundPaymentImportListRequest<>(httpClient, @@ -187,9 +193,15 @@ public EntryItems withRecipientBankAccountId(String recipientBankAccountId) { /** * An optional reference that will appear on your customer's bank statement. The - * character limit for this reference is dependent on the scheme.
- * Faster Payments - 18 characters, including: - * "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 &-./"
+ * character limit for this reference is dependent on the scheme.
+ *
+ * Faster Payments + *
    + *
  • 18 characters, including: + * "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 &-./"
  • + *
+ *
+ *
*/ public EntryItems withReference(String reference) { this.reference = reference; @@ -283,8 +295,9 @@ protected Class getResponseClass() { /** * Request class for {@link OutboundPaymentImportService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your outbound payment - * imports. + * Returns a cursor-paginated + * list of your outbound payment imports. */ public static final class OutboundPaymentImportListRequest extends ListRequest { @@ -366,16 +379,17 @@ public OutboundPaymentImportListRequest withLimit(Integer limit) { /** * The status of the outbound payment import. + * *
    - *
  • `created`: The initial state of a new import.
  • - *
  • `validating`: Import validation in progress.
  • - *
  • `invalid`: Import validation failed.
  • - *
  • `valid`: Import validation succeeded.
  • - *
  • `processing`: Authorisation received; payments are being generated.
  • - *
  • `processed`: All entries have been successfully converted into outbound + *
  • created: The initial state of a new import.
  • + *
  • validating: Import validation in progress.
  • + *
  • invalid: Import validation failed.
  • + *
  • valid: Import validation succeeded.
  • + *
  • processing: Authorisation received; payments are being generated.
  • + *
  • processed: All entries have been successfully converted into outbound * payments.
  • - *
  • `cancelled`: The import was cancelled by a user or automatically expired by the - * system.
  • + *
  • cancelled: The import was cancelled by a user or automatically expired + * by the system.
  • *
*/ public OutboundPaymentImportListRequest withStatus(Status status) { diff --git a/src/main/java/com/gocardless/services/OutboundPaymentService.java b/src/main/java/com/gocardless/services/OutboundPaymentService.java index 78e2a716..7a87eb1b 100644 --- a/src/main/java/com/gocardless/services/OutboundPaymentService.java +++ b/src/main/java/com/gocardless/services/OutboundPaymentService.java @@ -12,18 +12,23 @@ /** * Service class for working with outbound payment resources. * - * Outbound Payments represent payments sent from [creditors](#core-endpoints-creditors). + * Outbound Payments represent payments sent from + * creditors. * - * GoCardless will notify you via a [webhook](#appendix-webhooks) when the status of the outbound - * payment [changes](#event-types-outbound-payment). + * GoCardless will notify you via a + * webhook when the + * status of the outbound payment changes. * - * ####Rate limiting + *

Rate limiting

Two rate limits apply to the Outbound Payments APIs: * - * Two rate limits apply to the Outbound Payments APIs: - All POST Outbound Payment endpoints - * (create, withdraw, approve, cancel and etc.) share a single rate-limit group of 300 requests per - * minute. As initiating a payment typically requires two API calls (one to create the payment and - * one to approve it), this allows you to add approximately 150 outbound payments per minute. - All - * remaining Outbound Payment endpoints are limited to 500 requests per minute. + *
    + *
  • All POST Outbound Payment endpoints (create, withdraw, approve, cancel and etc.) share a + * single rate-limit group of 300 requests per minute. As initiating a payment typically requires + * two API calls (one to create the payment and one to approve it), this allows you to add + * approximately 150 outbound payments per minute.
  • + *
  • All remaining Outbound Payment endpoints are limited to 500 requests per minute.
  • + *
*/ public class OutboundPaymentService { private final HttpClient httpClient; @@ -51,9 +56,10 @@ public OutboundPaymentWithdrawRequest withdraw() { } /** - * Cancels an outbound payment. Only outbound payments with either `verifying`, - * `pending_approval`, or `scheduled` status can be cancelled. Once an outbound payment is - * `executing`, the money moving process has begun and cannot be reversed. + * Cancels an outbound payment. Only outbound payments with either verifying, + * pending_approval, or scheduled status can be cancelled. Once an + * outbound payment is executing, the money moving process has begun and cannot be + * reversed. */ public OutboundPaymentCancelRequest cancel(String identity) { return new OutboundPaymentCancelRequest(httpClient, identity); @@ -75,7 +81,9 @@ public OutboundPaymentGetRequest get(String identity) { } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of outbound payments. + * Returns a cursor-paginated + * list of outbound payments. */ public OutboundPaymentListRequest> list() { return new OutboundPaymentListRequest<>(httpClient, @@ -204,9 +212,15 @@ public OutboundPaymentCreateRequest withMetadata(String key, String value) { /** * An optional reference that will appear on your customer's bank statement. The character - * limit for this reference is dependent on the scheme.
- * Faster Payments - 18 characters, including: - * "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 &-./"
+ * limit for this reference is dependent on the scheme.
+ *
+ * Faster Payments + *
    + *
  • 18 characters, including: + * "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 &-./"
  • + *
+ *
+ *
*/ public OutboundPaymentCreateRequest withReference(String reference) { this.reference = reference; @@ -385,9 +399,15 @@ public OutboundPaymentWithdrawRequest withMetadata(String key, String value) { /** * An optional reference that will appear on your customer's bank statement. The character - * limit for this reference is dependent on the scheme.
- * Faster Payments - 18 characters, including: - * "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 &-./"
+ * limit for this reference is dependent on the scheme.
+ *
+ * Faster Payments + *
    + *
  • 18 characters, including: + * "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 &-./"
  • + *
+ *
+ *
*/ public OutboundPaymentWithdrawRequest withReference(String reference) { this.reference = reference; @@ -464,9 +484,10 @@ public Links withCreditor(String creditor) { /** * Request class for {@link OutboundPaymentService#cancel }. * - * Cancels an outbound payment. Only outbound payments with either `verifying`, - * `pending_approval`, or `scheduled` status can be cancelled. Once an outbound payment is - * `executing`, the money moving process has begun and cannot be reversed. + * Cancels an outbound payment. Only outbound payments with either verifying, + * pending_approval, or scheduled status can be cancelled. Once an + * outbound payment is executing, the money moving process has begun and cannot be + * reversed. */ public static final class OutboundPaymentCancelRequest extends PostRequest { @PathParam @@ -635,7 +656,9 @@ protected Class getResponseClass() { /** * Request class for {@link OutboundPaymentService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of outbound payments. + * Returns a cursor-paginated + * list of outbound payments. */ public static final class OutboundPaymentListRequest extends ListRequest { @@ -685,23 +708,26 @@ public OutboundPaymentListRequest withLimit(Integer limit) { /** * One of: + * *
    - *
  • `verifying`: The payment has been - * [created](#outbound-payments-create-an-outbound-payment) and the verification process has - * begun.
  • - *
  • `pending_approval`: The payment is awaiting - * [approval](#outbound-payments-approve-an-outbound-payment).
  • - *
  • `scheduled`: The payment has passed verification & - * [approval](#outbound-payments-approve-an-outbound-payment), but processing has not yet - * begun.
  • - *
  • `executing`: The execution date has arrived and the payment has been placed in queue - * for processing.
  • - *
  • `executed`: The payment has been accepted by the scheme and is now on its way to the - * recipient.
  • - *
  • `cancelled`: The payment has been - * [cancelled](#outbound-payments-cancel-an-outbound-payment) or was not - * [approved](#outbound-payments-approve-an-outbound-payment) on time.
  • - *
  • `failed`: The payment was not sent, usually due to an error while or after + *
  • verifying: The payment has been created + * and the verification process has begun.
  • + *
  • pending_approval: The payment is awaiting approval.
  • + *
  • scheduled: The payment has passed verification & approval, + * but processing has not yet begun.
  • + *
  • executing: The execution date has arrived and the payment has been + * placed in queue for processing.
  • + *
  • executed: The payment has been accepted by the scheme and is now on its + * way to the recipient.
  • + *
  • cancelled: The payment has been cancelled + * or was not approved + * on time.
  • + *
  • failed: The payment was not sent, usually due to an error while or after * executing.
  • *
*/ diff --git a/src/main/java/com/gocardless/services/PayerAuthorisationService.java b/src/main/java/com/gocardless/services/PayerAuthorisationService.java index 7319d697..31dcc644 100644 --- a/src/main/java/com/gocardless/services/PayerAuthorisationService.java +++ b/src/main/java/com/gocardless/services/PayerAuthorisationService.java @@ -14,40 +14,46 @@ * Billing * Requests. Use Billing Requests to build any future integrations. *

- * * Payer Authorisation resource acts as a wrapper for creating customer, bank account and mandate * details in a single request. PayerAuthorisation API enables the integrators to build their own * custom payment pages. * * The process to use the Payer Authorisation API is as follows: * - * 1. Create a Payer Authorisation, either empty or with already available information 2. Update the - * authorisation with additional information or fix any mistakes 3. Submit the authorisation, after - * the payer has reviewed their information 4. [coming soon] Redirect the payer to the verification - * mechanisms from the response of the Submit request (this will be introduced as a non-breaking - * change) 5. Confirm the authorisation to indicate that the resources can be created - * + *
    + *
  1. Create a Payer Authorisation, either empty or with already available information
  2. + *
  3. Update the authorisation with additional information or fix any mistakes
  4. + *
  5. Submit the authorisation, after the payer has reviewed their information
  6. + *
  7. [coming soon] Redirect the payer to the verification mechanisms from the response of the + * Submit request (this will be introduced as a non-breaking change)
  8. + *
  9. Confirm the authorisation to indicate that the resources can be created
  10. + *
* After the Payer Authorisation is confirmed, resources will eventually be created as it's an * asynchronous process. * * To retrieve the status and ID of the linked resources you can do one of the following: + * *
    - *
  1. Listen to payer_authorisation_completed - * webhook (recommended)
  2. - *
  3. Poll the GET + *
  4. Listen to payer_authorisation_completed + * webhook + * (recommended)
  5. + *
  6. Poll the GET * endpoint
  7. *
  8. Poll the GET events API - * https://api.gocardless.com/events?payer_authorisation={id}&action=completed
  9. + * https://api.gocardless.com/events?payer_authorisation={id}&action=completed *
- * *

- * Note that the `create` and `update` endpoints behave differently than other existing `create` and - * `update` endpoints. The Payer Authorisation is still saved if incomplete data is provided. We - * return the list of incomplete data in the `incomplete_fields` along with the resources in the - * body of the response. The bank account details(account_number, bank_code & branch_code) must be - * sent together rather than splitting across different request for both `create` and `update` + * Note that the create and update endpoints behave differently than other + * existing create and update endpoints. The Payer Authorisation is still + * saved if incomplete data is provided. We return the list of incomplete data in the + * incomplete_fields along with the resources in the body of the response. The bank + * account details(account_number, bank_code & branch_code) must be sent together rather than + * splitting across different request for both create and update * endpoints.
+ *
*
+ *
* The API is designed to be flexible and allows you to collect information in multiple steps * without storing any sensitive data in the browser or in your servers. *

@@ -90,8 +96,8 @@ public PayerAuthorisationCreateRequest create() { * designed this way so you do not need to save any payer data on your servers or the browser * while still being able to implement a progressive solution, such a multi-step form. *

- * Note that in order to update the `metadata` attribute values it must be sent completely as it - * overrides the previously existing values. + * Note that in order to update the metadata attribute values it must be sent + * completely as it overrides the previously existing values. *

*/ public PayerAuthorisationUpdateRequest update(String identity) { @@ -182,8 +188,9 @@ public static final class PayerAuthorisationCreateRequest private Mandate mandate; /** - * All details required for the creation of a [Customer Bank - * Account](#core-endpoints-customer-bank-accounts). + * All details required for the creation of a Customer + * Bank Account. */ public PayerAuthorisationCreateRequest withBankAccount(BankAccount bankAccount) { this.bankAccount = bankAccount; @@ -194,8 +201,9 @@ public PayerAuthorisationCreateRequest withBankAccount(BankAccount bankAccount) * Name of the account holder, as known by the bank. The full name provided when the * customer is created is stored and is available via the API, but is transliterated, * upcased, and truncated to 18 characters in bank submissions. This field is required - * unless the request includes a [customer bank account - * token](#javascript-flow-customer-bank-account-tokens). + * unless the request includes a customer + * bank account token. */ public PayerAuthorisationCreateRequest withBankAccountAccountHolderName( String accountHolderName) { @@ -207,8 +215,9 @@ public PayerAuthorisationCreateRequest withBankAccountAccountHolderName( } /** - * Bank account number - see [local details](#appendix-local-bank-details) for more - * information. Alternatively you can provide an `iban`. + * Bank account number - see local + * details for more information. Alternatively you can provide an iban. */ public PayerAuthorisationCreateRequest withBankAccountAccountNumber(String accountNumber) { if (bankAccount == null) { @@ -232,8 +241,9 @@ public PayerAuthorisationCreateRequest withBankAccountAccountNumberEnding( } /** - * Account number suffix (only for bank accounts denominated in NZD) - see [local - * details](#local-bank-details-new-zealand) for more information. + * Account number suffix (only for bank accounts denominated in NZD) - see local + * details for more information. */ public PayerAuthorisationCreateRequest withBankAccountAccountNumberSuffix( String accountNumberSuffix) { @@ -246,8 +256,9 @@ public PayerAuthorisationCreateRequest withBankAccountAccountNumberSuffix( /** * 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. + * bank accounts in other currencies. See local + * details for more information. */ public PayerAuthorisationCreateRequest withBankAccountAccountType( BankAccount.AccountType accountType) { @@ -259,8 +270,9 @@ public PayerAuthorisationCreateRequest withBankAccountAccountType( } /** - * Bank code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Bank code - see local + * details for more information. Alternatively you can provide an iban. */ public PayerAuthorisationCreateRequest withBankAccountBankCode(String bankCode) { if (bankAccount == null) { @@ -271,8 +283,9 @@ public PayerAuthorisationCreateRequest withBankAccountBankCode(String bankCode) } /** - * Branch code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Branch code - see local + * details for more information. Alternatively you can provide an iban. */ public PayerAuthorisationCreateRequest withBankAccountBranchCode(String branchCode) { if (bankAccount == null) { @@ -283,9 +296,10 @@ public PayerAuthorisationCreateRequest withBankAccountBranchCode(String branchCo } /** - * [ISO 3166-1 alpha-2 - * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). - * Defaults to the country code of the `iban` if supplied, otherwise is required. + * ISO + * 3166-1 alpha-2 code. Defaults to the country code of the iban if + * supplied, otherwise is required. */ public PayerAuthorisationCreateRequest withBankAccountCountryCode(String countryCode) { if (bankAccount == null) { @@ -296,8 +310,8 @@ public PayerAuthorisationCreateRequest withBankAccountCountryCode(String country } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public PayerAuthorisationCreateRequest withBankAccountCurrency(String currency) { if (bankAccount == null) { @@ -308,9 +322,12 @@ public PayerAuthorisationCreateRequest withBankAccountCurrency(String currency) } /** - * International Bank Account Number. Alternatively you can provide [local - * details](#appendix-local-bank-details). IBANs are not accepted for Swedish bank accounts - * denominated in SEK - you must supply [local details](#local-bank-details-sweden). + * International Bank Account Number. Alternatively you can provide local + * details. IBANs are not accepted for Swedish bank accounts denominated in SEK - you + * must supply + * local + * details. */ public PayerAuthorisationCreateRequest withBankAccountIban(String iban) { if (bankAccount == null) { @@ -334,7 +351,8 @@ public PayerAuthorisationCreateRequest withBankAccountMetadata( } /** - * All details required for the creation of a [Customer](#core-endpoints-customers). + * All details required for the creation of a Customer. */ public PayerAuthorisationCreateRequest withCustomer(Customer customer) { this.customer = customer; @@ -386,10 +404,11 @@ public PayerAuthorisationCreateRequest withCustomerCity(String city) { } /** - * Customer's company name. Required unless a `given_name` and `family_name` are provided. - * For Canadian customers, the use of a `company_name` value will mean that any mandate - * created from this customer will be considered to be a "Business PAD" (otherwise, any - * mandate will be considered to be a "Personal PAD"). + * Customer's company name. Required unless a given_name and + * family_name are provided. For Canadian customers, the use of a + * company_name value will mean that any mandate created from this customer + * will be considered to be a "Business PAD" (otherwise, any mandate will be considered to + * be a "Personal PAD"). */ public PayerAuthorisationCreateRequest withCustomerCompanyName(String companyName) { if (customer == null) { @@ -400,8 +419,9 @@ public PayerAuthorisationCreateRequest withCustomerCompanyName(String companyNam } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public PayerAuthorisationCreateRequest withCustomerCountryCode(String countryCode) { if (customer == null) { @@ -437,7 +457,7 @@ public PayerAuthorisationCreateRequest withCustomerEmail(String email) { } /** - * Customer's surname. Required unless a `company_name` is provided. + * Customer's surname. Required unless a company_name is provided. */ public PayerAuthorisationCreateRequest withCustomerFamilyName(String familyName) { if (customer == null) { @@ -448,7 +468,7 @@ public PayerAuthorisationCreateRequest withCustomerFamilyName(String familyName) } /** - * Customer's first name. Required unless a `company_name` is provided. + * Customer's first name. Required unless a company_name is provided. */ public PayerAuthorisationCreateRequest withCustomerGivenName(String givenName) { if (customer == null) { @@ -459,9 +479,8 @@ public PayerAuthorisationCreateRequest withCustomerGivenName(String givenName) { } /** - * An [IETF Language Tag](https://tools.ietf.org/html/rfc5646), used for both language and - * regional variations of our product. - * + * An IETF Language Tag, used for both + * language and regional variations of our product. */ public PayerAuthorisationCreateRequest withCustomerLocale(String locale) { if (customer == null) { @@ -496,8 +515,8 @@ public PayerAuthorisationCreateRequest withCustomerPostalCode(String postalCode) /** * The customer's address region, county or department. For US customers a 2 letter - * [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state code is required (e.g. - * `CA` for California). + * ISO3166-2:US state code is + * required (e.g. CA for California). */ public PayerAuthorisationCreateRequest withCustomerRegion(String region) { if (customer == null) { @@ -522,7 +541,8 @@ public PayerAuthorisationCreateRequest withCustomerSwedishIdentityNumber( } /** - * All details required for the creation of a [Mandate](#core-endpoints-mandates). + * All details required for the creation of a Mandate. */ public PayerAuthorisationCreateRequest withMandate(Mandate mandate) { this.mandate = mandate; @@ -546,9 +566,8 @@ public PayerAuthorisationCreateRequest withMandateMetadata(Map m * the payer to whom the mandate belongs (i.e. as a result of their completion of a mandate * setup flow in their browser). * - * Not required for creating offline mandates where `authorisation_source` is set to - * telephone or paper. - * + * Not required for creating offline mandates where authorisation_source is set + * to telephone or paper. */ public PayerAuthorisationCreateRequest withMandatePayerIpAddress(String payerIpAddress) { if (mandate == null) { @@ -559,9 +578,10 @@ public PayerAuthorisationCreateRequest withMandatePayerIpAddress(String payerIpA } /** - * Unique reference. Different schemes have different length and [character - * set](#appendix-character-sets) requirements. GoCardless will generate a unique reference - * satisfying the different scheme requirements if this field is left blank. + * Unique reference. Different schemes have different length and character + * set requirements. GoCardless will generate a unique reference satisfying the + * different scheme requirements if this field is left blank. */ public PayerAuthorisationCreateRequest withMandateReference(String reference) { if (mandate == null) { @@ -643,8 +663,9 @@ public static class BankAccount { * Name of the account holder, as known by the bank. The full name provided when the * customer is created is stored and is available via the API, but is transliterated, * upcased, and truncated to 18 characters in bank submissions. This field is required - * unless the request includes a [customer bank account - * token](#javascript-flow-customer-bank-account-tokens). + * unless the request includes a customer + * bank account token. */ public BankAccount withAccountHolderName(String accountHolderName) { this.accountHolderName = accountHolderName; @@ -652,8 +673,9 @@ public BankAccount withAccountHolderName(String accountHolderName) { } /** - * Bank account number - see [local details](#appendix-local-bank-details) for more - * information. Alternatively you can provide an `iban`. + * Bank account number - see local + * details for more information. Alternatively you can provide an iban. */ public BankAccount withAccountNumber(String accountNumber) { this.accountNumber = accountNumber; @@ -670,8 +692,9 @@ public BankAccount withAccountNumberEnding(String accountNumberEnding) { } /** - * Account number suffix (only for bank accounts denominated in NZD) - see [local - * details](#local-bank-details-new-zealand) for more information. + * Account number suffix (only for bank accounts denominated in NZD) - see local + * details for more information. */ public BankAccount withAccountNumberSuffix(String accountNumberSuffix) { this.accountNumberSuffix = accountNumberSuffix; @@ -680,8 +703,9 @@ public BankAccount withAccountNumberSuffix(String accountNumberSuffix) { /** * 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. + * for bank accounts in other currencies. See local + * details for more information. */ public BankAccount withAccountType(AccountType accountType) { this.accountType = accountType; @@ -689,8 +713,9 @@ public BankAccount withAccountType(AccountType accountType) { } /** - * Bank code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Bank code - see local + * details for more information. Alternatively you can provide an iban. */ public BankAccount withBankCode(String bankCode) { this.bankCode = bankCode; @@ -698,8 +723,9 @@ public BankAccount withBankCode(String bankCode) { } /** - * Branch code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Branch code - see local + * details for more information. Alternatively you can provide an iban. */ public BankAccount withBranchCode(String branchCode) { this.branchCode = branchCode; @@ -707,9 +733,10 @@ public BankAccount withBranchCode(String branchCode) { } /** - * [ISO 3166-1 alpha-2 - * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). - * Defaults to the country code of the `iban` if supplied, otherwise is required. + * ISO + * 3166-1 alpha-2 code. Defaults to the country code of the iban if + * supplied, otherwise is required. */ public BankAccount withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -717,8 +744,9 @@ public BankAccount withCountryCode(String countryCode) { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. - * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency + * code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are + * supported. */ public BankAccount withCurrency(String currency) { this.currency = currency; @@ -726,10 +754,12 @@ public BankAccount withCurrency(String currency) { } /** - * International Bank Account Number. Alternatively you can provide [local - * details](#appendix-local-bank-details). IBANs are not accepted for Swedish bank - * accounts denominated in SEK - you must supply [local - * details](#local-bank-details-sweden). + * International Bank Account Number. Alternatively you can provide local + * details. IBANs are not accepted for Swedish bank accounts denominated in SEK - + * you must supply local + * details. */ public BankAccount withIban(String iban) { this.iban = iban; @@ -808,10 +838,11 @@ public Customer withCity(String city) { } /** - * Customer's company name. Required unless a `given_name` and `family_name` are - * provided. For Canadian customers, the use of a `company_name` value will mean that - * any mandate created from this customer will be considered to be a "Business PAD" - * (otherwise, any mandate will be considered to be a "Personal PAD"). + * Customer's company name. Required unless a given_name and + * family_name are provided. For Canadian customers, the use of a + * company_name value will mean that any mandate created from this customer + * will be considered to be a "Business PAD" (otherwise, any mandate will be considered + * to be a "Personal PAD"). */ public Customer withCompanyName(String companyName) { this.companyName = companyName; @@ -819,8 +850,9 @@ public Customer withCompanyName(String companyName) { } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public Customer withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -846,7 +878,7 @@ public Customer withEmail(String email) { } /** - * Customer's surname. Required unless a `company_name` is provided. + * Customer's surname. Required unless a company_name is provided. */ public Customer withFamilyName(String familyName) { this.familyName = familyName; @@ -854,7 +886,7 @@ public Customer withFamilyName(String familyName) { } /** - * Customer's first name. Required unless a `company_name` is provided. + * Customer's first name. Required unless a company_name is provided. */ public Customer withGivenName(String givenName) { this.givenName = givenName; @@ -862,9 +894,8 @@ public Customer withGivenName(String givenName) { } /** - * An [IETF Language Tag](https://tools.ietf.org/html/rfc5646), used for both language - * and regional variations of our product. - * + * An IETF Language Tag, used for both + * language and regional variations of our product. */ public Customer withLocale(String locale) { this.locale = locale; @@ -890,8 +921,8 @@ public Customer withPostalCode(String postalCode) { /** * The customer's address region, county or department. For US customers a 2 letter - * [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state code is required - * (e.g. `CA` for California). + * ISO3166-2:US state code is + * required (e.g. CA for California). */ public Customer withRegion(String region) { this.region = region; @@ -930,9 +961,8 @@ public Mandate withMetadata(Map metadata) { * address of the payer to whom the mandate belongs (i.e. as a result of their * completion of a mandate setup flow in their browser). * - * Not required for creating offline mandates where `authorisation_source` is set to - * telephone or paper. - * + * Not required for creating offline mandates where authorisation_source is + * set to telephone or paper. */ public Mandate withPayerIpAddress(String payerIpAddress) { this.payerIpAddress = payerIpAddress; @@ -940,9 +970,10 @@ public Mandate withPayerIpAddress(String payerIpAddress) { } /** - * Unique reference. Different schemes have different length and [character - * set](#appendix-character-sets) requirements. GoCardless will generate a unique - * reference satisfying the different scheme requirements if this field is left blank. + * Unique reference. Different schemes have different length and character + * set requirements. GoCardless will generate a unique reference satisfying the + * different scheme requirements if this field is left blank. */ public Mandate withReference(String reference) { this.reference = reference; @@ -989,8 +1020,8 @@ public String toString() { * designed this way so you do not need to save any payer data on your servers or the browser * while still being able to implement a progressive solution, such a multi-step form. *

- * Note that in order to update the `metadata` attribute values it must be sent completely as it - * overrides the previously existing values. + * Note that in order to update the metadata attribute values it must be sent + * completely as it overrides the previously existing values. *

*/ public static final class PayerAuthorisationUpdateRequest @@ -1002,8 +1033,9 @@ public static final class PayerAuthorisationUpdateRequest private Mandate mandate; /** - * All details required for the creation of a [Customer Bank - * Account](#core-endpoints-customer-bank-accounts). + * All details required for the creation of a Customer + * Bank Account. */ public PayerAuthorisationUpdateRequest withBankAccount(BankAccount bankAccount) { this.bankAccount = bankAccount; @@ -1014,8 +1046,9 @@ public PayerAuthorisationUpdateRequest withBankAccount(BankAccount bankAccount) * Name of the account holder, as known by the bank. The full name provided when the * customer is created is stored and is available via the API, but is transliterated, * upcased, and truncated to 18 characters in bank submissions. This field is required - * unless the request includes a [customer bank account - * token](#javascript-flow-customer-bank-account-tokens). + * unless the request includes a customer + * bank account token. */ public PayerAuthorisationUpdateRequest withBankAccountAccountHolderName( String accountHolderName) { @@ -1027,8 +1060,9 @@ public PayerAuthorisationUpdateRequest withBankAccountAccountHolderName( } /** - * Bank account number - see [local details](#appendix-local-bank-details) for more - * information. Alternatively you can provide an `iban`. + * Bank account number - see local + * details for more information. Alternatively you can provide an iban. */ public PayerAuthorisationUpdateRequest withBankAccountAccountNumber(String accountNumber) { if (bankAccount == null) { @@ -1052,8 +1086,9 @@ public PayerAuthorisationUpdateRequest withBankAccountAccountNumberEnding( } /** - * Account number suffix (only for bank accounts denominated in NZD) - see [local - * details](#local-bank-details-new-zealand) for more information. + * Account number suffix (only for bank accounts denominated in NZD) - see local + * details for more information. */ public PayerAuthorisationUpdateRequest withBankAccountAccountNumberSuffix( String accountNumberSuffix) { @@ -1066,8 +1101,9 @@ public PayerAuthorisationUpdateRequest withBankAccountAccountNumberSuffix( /** * 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. + * bank accounts in other currencies. See local + * details for more information. */ public PayerAuthorisationUpdateRequest withBankAccountAccountType( BankAccount.AccountType accountType) { @@ -1079,8 +1115,9 @@ public PayerAuthorisationUpdateRequest withBankAccountAccountType( } /** - * Bank code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Bank code - see local + * details for more information. Alternatively you can provide an iban. */ public PayerAuthorisationUpdateRequest withBankAccountBankCode(String bankCode) { if (bankAccount == null) { @@ -1091,8 +1128,9 @@ public PayerAuthorisationUpdateRequest withBankAccountBankCode(String bankCode) } /** - * Branch code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Branch code - see local + * details for more information. Alternatively you can provide an iban. */ public PayerAuthorisationUpdateRequest withBankAccountBranchCode(String branchCode) { if (bankAccount == null) { @@ -1103,9 +1141,10 @@ public PayerAuthorisationUpdateRequest withBankAccountBranchCode(String branchCo } /** - * [ISO 3166-1 alpha-2 - * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). - * Defaults to the country code of the `iban` if supplied, otherwise is required. + * ISO + * 3166-1 alpha-2 code. Defaults to the country code of the iban if + * supplied, otherwise is required. */ public PayerAuthorisationUpdateRequest withBankAccountCountryCode(String countryCode) { if (bankAccount == null) { @@ -1116,8 +1155,8 @@ public PayerAuthorisationUpdateRequest withBankAccountCountryCode(String country } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public PayerAuthorisationUpdateRequest withBankAccountCurrency(String currency) { if (bankAccount == null) { @@ -1128,9 +1167,12 @@ public PayerAuthorisationUpdateRequest withBankAccountCurrency(String currency) } /** - * International Bank Account Number. Alternatively you can provide [local - * details](#appendix-local-bank-details). IBANs are not accepted for Swedish bank accounts - * denominated in SEK - you must supply [local details](#local-bank-details-sweden). + * International Bank Account Number. Alternatively you can provide local + * details. IBANs are not accepted for Swedish bank accounts denominated in SEK - you + * must supply + * local + * details. */ public PayerAuthorisationUpdateRequest withBankAccountIban(String iban) { if (bankAccount == null) { @@ -1154,7 +1196,8 @@ public PayerAuthorisationUpdateRequest withBankAccountMetadata( } /** - * All details required for the creation of a [Customer](#core-endpoints-customers). + * All details required for the creation of a Customer. */ public PayerAuthorisationUpdateRequest withCustomer(Customer customer) { this.customer = customer; @@ -1206,10 +1249,11 @@ public PayerAuthorisationUpdateRequest withCustomerCity(String city) { } /** - * Customer's company name. Required unless a `given_name` and `family_name` are provided. - * For Canadian customers, the use of a `company_name` value will mean that any mandate - * created from this customer will be considered to be a "Business PAD" (otherwise, any - * mandate will be considered to be a "Personal PAD"). + * Customer's company name. Required unless a given_name and + * family_name are provided. For Canadian customers, the use of a + * company_name value will mean that any mandate created from this customer + * will be considered to be a "Business PAD" (otherwise, any mandate will be considered to + * be a "Personal PAD"). */ public PayerAuthorisationUpdateRequest withCustomerCompanyName(String companyName) { if (customer == null) { @@ -1220,8 +1264,9 @@ public PayerAuthorisationUpdateRequest withCustomerCompanyName(String companyNam } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public PayerAuthorisationUpdateRequest withCustomerCountryCode(String countryCode) { if (customer == null) { @@ -1257,7 +1302,7 @@ public PayerAuthorisationUpdateRequest withCustomerEmail(String email) { } /** - * Customer's surname. Required unless a `company_name` is provided. + * Customer's surname. Required unless a company_name is provided. */ public PayerAuthorisationUpdateRequest withCustomerFamilyName(String familyName) { if (customer == null) { @@ -1268,7 +1313,7 @@ public PayerAuthorisationUpdateRequest withCustomerFamilyName(String familyName) } /** - * Customer's first name. Required unless a `company_name` is provided. + * Customer's first name. Required unless a company_name is provided. */ public PayerAuthorisationUpdateRequest withCustomerGivenName(String givenName) { if (customer == null) { @@ -1279,9 +1324,8 @@ public PayerAuthorisationUpdateRequest withCustomerGivenName(String givenName) { } /** - * An [IETF Language Tag](https://tools.ietf.org/html/rfc5646), used for both language and - * regional variations of our product. - * + * An IETF Language Tag, used for both + * language and regional variations of our product. */ public PayerAuthorisationUpdateRequest withCustomerLocale(String locale) { if (customer == null) { @@ -1316,8 +1360,8 @@ public PayerAuthorisationUpdateRequest withCustomerPostalCode(String postalCode) /** * The customer's address region, county or department. For US customers a 2 letter - * [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state code is required (e.g. - * `CA` for California). + * ISO3166-2:US state code is + * required (e.g. CA for California). */ public PayerAuthorisationUpdateRequest withCustomerRegion(String region) { if (customer == null) { @@ -1342,7 +1386,8 @@ public PayerAuthorisationUpdateRequest withCustomerSwedishIdentityNumber( } /** - * All details required for the creation of a [Mandate](#core-endpoints-mandates). + * All details required for the creation of a Mandate. */ public PayerAuthorisationUpdateRequest withMandate(Mandate mandate) { this.mandate = mandate; @@ -1366,9 +1411,8 @@ public PayerAuthorisationUpdateRequest withMandateMetadata(Map m * the payer to whom the mandate belongs (i.e. as a result of their completion of a mandate * setup flow in their browser). * - * Not required for creating offline mandates where `authorisation_source` is set to - * telephone or paper. - * + * Not required for creating offline mandates where authorisation_source is set + * to telephone or paper. */ public PayerAuthorisationUpdateRequest withMandatePayerIpAddress(String payerIpAddress) { if (mandate == null) { @@ -1379,9 +1423,10 @@ public PayerAuthorisationUpdateRequest withMandatePayerIpAddress(String payerIpA } /** - * Unique reference. Different schemes have different length and [character - * set](#appendix-character-sets) requirements. GoCardless will generate a unique reference - * satisfying the different scheme requirements if this field is left blank. + * Unique reference. Different schemes have different length and character + * set requirements. GoCardless will generate a unique reference satisfying the + * different scheme requirements if this field is left blank. */ public PayerAuthorisationUpdateRequest withMandateReference(String reference) { if (mandate == null) { @@ -1457,8 +1502,9 @@ public static class BankAccount { * Name of the account holder, as known by the bank. The full name provided when the * customer is created is stored and is available via the API, but is transliterated, * upcased, and truncated to 18 characters in bank submissions. This field is required - * unless the request includes a [customer bank account - * token](#javascript-flow-customer-bank-account-tokens). + * unless the request includes a customer + * bank account token. */ public BankAccount withAccountHolderName(String accountHolderName) { this.accountHolderName = accountHolderName; @@ -1466,8 +1512,9 @@ public BankAccount withAccountHolderName(String accountHolderName) { } /** - * Bank account number - see [local details](#appendix-local-bank-details) for more - * information. Alternatively you can provide an `iban`. + * Bank account number - see local + * details for more information. Alternatively you can provide an iban. */ public BankAccount withAccountNumber(String accountNumber) { this.accountNumber = accountNumber; @@ -1484,8 +1531,9 @@ public BankAccount withAccountNumberEnding(String accountNumberEnding) { } /** - * Account number suffix (only for bank accounts denominated in NZD) - see [local - * details](#local-bank-details-new-zealand) for more information. + * Account number suffix (only for bank accounts denominated in NZD) - see local + * details for more information. */ public BankAccount withAccountNumberSuffix(String accountNumberSuffix) { this.accountNumberSuffix = accountNumberSuffix; @@ -1494,8 +1542,9 @@ public BankAccount withAccountNumberSuffix(String accountNumberSuffix) { /** * 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. + * for bank accounts in other currencies. See local + * details for more information. */ public BankAccount withAccountType(AccountType accountType) { this.accountType = accountType; @@ -1503,8 +1552,9 @@ public BankAccount withAccountType(AccountType accountType) { } /** - * Bank code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Bank code - see local + * details for more information. Alternatively you can provide an iban. */ public BankAccount withBankCode(String bankCode) { this.bankCode = bankCode; @@ -1512,8 +1562,9 @@ public BankAccount withBankCode(String bankCode) { } /** - * Branch code - see [local details](#appendix-local-bank-details) for more information. - * Alternatively you can provide an `iban`. + * Branch code - see local + * details for more information. Alternatively you can provide an iban. */ public BankAccount withBranchCode(String branchCode) { this.branchCode = branchCode; @@ -1521,9 +1572,10 @@ public BankAccount withBranchCode(String branchCode) { } /** - * [ISO 3166-1 alpha-2 - * code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements). - * Defaults to the country code of the `iban` if supplied, otherwise is required. + * ISO + * 3166-1 alpha-2 code. Defaults to the country code of the iban if + * supplied, otherwise is required. */ public BankAccount withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -1531,8 +1583,9 @@ public BankAccount withCountryCode(String countryCode) { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. - * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency + * code. Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are + * supported. */ public BankAccount withCurrency(String currency) { this.currency = currency; @@ -1540,10 +1593,12 @@ public BankAccount withCurrency(String currency) { } /** - * International Bank Account Number. Alternatively you can provide [local - * details](#appendix-local-bank-details). IBANs are not accepted for Swedish bank - * accounts denominated in SEK - you must supply [local - * details](#local-bank-details-sweden). + * International Bank Account Number. Alternatively you can provide local + * details. IBANs are not accepted for Swedish bank accounts denominated in SEK - + * you must supply local + * details. */ public BankAccount withIban(String iban) { this.iban = iban; @@ -1622,10 +1677,11 @@ public Customer withCity(String city) { } /** - * Customer's company name. Required unless a `given_name` and `family_name` are - * provided. For Canadian customers, the use of a `company_name` value will mean that - * any mandate created from this customer will be considered to be a "Business PAD" - * (otherwise, any mandate will be considered to be a "Personal PAD"). + * Customer's company name. Required unless a given_name and + * family_name are provided. For Canadian customers, the use of a + * company_name value will mean that any mandate created from this customer + * will be considered to be a "Business PAD" (otherwise, any mandate will be considered + * to be a "Personal PAD"). */ public Customer withCompanyName(String companyName) { this.companyName = companyName; @@ -1633,8 +1689,9 @@ public Customer withCompanyName(String companyName) { } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public Customer withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -1660,7 +1717,7 @@ public Customer withEmail(String email) { } /** - * Customer's surname. Required unless a `company_name` is provided. + * Customer's surname. Required unless a company_name is provided. */ public Customer withFamilyName(String familyName) { this.familyName = familyName; @@ -1668,7 +1725,7 @@ public Customer withFamilyName(String familyName) { } /** - * Customer's first name. Required unless a `company_name` is provided. + * Customer's first name. Required unless a company_name is provided. */ public Customer withGivenName(String givenName) { this.givenName = givenName; @@ -1676,9 +1733,8 @@ public Customer withGivenName(String givenName) { } /** - * An [IETF Language Tag](https://tools.ietf.org/html/rfc5646), used for both language - * and regional variations of our product. - * + * An IETF Language Tag, used for both + * language and regional variations of our product. */ public Customer withLocale(String locale) { this.locale = locale; @@ -1704,8 +1760,8 @@ public Customer withPostalCode(String postalCode) { /** * The customer's address region, county or department. For US customers a 2 letter - * [ISO3166-2:US](https://en.wikipedia.org/wiki/ISO_3166-2:US) state code is required - * (e.g. `CA` for California). + * ISO3166-2:US state code is + * required (e.g. CA for California). */ public Customer withRegion(String region) { this.region = region; @@ -1744,9 +1800,8 @@ public Mandate withMetadata(Map metadata) { * address of the payer to whom the mandate belongs (i.e. as a result of their * completion of a mandate setup flow in their browser). * - * Not required for creating offline mandates where `authorisation_source` is set to - * telephone or paper. - * + * Not required for creating offline mandates where authorisation_source is + * set to telephone or paper. */ public Mandate withPayerIpAddress(String payerIpAddress) { this.payerIpAddress = payerIpAddress; @@ -1754,9 +1809,10 @@ public Mandate withPayerIpAddress(String payerIpAddress) { } /** - * Unique reference. Different schemes have different length and [character - * set](#appendix-character-sets) requirements. GoCardless will generate a unique - * reference satisfying the different scheme requirements if this field is left blank. + * Unique reference. Different schemes have different length and character + * set requirements. GoCardless will generate a unique reference satisfying the + * different scheme requirements if this field is left blank. */ public Mandate withReference(String reference) { this.reference = reference; diff --git a/src/main/java/com/gocardless/services/PaymentAccountService.java b/src/main/java/com/gocardless/services/PaymentAccountService.java index 266edf4b..e8364051 100644 --- a/src/main/java/com/gocardless/services/PaymentAccountService.java +++ b/src/main/java/com/gocardless/services/PaymentAccountService.java @@ -10,8 +10,9 @@ /** * Service class for working with payment account resources. * - * Access the details of bank accounts provided for you by GoCardless that are used to fund - * [Outbound Payments](#core-endpoints-outbound-payments). + * Access the details of bank accounts provided for you by GoCardless that are used to fund Outbound + * Payments. */ public class PaymentAccountService { private final HttpClient httpClient; @@ -32,7 +33,9 @@ public PaymentAccountGetRequest get(String identity) { } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your payment accounts. + * Returns a cursor-paginated + * list of your payment accounts. */ public PaymentAccountListRequest> list() { return new PaymentAccountListRequest<>(httpClient, @@ -89,7 +92,9 @@ protected Class getResponseClass() { /** * Request class for {@link PaymentAccountService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your payment accounts. + * Returns a cursor-paginated + * list of your payment accounts. */ public static final class PaymentAccountListRequest extends ListRequest { /** diff --git a/src/main/java/com/gocardless/services/PaymentAccountTransactionService.java b/src/main/java/com/gocardless/services/PaymentAccountTransactionService.java index 5283f25a..898d1b7f 100644 --- a/src/main/java/com/gocardless/services/PaymentAccountTransactionService.java +++ b/src/main/java/com/gocardless/services/PaymentAccountTransactionService.java @@ -12,8 +12,9 @@ * Service class for working with payment account transaction resources. * * Payment account transactions represent movements of funds on a given payment account. The payment - * account is provisioned by GoCardless and is used to fund [outbound - * payments](#core-endpoints-outbound-payments). + * account is provisioned by GoCardless and is used to fund outbound + * payments. */ public class PaymentAccountTransactionService { private final HttpClient httpClient; diff --git a/src/main/java/com/gocardless/services/PaymentService.java b/src/main/java/com/gocardless/services/PaymentService.java index 7c841939..bbcfd309 100644 --- a/src/main/java/com/gocardless/services/PaymentService.java +++ b/src/main/java/com/gocardless/services/PaymentService.java @@ -12,12 +12,16 @@ /** * Service class for working with payment resources. * - * Payment objects represent payments from a [customer](#core-endpoints-customers) to a - * [creditor](#core-endpoints-creditors), taken against a Direct Debit - * [mandate](#core-endpoints-mandates). + * Payment objects represent payments from a + * customer + * to a + * creditor, + * taken against a Direct Debit + * mandate. * - * GoCardless will notify you via a [webhook](#appendix-webhooks) whenever the state of a payment - * changes. + * GoCardless will notify you via a + * webhook whenever + * the state of a payment changes. */ public class PaymentService { private final HttpClient httpClient; @@ -33,17 +37,20 @@ public PaymentService(HttpClient httpClient) { /** * Creates a new payment object. * - * This fails with a `mandate_is_inactive` error if the linked - * [mandate](#core-endpoints-mandates) is cancelled or has failed. Payments can be created - * against mandates with status of: `pending_customer_approval`, `pending_submission`, - * `submitted`, and `active`. + * This fails with a mandate_is_inactive error if the linked + * mandate + * is cancelled or has failed. Payments can be created against mandates with status of: + * pending_customer_approval, pending_submission, + * submitted, and active. */ public PaymentCreateRequest create() { return new PaymentCreateRequest(httpClient); } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your payments. + * Returns a cursor-paginated + * list of your payments. */ public PaymentListRequest> list() { return new PaymentListRequest<>(httpClient, ListRequest.pagingExecutor()); @@ -71,8 +78,8 @@ public PaymentUpdateRequest update(String identity) { * Cancels the payment if it has not already been submitted to the banks. Any metadata supplied * to this endpoint will be stored on the payment cancellation event it causes. * - * This will fail with a `cancellation_failed` error unless the payment's status is - * `pending_submission`. + * This will fail with a cancellation_failed error unless the payment's status is + * pending_submission. */ public PaymentCancelRequest cancel(String identity) { return new PaymentCancelRequest(httpClient, identity); @@ -80,12 +87,13 @@ public PaymentCancelRequest cancel(String identity) { /** * Retries a failed payment if the underlying mandate is active. You - * will receive a `resubmission_requested` webhook, but after that retrying the payment follows - * the same process as its initial creation, so you will receive a `submitted` webhook, followed - * by a `confirmed` or `failed` event. Any metadata supplied to this endpoint will be stored - * against the payment submission event it causes. + * will receive a resubmission_requested webhook, but after that retrying the + * payment follows the same process as its initial creation, so you will receive a + * submitted webhook, followed by a confirmed or failed + * event. Any metadata supplied to this endpoint will be stored against the payment submission + * event it causes. * - * This will return a `retry_failed` error if the payment has not failed. + * This will return a retry_failed error if the payment has not failed. * * Payments can be retried up to 3 times. */ @@ -98,10 +106,11 @@ public PaymentRetryRequest retry(String identity) { * * Creates a new payment object. * - * This fails with a `mandate_is_inactive` error if the linked - * [mandate](#core-endpoints-mandates) is cancelled or has failed. Payments can be created - * against mandates with status of: `pending_customer_approval`, `pending_submission`, - * `submitted`, and `active`. + * This fails with a mandate_is_inactive error if the linked + * mandate + * is cancelled or has failed. Payments can be created against mandates with status of: + * pending_customer_approval, pending_submission, + * submitted, and active. */ public static final class PaymentCreateRequest extends IdempotentPostRequest { private Integer amount; @@ -118,6 +127,13 @@ public static final class PaymentCreateRequest extends IdempotentPostRequestTransaction + * limits + * + * For Variable Recurring Payments (VRP), this must not exceed the mandate's + * max_amount_per_payment constraint. */ public PaymentCreateRequest withAmount(Integer amount) { this.amount = amount; @@ -135,9 +151,10 @@ public PaymentCreateRequest withAppFee(Integer appFee) { /** * A future date on which the payment should be collected. If not specified, the payment - * will be collected as soon as possible. If the value is before the - * [mandate](#core-endpoints-mandates)'s `next_possible_charge_date` creation will fail. If - * the value is not a working day it will be rolled forwards to the next available one. + * will be collected as soon as possible. If the value is before the mandate's + * next_possible_charge_date creation will fail. If the value is not a working + * day it will be rolled forwards to the next available one. */ public PaymentCreateRequest withChargeDate(String chargeDate) { this.chargeDate = chargeDate; @@ -145,8 +162,8 @@ public PaymentCreateRequest withChargeDate(String chargeDate) { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public PaymentCreateRequest withCurrency(Currency currency) { this.currency = currency; @@ -156,7 +173,9 @@ public PaymentCreateRequest withCurrency(Currency currency) { /** * A human-readable description of the payment. This will be included in the notification * email GoCardless sends to your customer if your organisation does not send its own - * notifications (see [compliance requirements](#appendix-compliance-requirements)). + * notifications (see compliance + * requirements). */ public PaymentCreateRequest withDescription(String description) { this.description = description; @@ -179,8 +198,9 @@ public PaymentCreateRequest withLinks(Links links) { } /** - * ID of the [mandate](#core-endpoints-mandates) against which this payment should be - * collected. + * ID of the mandate + * against which this payment should be collected. */ public PaymentCreateRequest withLinksMandate(String mandate) { if (links == null) { @@ -214,12 +234,13 @@ public PaymentCreateRequest withMetadata(String key, String value) { /** * Indicates how a Variable Recurring Payment (VRP) is initiated, by or on behalf of the * payer. + * *
    - *
  • `in_session`: The payer is actively participating in the payment creation + *
  • in_session: The payer is actively participating in the payment creation * session.
  • - *
  • `off_session`: The payer is not present during the transaction, and the payment is - * initiated by the merchant based on an established consent (e.g., a recurring subscription - * payment).
  • + *
  • off_session: The payer is not present during the transaction, and the + * payment is initiated by the merchant based on an established consent (e.g., a recurring + * subscription payment).
  • *
*/ public PaymentCreateRequest withPsuInteractionType(PsuInteractionType psuInteractionType) { @@ -229,25 +250,76 @@ public PaymentCreateRequest withPsuInteractionType(PsuInteractionType psuInterac /** * 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
- * Faster Payments - 18 characters
- * PAD - scheme doesn't offer references
- * PayTo - 18 characters
- * SEPA - 140 characters
+ * 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
  • + *
+ *
+ *
+ * Faster Payments + *
    + *
  • 18 characters
  • + *
+ *
+ *
+ * PAD + *
    + *
  • scheme doesn't offer references
  • + *
+ *
+ *
+ * PayTo + *
    + *
  • 18 characters
  • + *
+ *
+ *
+ * SEPA + *
    + *
  • 140 characters
  • + *
+ *
+ *
* Note that this reference must be unique (for each merchant) for the BECS scheme as it is * a scheme requirement. - *

+ *

* 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. + * GoCardless Plus, Pro or Enterprise packages. *

- *

+ *

* Restricted: You can not specify a payment reference for Faster Payments. *

*/ @@ -257,11 +329,12 @@ public PaymentCreateRequest withReference(String reference) { } /** - * On failure, automatically retry the payment using [intelligent - * retries](/success-plus/overview). Default is `false`. + * On failure, automatically retry the payment using + * intelligent retries. + * Default is false. *

* Important: To be able to use intelligent retries, Success+ needs to be - * enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus). + * enabled in GoCardless dashboard. *

*/ public PaymentCreateRequest withRetryIfPossible(Boolean retryIfPossible) { @@ -346,8 +419,9 @@ public static class Links { private String mandate; /** - * ID of the [mandate](#core-endpoints-mandates) against which this payment should be - * collected. + * ID of the mandate + * against which this payment should be collected. */ public Links withMandate(String mandate) { this.mandate = mandate; @@ -359,7 +433,9 @@ public Links withMandate(String mandate) { /** * Request class for {@link PaymentService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your payments. + * Returns a cursor-paginated + * list of your payments. */ public static final class PaymentListRequest extends ListRequest { private ChargeDate chargeDate; @@ -494,7 +570,7 @@ public PaymentListRequest withCreatedAtLte(String lte) { /** * ID of a creditor to filter payments by. If you pass this parameter, you cannot also pass - * `customer`. + * customer. */ public PaymentListRequest withCreditor(String creditor) { this.creditor = creditor; @@ -502,8 +578,8 @@ public PaymentListRequest withCreditor(String creditor) { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public PaymentListRequest withCurrency(Currency currency) { this.currency = currency; @@ -512,7 +588,7 @@ public PaymentListRequest withCurrency(Currency currency) { /** * ID of a customer to filter payments by. If you pass this parameter, you cannot also pass - * `creditor`. + * creditor. */ public PaymentListRequest withCustomer(String customer) { this.customer = customer; @@ -548,9 +624,10 @@ public PaymentListRequest withScheme(String scheme) { /** * The direction to sort in. One of: + * *
    - *
  • `asc`
  • - *
  • `desc`
  • + *
  • asc
  • + *
  • desc
  • *
*/ public PaymentListRequest withSortDirection(SortDirection sortDirection) { @@ -560,9 +637,10 @@ public PaymentListRequest withSortDirection(SortDirection sortDirection) { /** * Field by which to sort records. One of: + * *
    - *
  • `charge_date`
  • - *
  • `amount`
  • + *
  • charge_date
  • + *
  • amount
  • *
*/ public PaymentListRequest withSortField(SortField sortField) { @@ -572,20 +650,22 @@ public PaymentListRequest withSortField(SortField sortField) { /** * One of: + * *
    - *
  • `pending_customer_approval`: we're waiting for the customer to approve this - * payment
  • - *
  • `pending_submission`: the payment has been created, but not yet submitted to the - * banks
  • - *
  • `submitted`: the payment has been submitted to the banks
  • - *
  • `confirmed`: the payment has been confirmed as collected
  • - *
  • `paid_out`: the payment has been included in a [payout](#core-endpoints-payouts)
  • - *
  • `cancelled`: the payment has been cancelled
  • - *
  • `customer_approval_denied`: the customer has denied approval for the payment. You - * should contact the customer directly
  • - *
  • `failed`: the payment failed to be processed. Note that payments can fail after being - * confirmed if the failure message is sent late by the banks.
  • - *
  • `charged_back`: the payment has been charged back
  • + *
  • pending_customer_approval: we're waiting for the customer to approve + * this payment
  • + *
  • pending_submission: the payment has been created, but not yet submitted + * to the banks
  • + *
  • submitted: the payment has been submitted to the banks
  • + *
  • confirmed: the payment has been confirmed as collected
  • + *
  • paid_out: the payment has been included in a payout
  • + *
  • cancelled: the payment has been cancelled
  • + *
  • customer_approval_denied: the customer has denied approval for the + * payment. You should contact the customer directly
  • + *
  • failed: the payment failed to be processed. Note that payments can fail + * after being confirmed if the failure message is sent late by the banks.
  • + *
  • charged_back: the payment has been charged back
  • *
*/ public PaymentListRequest withStatus(Status status) { @@ -919,11 +999,12 @@ public PaymentUpdateRequest withMetadata(String key, String value) { } /** - * On failure, automatically retry the payment using [intelligent - * retries](/success-plus/overview). Default is `false`. + * On failure, automatically retry the payment using + * intelligent retries. + * Default is false. *

* Important: To be able to use intelligent retries, Success+ needs to be - * enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus). + * enabled in GoCardless dashboard. *

*/ public PaymentUpdateRequest withRetryIfPossible(Boolean retryIfPossible) { @@ -975,8 +1056,8 @@ protected boolean hasBody() { * Cancels the payment if it has not already been submitted to the banks. Any metadata supplied * to this endpoint will be stored on the payment cancellation event it causes. * - * This will fail with a `cancellation_failed` error unless the payment's status is - * `pending_submission`. + * This will fail with a cancellation_failed error unless the payment's status is + * pending_submission. */ public static final class PaymentCancelRequest extends PostRequest { @PathParam @@ -1051,12 +1132,13 @@ protected String getRequestEnvelope() { * Request class for {@link PaymentService#retry }. * * Retries a failed payment if the underlying mandate is active. You - * will receive a `resubmission_requested` webhook, but after that retrying the payment follows - * the same process as its initial creation, so you will receive a `submitted` webhook, followed - * by a `confirmed` or `failed` event. Any metadata supplied to this endpoint will be stored - * against the payment submission event it causes. + * will receive a resubmission_requested webhook, but after that retrying the + * payment follows the same process as its initial creation, so you will receive a + * submitted webhook, followed by a confirmed or failed + * event. Any metadata supplied to this endpoint will be stored against the payment submission + * event it causes. * - * This will return a `retry_failed` error if the payment has not failed. + * This will return a retry_failed error if the payment has not failed. * * Payments can be retried up to 3 times. */ @@ -1068,9 +1150,10 @@ public static final class PaymentRetryRequest extends PostRequest { /** * A future date on which the payment should be collected. If not specified, the payment - * will be collected as soon as possible. If the value is before the - * [mandate](#core-endpoints-mandates)'s `next_possible_charge_date` creation will fail. If - * the value is not a working day it will be rolled forwards to the next available one. + * will be collected as soon as possible. If the value is before the mandate's + * next_possible_charge_date creation will fail. If the value is not a working + * day it will be rolled forwards to the next available one. */ public PaymentRetryRequest withChargeDate(String chargeDate) { this.chargeDate = chargeDate; diff --git a/src/main/java/com/gocardless/services/PayoutItemService.java b/src/main/java/com/gocardless/services/PayoutItemService.java index 94ebcc44..ddf3c959 100644 --- a/src/main/java/com/gocardless/services/PayoutItemService.java +++ b/src/main/java/com/gocardless/services/PayoutItemService.java @@ -22,7 +22,6 @@ * The Payout Items API allows you to view, on a per-payout basis, the credit and debit items that * make up that payout's amount. Payout items can only be retrieved for payouts created in the last * 6 months. Requests for older payouts will return an HTTP status 410 Gone. - * */ public class PayoutItemService { private final HttpClient httpClient; @@ -36,11 +35,12 @@ public PayoutItemService(HttpClient httpClient) { } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of items in the payout. + * Returns a cursor-paginated + * list of items in the payout. * * This endpoint only serves requests for payouts created in the last 6 months. Requests * for older payouts will return an HTTP status 410 Gone. - * */ public PayoutItemListRequest> list() { return new PayoutItemListRequest<>(httpClient, ListRequest.pagingExecutor()); @@ -53,11 +53,12 @@ public PayoutItemListRequest> all() { /** * Request class for {@link PayoutItemService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of items in the payout. + * Returns a cursor-paginated + * list of items in the payout. * * This endpoint only serves requests for payouts created in the last 6 months. Requests * for older payouts will return an HTTP status 410 Gone. - * */ public static final class PayoutItemListRequest extends ListRequest { private Include2020TaxCutover include2020TaxCutover; diff --git a/src/main/java/com/gocardless/services/PayoutService.java b/src/main/java/com/gocardless/services/PayoutService.java index f297a9ac..59fe421a 100644 --- a/src/main/java/com/gocardless/services/PayoutService.java +++ b/src/main/java/com/gocardless/services/PayoutService.java @@ -12,9 +12,11 @@ /** * Service class for working with payout 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). All - * the payments in a payout will have been collected in the same currency. Payouts are created + * Payouts represent transfers from GoCardless to a + * creditor. + * Each payout contains the funds collected from one or many + * 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 PayoutService { @@ -29,7 +31,9 @@ public PayoutService(HttpClient httpClient) { } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your payouts. + * Returns a cursor-paginated + * list of your payouts. */ public PayoutListRequest> list() { return new PayoutListRequest<>(httpClient, ListRequest.pagingExecutor()); @@ -41,7 +45,9 @@ public PayoutListRequest> all() { /** * Retrieves the details of a single payout. For an example of how to reconcile the transactions - * in a payout, see [this guide](#events-reconciling-payouts-with-events). + * in a payout, see this + * guide. */ public PayoutGetRequest get(String identity) { return new PayoutGetRequest(httpClient, identity); @@ -57,7 +63,9 @@ public PayoutUpdateRequest update(String identity) { /** * Request class for {@link PayoutService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your payouts. + * Returns a cursor-paginated + * list of your payouts. */ public static final class PayoutListRequest extends ListRequest { private CreatedAt createdAt; @@ -151,8 +159,8 @@ public PayoutListRequest withCreditorBankAccount(String creditorBankAccount) } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public PayoutListRequest withCurrency(Currency currency) { this.currency = currency; @@ -169,8 +177,8 @@ public PayoutListRequest withLimit(Integer limit) { /** * 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. _Note:_ This should not be used for storing - * PII data. + * characters and values up to 500 characters. Note: This should not be used for + * storing PII data. */ public PayoutListRequest withMetadata(Map metadata) { this.metadata = metadata; @@ -179,8 +187,8 @@ public PayoutListRequest withMetadata(Map metadata) { /** * 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. _Note:_ This should not be used for storing - * PII data. + * characters and values up to 500 characters. Note: This should not be used for + * storing PII data. */ public PayoutListRequest withMetadata(String key, String value) { if (metadata == null) { @@ -208,12 +216,13 @@ public PayoutListRequest withReference(String reference) { /** * One of: + * *
    - *
  • `pending`: the payout has been created, but not yet sent to your bank or it is in the - * process of being exchanged through our FX provider.
  • - *
  • `paid`: the payout has been sent to the your bank. FX payouts will become `paid` - * after we emit the `fx_rate_confirmed` webhook.
  • - *
  • `bounced`: the payout bounced when sent, the payout can be retried.
  • + *
  • pending: the payout has been created, but not yet sent to your bank or + * it is in the process of being exchanged through our FX provider.
  • + *
  • paid: the payout has been sent to the your bank. FX payouts will become + * paid after we emit the fx_rate_confirmed webhook.
  • + *
  • bounced: the payout bounced when sent, the payout can be retried.
  • *
*/ public PayoutListRequest withStatus(Status status) { @@ -380,7 +389,9 @@ public Map getQueryParams() { * Request class for {@link PayoutService#get }. * * Retrieves the details of a single payout. For an example of how to reconcile the transactions - * in a payout, see [this guide](#events-reconciling-payouts-with-events). + * in a payout, see this + * guide. */ public static final class PayoutGetRequest extends GetRequest { @PathParam diff --git a/src/main/java/com/gocardless/services/RedirectFlowService.java b/src/main/java/com/gocardless/services/RedirectFlowService.java index 482c4432..c09caabc 100644 --- a/src/main/java/com/gocardless/services/RedirectFlowService.java +++ b/src/main/java/com/gocardless/services/RedirectFlowService.java @@ -12,35 +12,44 @@ * *

* Deprecated: Redirect Flows are legacy APIs and cannot be used by new - * integrators. The [Billing Request flow](#billing-requests) API should be used for your payment - * flows. + * integrators. The Billing + * Request flow API should be used for your payment flows. *

- * - * Redirect flows enable you to use GoCardless' [hosted payment - * pages](https://pay-sandbox.gocardless.com/AL000000AKFPFF) to set up mandates with your customers. - * These pages are fully compliant and have been translated into Danish, Dutch, French, German, - * Italian, Norwegian, Portuguese, Slovak, Spanish and Swedish. + * Redirect flows enable you to use GoCardless' + * hosted payment pages to set up + * mandates with your customers. These pages are fully compliant and have been translated into + * Danish, Dutch, French, German, Italian, Norwegian, Portuguese, Slovak, Spanish and Swedish. * * The overall flow is: * - * 1. You [create](#redirect-flows-create-a-redirect-flow) a redirect flow for your customer, and - * redirect them to the returned redirect url, e.g. `https://pay.gocardless.com/flow/RE123`. - * - * 2. Your customer supplies their name, email, address, and bank account details, and submits the - * form. This securely stores their details, and redirects them back to your `success_redirect_url` - * with `redirect_flow_id=RE123` in the querystring. - * - * 3. You [complete](#redirect-flows-complete-a-redirect-flow) the redirect flow, which creates a - * [customer](#core-endpoints-customers), [customer bank - * account](#core-endpoints-customer-bank-accounts), and [mandate](#core-endpoints-mandates), and - * returns the ID of the mandate. You may wish to create a - * [subscription](#core-endpoints-subscriptions) or [payment](#core-endpoints-payments) at this - * point. - * - * Once you have [completed](#redirect-flows-complete-a-redirect-flow) the redirect flow via the - * API, you should display a confirmation page to your customer, confirming that their Direct Debit - * has been set up. You can build your own page, or redirect to the one we provide in the - * `confirmation_url` attribute of the redirect flow. + *
    + *
  1. You create + * a redirect flow for your customer, and redirect them to the returned redirect url, e.g. + * https://pay.gocardless.com/flow/RE123.
  2. + *
  3. Your customer supplies their name, email, address, and bank account details, and submits the + * form. This securely stores their details, and redirects them back to your + * success_redirect_url with redirect_flow_id=RE123 in the + * querystring.
  4. + *
  5. You complete + * the redirect flow, which creates a + * customer, + * customer + * bank account, and + * mandate, + * and returns the ID of the mandate. You may wish to create a subscription + * or payment + * at this point.
  6. + *
+ * Once you have completed + * the redirect flow via the API, you should display a confirmation page to your customer, + * confirming that their Direct Debit has been set up. You can build your own page, or redirect to + * the one we provide in the confirmation_url attribute of the redirect flow. * * Redirect flows expire 30 minutes after they are first created. You cannot complete an expired * redirect flow. For an integrator this is shorter and they will expire after 10 minutes. @@ -72,14 +81,19 @@ public RedirectFlowGetRequest get(String identity) { } /** - * This creates a [customer](#core-endpoints-customers), [customer bank - * account](#core-endpoints-customer-bank-accounts), and [mandate](#core-endpoints-mandates) + * This creates a customer, + * customer + * bank account, and + * mandate * using the details supplied by your customer and returns the ID of the created mandate. * - * This will return a `redirect_flow_incomplete` error if your customer has not yet been - * redirected back to your site, and a `redirect_flow_already_completed` error if your - * integration has already completed this flow. It will return a `bad_request` error if the - * `session_token` differs to the one supplied when the redirect flow was created. + * This will return a redirect_flow_incomplete error if your customer has not yet + * been redirected back to your site, and a redirect_flow_already_completed error + * if your integration has already completed this flow. It will return a + * bad_request error if the session_token differs to the one supplied + * when the redirect flow was created. */ public RedirectFlowCompleteRequest complete(String identity) { return new RedirectFlowCompleteRequest(httpClient, identity); @@ -117,9 +131,10 @@ public RedirectFlowCreateRequest withLinks(Links links) { } /** - * The [creditor](#core-endpoints-creditors) for whom the mandate will be created. The - * `name` of the creditor will be displayed on the payment page. Required if your account - * manages multiple creditors. + * The creditor + * for whom the mandate will be created. The name of the creditor will be + * displayed on the payment page. Required if your account manages multiple creditors. */ public RedirectFlowCreateRequest withLinksCreditor(String creditor) { if (links == null) { @@ -131,8 +146,8 @@ public RedirectFlowCreateRequest withLinksCreditor(String creditor) { /** * 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. _Note:_ This should not be used for storing - * PII data. + * characters and values up to 500 characters. Note: This should not be used for + * storing PII data. */ public RedirectFlowCreateRequest withMetadata(Map metadata) { this.metadata = metadata; @@ -141,8 +156,8 @@ public RedirectFlowCreateRequest withMetadata(Map metadata) { /** * 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. _Note:_ This should not be used for storing - * PII data. + * characters and values up to 500 characters. Note: This should not be used for + * storing PII data. */ public RedirectFlowCreateRequest withMetadata(String key, String value) { if (metadata == null) { @@ -165,8 +180,9 @@ public RedirectFlowCreateRequest withPrefilledBankAccount( /** * Bank account type 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. + * accounts in other currencies. See local + * details for more information. */ public RedirectFlowCreateRequest withPrefilledBankAccountAccountType( PrefilledBankAccount.AccountType accountType) { @@ -233,8 +249,8 @@ public RedirectFlowCreateRequest withPrefilledCustomerCity(String city) { } /** - * Customer's company name. Company name should only be provided if `given_name` and - * `family_name` are null. + * Customer's company name. Company name should only be provided if given_name + * and family_name are null. */ public RedirectFlowCreateRequest withPrefilledCustomerCompanyName(String companyName) { if (prefilledCustomer == null) { @@ -245,8 +261,9 @@ public RedirectFlowCreateRequest withPrefilledCustomerCompanyName(String company } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public RedirectFlowCreateRequest withPrefilledCustomerCountryCode(String countryCode) { if (prefilledCustomer == null) { @@ -302,7 +319,7 @@ public RedirectFlowCreateRequest withPrefilledCustomerGivenName(String givenName } /** - * [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code. + * ISO 639-1 code. */ public RedirectFlowCreateRequest withPrefilledCustomerLanguage(String language) { if (prefilledCustomer == null) { @@ -380,7 +397,7 @@ public RedirectFlowCreateRequest withSessionToken(String sessionToken) { /** * The URL to redirect to upon successful mandate setup. You must use a URL beginning - * `https` in the live environment. + * https in the live environment. */ public RedirectFlowCreateRequest withSuccessRedirectUrl(String successRedirectUrl) { this.successRedirectUrl = successRedirectUrl; @@ -452,9 +469,10 @@ public static class Links { private String creditor; /** - * The [creditor](#core-endpoints-creditors) for whom the mandate will be created. The - * `name` of the creditor will be displayed on the payment page. Required if your - * account manages multiple creditors. + * The creditor + * for whom the mandate will be created. The name of the creditor will be + * displayed on the payment page. Required if your account manages multiple creditors. */ public Links withCreditor(String creditor) { this.creditor = creditor; @@ -467,8 +485,9 @@ public static class PrefilledBankAccount { /** * Bank account type 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. + * accounts in other currencies. See local + * details for more information. */ public PrefilledBankAccount withAccountType(AccountType accountType) { this.accountType = accountType; @@ -538,8 +557,8 @@ public PrefilledCustomer withCity(String city) { } /** - * Customer's company name. Company name should only be provided if `given_name` and - * `family_name` are null. + * Customer's company name. Company name should only be provided if + * given_name and family_name are null. */ public PrefilledCustomer withCompanyName(String companyName) { this.companyName = companyName; @@ -547,8 +566,9 @@ public PrefilledCustomer withCompanyName(String companyName) { } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public PrefilledCustomer withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -588,7 +608,7 @@ public PrefilledCustomer withGivenName(String givenName) { } /** - * [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code. + * ISO 639-1 code. */ public PrefilledCustomer withLanguage(String language) { this.language = language; @@ -675,14 +695,19 @@ protected Class getResponseClass() { /** * Request class for {@link RedirectFlowService#complete }. * - * This creates a [customer](#core-endpoints-customers), [customer bank - * account](#core-endpoints-customer-bank-accounts), and [mandate](#core-endpoints-mandates) + * This creates a customer, + * customer + * bank account, and + * mandate * using the details supplied by your customer and returns the ID of the created mandate. * - * This will return a `redirect_flow_incomplete` error if your customer has not yet been - * redirected back to your site, and a `redirect_flow_already_completed` error if your - * integration has already completed this flow. It will return a `bad_request` error if the - * `session_token` differs to the one supplied when the redirect flow was created. + * This will return a redirect_flow_incomplete error if your customer has not yet + * been redirected back to your site, and a redirect_flow_already_completed error + * if your integration has already completed this flow. It will return a + * bad_request error if the session_token differs to the one supplied + * when the redirect flow was created. */ public static final class RedirectFlowCompleteRequest extends PostRequest { @PathParam diff --git a/src/main/java/com/gocardless/services/RefundService.java b/src/main/java/com/gocardless/services/RefundService.java index 6f0c2efe..7bd7ba9e 100644 --- a/src/main/java/com/gocardless/services/RefundService.java +++ b/src/main/java/com/gocardless/services/RefundService.java @@ -12,11 +12,14 @@ /** * Service class for working with refund resources. * - * Refund objects represent (partial) refunds of a [payment](#core-endpoints-payments) back to the - * [customer](#core-endpoints-customers). + * Refund objects represent (partial) refunds of a + * payment + * back to the + * customer. * - * GoCardless will notify you via a [webhook](#appendix-webhooks) whenever a refund is created, and - * will update the `amount_refunded` property of the payment. + * GoCardless will notify you via a + * webhook whenever + * a refund is created, and will update the amount_refunded property of the payment. */ public class RefundService { private final HttpClient httpClient; @@ -35,20 +38,22 @@ public RefundService(HttpClient httpClient) { * This fails with: * - * - `total_amount_confirmation_invalid` if the confirmation amount doesn't match the total - * amount refunded for the payment. This safeguard is there to prevent two processes from - * creating refunds without awareness of each other. - * - * - `available_refund_amount_insufficient` if the creditor does not have sufficient balance for - * refunds available to cover the cost of the requested refund. - * + *
    + *
  • total_amount_confirmation_invalid if the confirmation amount doesn't match + * the total amount refunded for the payment. This safeguard is there to prevent two processes + * from creating refunds without awareness of each other.
  • + *
  • available_refund_amount_insufficient if the creditor does not have + * sufficient balance for refunds available to cover the cost of the requested refund.
  • + *
*/ public RefundCreateRequest create() { return new RefundCreateRequest(httpClient); } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your refunds. + * Returns a cursor-paginated + * list of your refunds. */ public RefundListRequest> list() { return new RefundListRequest<>(httpClient, ListRequest.pagingExecutor()); @@ -80,13 +85,13 @@ public RefundUpdateRequest update(String identity) { * This fails with: * - * - `total_amount_confirmation_invalid` if the confirmation amount doesn't match the total - * amount refunded for the payment. This safeguard is there to prevent two processes from - * creating refunds without awareness of each other. - * - * - `available_refund_amount_insufficient` if the creditor does not have sufficient balance for - * refunds available to cover the cost of the requested refund. - * + *
    + *
  • total_amount_confirmation_invalid if the confirmation amount doesn't match + * the total amount refunded for the payment. This safeguard is there to prevent two processes + * from creating refunds without awareness of each other.
  • + *
  • available_refund_amount_insufficient if the creditor does not have + * sufficient balance for refunds available to cover the cost of the requested refund.
  • + *
*/ public static final class RefundCreateRequest extends IdempotentPostRequest { private Integer amount; @@ -109,8 +114,10 @@ public RefundCreateRequest withLinks(Links links) { } /** - * ID of the [mandate](#core-endpoints-mandates) against which the refund is being made. - *
+ * ID of the mandate + * against which the refund is being made.
+ *
*

* Restricted: You must request access to Mandate Refunds by contacting * our support team. @@ -125,7 +132,9 @@ public RefundCreateRequest withLinksMandate(String mandate) { } /** - * ID of the [payment](#core-endpoints-payments) against which the refund is being made. + * ID of the payment + * against which the refund is being made. */ public RefundCreateRequest withLinksPayment(String payment) { if (links == null) { @@ -158,25 +167,76 @@ public RefundCreateRequest withMetadata(String key, String value) { /** * 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
- * Faster Payments - 18 characters
- * PAD - scheme doesn't offer references
- * PayTo - 18 characters
- * SEPA - 140 characters
+ * 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
  • + *
+ *
+ *
+ * Faster Payments + *
    + *
  • 18 characters
  • + *
+ *
+ *
+ * PAD + *
    + *
  • scheme doesn't offer references
  • + *
+ *
+ *
+ * PayTo + *
    + *
  • 18 characters
  • + *
+ *
+ *
+ * SEPA + *
    + *
  • 140 characters
  • + *
+ *
+ *
* Note that this reference must be unique (for each merchant) for the BECS scheme as it is * a scheme requirement. - *

+ *

* 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. + * GoCardless Plus, Pro or Enterprise packages. *

- *

+ *

* Restricted: You can not specify a payment reference for Faster Payments. *

*/ @@ -188,11 +248,14 @@ public RefundCreateRequest withReference(String reference) { /** * Total expected refunded amount in minor unit (e.g. pence/cents/öre). If there are other * partial refunds against this payment, this value should be the sum of the existing - * refunds plus the amount of the refund being created.
- * Must be supplied if `links[payment]` is present. + * refunds plus the amount of the refund being created.
+ *
+ * Must be supplied if links[payment] is present. + * *

- * It is possible to opt out of requiring `total_amount_confirmation`, please contact - * our support team for more information. + * It is possible to opt out of requiring total_amount_confirmation, please + * contact our support team for more + * information. *

*/ public RefundCreateRequest withTotalAmountConfirmation(Integer totalAmountConfirmation) { @@ -248,8 +311,10 @@ public static class Links { private String payment; /** - * ID of the [mandate](#core-endpoints-mandates) against which the refund is being made. - *
+ * ID of the mandate + * against which the refund is being made.
+ *
*

* Restricted: You must request access to Mandate Refunds by contacting * our support team. @@ -261,7 +326,9 @@ public Links withMandate(String mandate) { } /** - * ID of the [payment](#core-endpoints-payments) against which the refund is being made. + * ID of the payment + * against which the refund is being made. */ public Links withPayment(String payment) { this.payment = payment; @@ -273,7 +340,9 @@ public Links withPayment(String payment) { /** * Request class for {@link RefundService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your refunds. + * Returns a cursor-paginated + * list of your refunds. */ public static final class RefundListRequest extends ListRequest { private CreatedAt createdAt; @@ -373,9 +442,11 @@ public RefundListRequest withPayment(String payment) { /** * Whether a refund was issued against a mandate or a payment. One of: + * *

    - *
  • `payment`: default returns refunds created against payments only
  • - *
  • `mandate`: returns refunds created against mandates only
  • + *
  • payment: default returns refunds created against payments + * only
  • + *
  • mandate: returns refunds created against mandates only
  • *
*/ public RefundListRequest withRefundType(RefundType refundType) { diff --git a/src/main/java/com/gocardless/services/ScenarioSimulatorService.java b/src/main/java/com/gocardless/services/ScenarioSimulatorService.java index c1f85f8e..ae011b1f 100644 --- a/src/main/java/com/gocardless/services/ScenarioSimulatorService.java +++ b/src/main/java/com/gocardless/services/ScenarioSimulatorService.java @@ -47,8 +47,8 @@ public ScenarioSimulatorRunRequest withLinks(Links links) { /** * ID of the resource to run the simulation against. Must be same type of resource as the - * simulator that is being run. eg. Payment ID for `payment_failed`, Mandate ID for - * `mandate_activated` etc + * simulator that is being run. eg. Payment ID for payment_failed, Mandate ID + * for mandate_activated etc */ public ScenarioSimulatorRunRequest withLinksResource(String resource) { if (links == null) { @@ -105,8 +105,8 @@ public static class Links { /** * ID of the resource to run the simulation against. Must be same type of resource as - * the simulator that is being run. eg. Payment ID for `payment_failed`, Mandate ID for - * `mandate_activated` etc + * the simulator that is being run. eg. Payment ID for payment_failed, + * Mandate ID for mandate_activated etc */ public Links withResource(String resource) { this.resource = resource; diff --git a/src/main/java/com/gocardless/services/SchemeIdentifierService.java b/src/main/java/com/gocardless/services/SchemeIdentifierService.java index e169019c..63a392b3 100644 --- a/src/main/java/com/gocardless/services/SchemeIdentifierService.java +++ b/src/main/java/com/gocardless/services/SchemeIdentifierService.java @@ -1,349 +1,911 @@ + + + + + + + + + + + + + package com.gocardless.services; import com.gocardless.http.*; import com.gocardless.resources.SchemeIdentifier; +import com.google.common.base.Joiner; import com.google.common.collect.ImmutableMap; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; + +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; /** * Service class for working with schemeentifier resources. * - * This represents a scheme identifier (e.g. a SUN in Bacs or a CID in SEPA). Scheme identifiers are - * used to specify the beneficiary name that appears on customers' bank statements. - * + * This represents a scheme identifier (e.g. a SUN in Bacs or a CID in SEPA). Scheme identifiers are +* used to specify the beneficiary name that appears on customers' bank statements. */ public class SchemeIdentifierService { private final HttpClient httpClient; /** - * Constructor. Users of this library should have no need to call this - an instance of this - * class can be obtained by calling - * {@link com.gocardless.GoCardlessClient#schemeIdentifiers() }. + * Constructor. Users of this library should have no need to call this - an instance + * of this class can be obtained by calling + {@link com.gocardless.GoCardlessClient#schemeIdentifiers() }. */ public SchemeIdentifierService(HttpClient httpClient) { this.httpClient = httpClient; } - /** - * Creates a new scheme identifier. The scheme identifier status will be `pending` while - * GoCardless is processing the request. Once the scheme identifier is ready to be used the - * status will be updated to `active`. At this point, GoCardless will emit a scheme identifier - * activated event via webhook to notify you of this change. In Bacs, it will take up to five - * working days for a scheme identifier to become active. On other schemes, including SEPA, this - * happens instantly. - * - * #### Scheme identifier name validations - * - * The `name` field of a scheme identifier can contain alphanumeric characters, spaces and - * special characters. - * - * Its maximum length and the special characters it supports depend on the scheme: - * - * | __scheme__ | __maximum length__ | __special characters allowed__ | | :---------------- | - * :----------------- | :-------------------------------------------------- | | `bacs` | 18 - * characters | `/` `.` `&` `-` | | `sepa` | 70 characters | `/` `?` `:` `(` `)` `.` `,` `+` `&` - * `<` `>` `'` `"` | | `ach` | 16 characters | `/` `?` `:` `(` `)` `.` `,` `'` `+` `-` | | - * `faster_payments` | 18 characters | `/` `?` `:` `(` `)` `.` `,` `'` `+` `-` | - * - * The validation error that gets returned for an invalid name will contain a suggested name in - * the metadata that is guaranteed to pass name validations. - * - * You should ensure that the name you set matches the legal name or the trading name of the - * creditor, otherwise, there is an increased risk of chargeback. - * - */ - public SchemeIdentifierCreateRequest create() { - return new SchemeIdentifierCreateRequest(httpClient); - } - - /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your scheme identifiers. - */ - public SchemeIdentifierListRequest> list() { - return new SchemeIdentifierListRequest<>(httpClient, - ListRequest.pagingExecutor()); - } - - public SchemeIdentifierListRequest> all() { - return new SchemeIdentifierListRequest<>(httpClient, - ListRequest.iteratingExecutor()); - } - - /** - * Retrieves the details of an existing scheme identifier. - */ - public SchemeIdentifierGetRequest get(String identity) { - return new SchemeIdentifierGetRequest(httpClient, identity); - } - - /** - * Request class for {@link SchemeIdentifierService#create }. - * - * Creates a new scheme identifier. The scheme identifier status will be `pending` while - * GoCardless is processing the request. Once the scheme identifier is ready to be used the - * status will be updated to `active`. At this point, GoCardless will emit a scheme identifier - * activated event via webhook to notify you of this change. In Bacs, it will take up to five - * working days for a scheme identifier to become active. On other schemes, including SEPA, this - * happens instantly. - * - * #### Scheme identifier name validations - * - * The `name` field of a scheme identifier can contain alphanumeric characters, spaces and - * special characters. - * - * Its maximum length and the special characters it supports depend on the scheme: - * - * | __scheme__ | __maximum length__ | __special characters allowed__ | | :---------------- | - * :----------------- | :-------------------------------------------------- | | `bacs` | 18 - * characters | `/` `.` `&` `-` | | `sepa` | 70 characters | `/` `?` `:` `(` `)` `.` `,` `+` `&` - * `<` `>` `'` `"` | | `ach` | 16 characters | `/` `?` `:` `(` `)` `.` `,` `'` `+` `-` | | - * `faster_payments` | 18 characters | `/` `?` `:` `(` `)` `.` `,` `'` `+` `-` | - * - * The validation error that gets returned for an invalid name will contain a suggested name in - * the metadata that is guaranteed to pass name validations. - * - * You should ensure that the name you set matches the legal name or the trading name of the - * creditor, otherwise, there is an increased risk of chargeback. - * - */ - public static final class SchemeIdentifierCreateRequest - extends IdempotentPostRequest { - private Links links; - private String name; - private Scheme scheme; - - public SchemeIdentifierCreateRequest withLinks(Links links) { - this.links = links; - return this; - } - - /** - * required ID of the associated [creditor](#core-endpoints-creditors). - * - */ - public SchemeIdentifierCreateRequest withLinksCreditor(String creditor) { - if (links == null) { - links = new Links(); - } - links.withCreditor(creditor); - return this; - } - + + + /** - * The name which appears on customers' bank statements. This should usually be the - * merchant's trading name. + * Creates a new scheme identifier. The scheme identifier status will be pending while +* GoCardless is +* processing the request. Once the scheme identifier is ready to be used the status will be updated +* to active. +* At this point, GoCardless will emit a scheme identifier activated event via webhook to notify you +* of this change. +* In Bacs, it will take up to five working days for a scheme identifier to become active. On other +* schemes, including SEPA, +* this happens instantly. +* +*

Scheme identifier name validations

+* The name field of a scheme identifier can contain alphanumeric characters, spaces and +* special characters. +* +* Its maximum length and the special characters it supports depend on the scheme: +* +* | scheme | maximum length | special characters +* allowed | +* | :---------------- | :----------------- | :-------------------------------------------------- | +* | bacs | 18 characters | / . +* &
    +*
  • +*
| +* | sepa | 70 characters | / ? : +* ( ) . ,
    +*
  • +*
& <
+*
' " | +* | ach | 16 characters | / ? : +* ( ) . , '
    +*
  • +*
    +*
  • +*
| +* | faster_payments | 18 characters | / ? : +* ( ) . , '
    +*
  • +*
    +*
  • +*
| +* +* The validation error that gets returned for an invalid name will contain a suggested name +* in the metadata that is guaranteed to pass name validations. +* +* You should ensure that the name you set matches the legal name or the trading name of +* the creditor, otherwise, there is an increased risk of chargeback. */ - public SchemeIdentifierCreateRequest withName(String name) { - this.name = name; - return this; + public SchemeIdentifierCreateRequest + + create() { + return new SchemeIdentifierCreateRequest + + (httpClient + + + + ); } + + + + /** - * The scheme which this scheme identifier applies to. + * Returns a cursor-paginated +* list of your scheme identifiers. */ - public SchemeIdentifierCreateRequest withScheme(Scheme scheme) { - this.scheme = scheme; - return this; - } - - public SchemeIdentifierCreateRequest withIdempotencyKey(String idempotencyKey) { - super.setIdempotencyKey(idempotencyKey); - return this; - } - - @Override - protected GetRequest handleConflict(HttpClient httpClient, String id) { - SchemeIdentifierGetRequest request = new SchemeIdentifierGetRequest(httpClient, id); - for (Map.Entry header : this.getCustomHeaders().entrySet()) { - request = request.withHeader(header.getKey(), header.getValue()); - } - return request; - } - - private SchemeIdentifierCreateRequest(HttpClient httpClient) { - super(httpClient); - } - - public SchemeIdentifierCreateRequest withHeader(String headerName, String headerValue) { - this.addHeader(headerName, headerValue); - return this; - } - - @Override - protected String getPathTemplate() { - return "scheme_identifiers"; - } - - @Override - protected String getEnvelope() { - return "scheme_identifiers"; - } - - @Override - protected Class getResponseClass() { - return SchemeIdentifier.class; - } - - @Override - protected boolean hasBody() { - return true; - } - - public enum Scheme { - @SerializedName("ach") - ACH, @SerializedName("autogiro") - AUTOGIRO, @SerializedName("bacs") - BACS, @SerializedName("becs") - BECS, @SerializedName("becs_nz") - BECS_NZ, @SerializedName("betalingsservice") - BETALINGSSERVICE, @SerializedName("faster_payments") - FASTER_PAYMENTS, @SerializedName("pad") - PAD, @SerializedName("pay_to") - PAY_TO, @SerializedName("sepa") - SEPA, @SerializedName("sepa_credit_transfer") - SEPA_CREDIT_TRANSFER, @SerializedName("sepa_instant_credit_transfer") - SEPA_INSTANT_CREDIT_TRANSFER, @SerializedName("unknown") - UNKNOWN; - - @Override - public String toString() { - return name().toLowerCase(); - } + public SchemeIdentifierListRequest + + > + + list() { + return new SchemeIdentifierListRequest + + <> + + (httpClient + + , ListRequest.pagingExecutor() + + + + ); } - public static class Links { - private String creditor; + + public SchemeIdentifierListRequest> all() { + return new SchemeIdentifierListRequest<>(httpClient, ListRequest.iteratingExecutor() - /** - * required ID of the associated [creditor](#core-endpoints-creditors). - * - */ - public Links withCreditor(String creditor) { - this.creditor = creditor; - return this; + + ); } - } - } - - /** - * Request class for {@link SchemeIdentifierService#list }. - * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your scheme identifiers. - */ - public static final class SchemeIdentifierListRequest - extends ListRequest { - private String creditor; - + + + + /** - * Cursor pointing to the start of the desired set. + * Retrieves the details of an existing scheme identifier. */ - public SchemeIdentifierListRequest withAfter(String after) { - setAfter(after); - return this; + public SchemeIdentifierGetRequest + + get(String identity) { + return new SchemeIdentifierGetRequest + + (httpClient + + + + , identity + + ); } - /** - * Cursor pointing to the end of the desired set. - */ - public SchemeIdentifierListRequest withBefore(String before) { - setBefore(before); - return this; - } - - /** - * Unique identifier, beginning with "CR". - */ - public SchemeIdentifierListRequest withCreditor(String creditor) { - this.creditor = creditor; - return this; - } + + + + + /** - * Number of records to return. + * Request class for {@link SchemeIdentifierService#create }. + * + * Creates a new scheme identifier. The scheme identifier status will be pending while +* GoCardless is +* processing the request. Once the scheme identifier is ready to be used the status will be updated +* to active. +* At this point, GoCardless will emit a scheme identifier activated event via webhook to notify you +* of this change. +* In Bacs, it will take up to five working days for a scheme identifier to become active. On other +* schemes, including SEPA, +* this happens instantly. +* +*

Scheme identifier name validations

+* The name field of a scheme identifier can contain alphanumeric characters, spaces and +* special characters. +* +* Its maximum length and the special characters it supports depend on the scheme: +* +* | scheme | maximum length | special characters +* allowed | +* | :---------------- | :----------------- | :-------------------------------------------------- | +* | bacs | 18 characters | / . +* &
    +*
  • +*
| +* | sepa | 70 characters | / ? : +* ( ) . ,
    +*
  • +*
& <
+*
' " | +* | ach | 16 characters | / ? : +* ( ) . , '
    +*
  • +*
    +*
  • +*
| +* | faster_payments | 18 characters | / ? : +* ( ) . , '
    +*
  • +*
    +*
  • +*
| +* +* The validation error that gets returned for an invalid name will contain a suggested name +* in the metadata that is guaranteed to pass name validations. +* +* You should ensure that the name you set matches the legal name or the trading name of +* the creditor, otherwise, there is an increased risk of chargeback. */ - public SchemeIdentifierListRequest withLimit(Integer limit) { - setLimit(limit); - return this; - } - - private SchemeIdentifierListRequest(HttpClient httpClient, - ListRequestExecutor executor) { - super(httpClient, executor); - } + public static final class SchemeIdentifierCreateRequest + + extends + + IdempotentPostRequest + { + + + + + + + private + + Links + + links; + + + + + private + + String + + name; + + + + + private + + Scheme + + scheme; + + + + + + + + public + SchemeIdentifierCreateRequest + + withLinks( + + Links + + links) { + + this.links = links; + + + return this; + } + + + + + + + /** + * required ID of the associated creditor. + */ + + public + SchemeIdentifierCreateRequest + + withLinksCreditor( + + + String + + creditor + ) { + if (links == null) { + links = new + + Links + +(); + } + + links.withCreditor(creditor); + return this; + } + + + + + + + + /** + * The name which appears on customers' bank statements. This should usually be the merchant's +* trading name. + */ + + public + SchemeIdentifierCreateRequest + + withName( + + String + + name) { + + this.name = name; + + + return this; + } + + + + + + + /** + * The scheme which this scheme identifier applies to. + */ + + public + SchemeIdentifierCreateRequest + + withScheme( + + Scheme + + scheme) { + + this.scheme = scheme; + + + return this; + } + + + + + + + + + + + + public + SchemeIdentifierCreateRequest + withIdempotencyKey(String idempotencyKey) { + super.setIdempotencyKey(idempotencyKey); + return this; + } + + @Override + protected GetRequest handleConflict(HttpClient httpClient, String id) { + SchemeIdentifierGetRequest request = new SchemeIdentifierGetRequest(httpClient, id); + + for (Map.Entry header : this.getCustomHeaders().entrySet()) { + request = request.withHeader(header.getKey(), header.getValue()); + } + + return request; + } + + + + + + private SchemeIdentifierCreateRequest(HttpClient httpClient + + + ) { + + + super(httpClient); + + + + } + + public + SchemeIdentifierCreateRequest + withHeader(String headerName, String headerValue) { + this.addHeader(headerName, headerValue); + return this; + } + + + + + + @Override + protected String getPathTemplate() { + return "scheme_identifiers"; + } + + @Override + protected String getEnvelope() { + return "scheme_identifiers"; + } + + + @Override + protected Class getResponseClass() { + return SchemeIdentifier.class; + } + + + + + + @Override + protected boolean hasBody() { + return true; + } + + + + + + + + + + + + + + + + + + + public enum Scheme { + + @SerializedName("ach") ACH + + ,@SerializedName("autogiro") AUTOGIRO + + ,@SerializedName("bacs") BACS + + ,@SerializedName("becs") BECS + + ,@SerializedName("becs_nz") BECS_NZ + + ,@SerializedName("betalingsservice") BETALINGSSERVICE + + ,@SerializedName("faster_payments") FASTER_PAYMENTS + + ,@SerializedName("pad") PAD + + ,@SerializedName("pay_to") PAY_TO + + ,@SerializedName("sepa") SEPA + + ,@SerializedName("sepa_credit_transfer") SEPA_CREDIT_TRANSFER + + ,@SerializedName("sepa_instant_credit_transfer") SEPA_INSTANT_CREDIT_TRANSFER + + , @SerializedName("unknown") UNKNOWN; - public SchemeIdentifierListRequest withHeader(String headerName, String headerValue) { - this.addHeader(headerName, headerValue); - return this; + @Override + public String toString() { + + return name().toLowerCase(); + } + } - @Override - protected Map getQueryParams() { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.putAll(super.getQueryParams()); - if (creditor != null) { - params.put("creditor", creditor); + + + + + + + + + + + + + + + + + + + public static class Links { + + + private + + String + + creditor; + + + + + + /** + * required ID of the associated creditor. + */ + + public Links withCreditor( + + String + + creditor) { + this.creditor = creditor; + return this; } - return params.build(); - } + - @Override - protected String getPathTemplate() { - return "scheme_identifiers"; - } + - @Override - protected String getEnvelope() { - return "scheme_identifiers"; - } + + + + + + - @Override - protected TypeToken> getTypeToken() { - return new TypeToken>() {}; - } } - /** - * Request class for {@link SchemeIdentifierService#get }. - * - * Retrieves the details of an existing scheme identifier. - */ - public static final class SchemeIdentifierGetRequest extends GetRequest { - @PathParam - private final String identity; + - private SchemeIdentifierGetRequest(HttpClient httpClient, String identity) { - super(httpClient); - this.identity = identity; - } + + + - public SchemeIdentifierGetRequest withHeader(String headerName, String headerValue) { - this.addHeader(headerName, headerValue); - return this; - } + + + - @Override - protected Map getPathParams() { - ImmutableMap.Builder params = ImmutableMap.builder(); - params.put("identity", identity); - return params.build(); - } - - @Override - protected String getPathTemplate() { - return "scheme_identifiers/:identity"; + + + } - - @Override - protected String getEnvelope() { - return "scheme_identifiers"; + + + + /** + * Request class for {@link SchemeIdentifierService#list }. + * + * Returns a cursor-paginated +* list of your scheme identifiers. + */ + public static final class SchemeIdentifierListRequest + + + + extends + + ListRequest + { + + + + + + + + + + + + + private + + String + + creditor; + + + + + + + + + + + /** + * Cursor pointing to the start of the desired set. + */ + + public + SchemeIdentifierListRequest + + withAfter( + + String + + after) { + + setAfter(after); + + + return this; + } + + + + + + + /** + * Cursor pointing to the end of the desired set. + */ + + public + SchemeIdentifierListRequest + + withBefore( + + String + + before) { + + setBefore(before); + + + return this; + } + + + + + + + /** + * Unique identifier, beginning with "CR". + */ + + public + SchemeIdentifierListRequest + + withCreditor( + + String + + creditor) { + + this.creditor = creditor; + + + return this; + } + + + + + + + /** + * Number of records to return. + */ + + public + SchemeIdentifierListRequest + + withLimit( + + Integer + + limit) { + + setLimit(limit); + + + return this; + } + + + + + + + + private SchemeIdentifierListRequest(HttpClient httpClient + + , ListRequestExecutor executor + + + ) { + + + super(httpClient, executor); + + + + } + + public + SchemeIdentifierListRequest + withHeader(String headerName, String headerValue) { + this.addHeader(headerName, headerValue); + return this; + } + + + + + + @Override + protected Map getQueryParams() { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.putAll(super.getQueryParams()); + + + + + + + + + + + if (creditor != null) { + + params.put("creditor", creditor); + + } + + + + + + + return params.build(); + } + + + + @Override + protected String getPathTemplate() { + return "scheme_identifiers"; + } + + @Override + protected String getEnvelope() { + return "scheme_identifiers"; + } + + + @Override + protected TypeToken> getTypeToken() { + return new TypeToken>() {}; + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } - - @Override - protected Class getResponseClass() { - return SchemeIdentifier.class; + + + + /** + * Request class for {@link SchemeIdentifierService#get }. + * + * Retrieves the details of an existing scheme identifier. + */ + public static final class SchemeIdentifierGetRequest + + extends + + GetRequest + { + + @PathParam + private final String identity; + + + + + private SchemeIdentifierGetRequest(HttpClient httpClient + + + , String identity + + ) { + + + super(httpClient); + + + + + this.identity = identity; + + } + + public + SchemeIdentifierGetRequest + withHeader(String headerName, String headerValue) { + this.addHeader(headerName, headerValue); + return this; + } + + + @Override + protected Map getPathParams() { + ImmutableMap.Builder params = ImmutableMap.builder(); + + + params.put("identity", identity); + + + return params.build(); + } + + + + + + + @Override + protected String getPathTemplate() { + return "scheme_identifiers/:identity"; + } + + @Override + protected String getEnvelope() { + return "scheme_identifiers"; + } + + + @Override + protected Class getResponseClass() { + return SchemeIdentifier.class; + } + + + + + + + + + } - } + } diff --git a/src/main/java/com/gocardless/services/SubscriptionService.java b/src/main/java/com/gocardless/services/SubscriptionService.java index cef96c9f..323335eb 100644 --- a/src/main/java/com/gocardless/services/SubscriptionService.java +++ b/src/main/java/com/gocardless/services/SubscriptionService.java @@ -14,39 +14,48 @@ /** * Service class for working with subscription resources. * - * Subscriptions create [payments](#core-endpoints-payments) according to a schedule. + * Subscriptions create + * payments + * according to a schedule. * - * ### Recurrence Rules + *

Recurrence Rules

The following rules apply when specifying recurrence: * - * The following rules apply when specifying recurrence: - * - * - If `day_of_month` and `start_date` are not provided `start_date` will be the - * [mandate](#core-endpoints-mandates)'s `next_possible_charge_date` and the subscription will then - * recur based on the `interval` & `interval_unit` - If `month` or `day_of_month` are present the - * following validations apply: - * - * | __interval_unit__ | __month__ | __day_of_month__ | | :---------------- | - * :--------------------------------------------- | :----------------------------------------- | | - * yearly | optional (required if `day_of_month` provided) | optional (invalid if `month` not - * provided) | | monthly | invalid | optional | | weekly | invalid | invalid | + *
    + *
  • If day_of_month and start_date are not provided + * start_date will be the + * mandate's + * next_possible_charge_date and the subscription will then recur based on the + * interval & interval_unit
  • + *
  • If month or day_of_month are present the following validations + * apply:
  • + *
+ * | interval_unit | month | day_of_month | | + * :---------------- | :--------------------------------------------- | + * :----------------------------------------- | | yearly | optional (required if + * day_of_month provided) | optional (invalid if month not provided) | | + * monthly | invalid | optional | | weekly | invalid | invalid | * * Examples: * - * | __interval_unit__ | __interval__ | __month__ | __day_of_month__ | valid? | | :---------------- - * | :----------- | :-------- | :--------------- | - * :------------------------------------------------- | | yearly | 1 | january | -1 | valid | | - * monthly | 6 | | | valid | | monthly | 6 | | 12 | valid | | weekly | 2 | | | valid | | yearly | 1 - * | march | | invalid - missing `day_of_month` | | yearly | 1 | | 2 | invalid - missing `month` | | - * monthly | 6 | august | 12 | invalid - `month` must be blank | | weekly | 2 | october | 10 | - * invalid - `month` and `day_of_month` must be blank | - * - * ### Rolling dates + * | interval_unit | interval | month | + * day_of_month | valid? | | :---------------- | :----------- | :-------- | + * :--------------- | :------------------------------------------------- | | yearly | 1 | january | + * -1 | valid | | monthly | 6 | | | valid | | monthly | 6 | | 12 | valid | | weekly | 2 | | | valid + * | | yearly | 1 | march | | invalid - missing day_of_month | | yearly | 1 | | 2 | + * invalid - missing month | | monthly | 6 | august | 12 | invalid - month + * must be blank | | weekly | 2 | october | 10 | invalid - month and + * day_of_month must be blank | * - * When a charge date falls on a non-business day, one of two things will happen: + *

Rolling dates

When a charge date falls on a non-business day, one of two things will + * happen: * - * - if the recurrence rule specified `-1` as the `day_of_month`, the charge date will be rolled - * __backwards__ to the previous business day (i.e., the last working day of the month). - otherwise - * the charge date will be rolled __forwards__ to the next business day. + *
    + *
  • if the recurrence rule specified -1 as the day_of_month, the charge + * date will be rolled backwards to the previous business day (i.e., the last + * working day of the month).
  • + *
  • otherwise the charge date will be rolled forwards to the next business + * day.
  • + *
*/ public class SubscriptionService { private final HttpClient httpClient; @@ -67,9 +76,10 @@ public SubscriptionCreateRequest create() { } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your subscriptions. Please - * note if the subscriptions are related to customers who have been removed, they will not be - * shown in the response. + * Returns a cursor-paginated + * list of your subscriptions. Please note if the subscriptions are related to customers who + * have been removed, they will not be shown in the response. */ public SubscriptionListRequest> list() { return new SubscriptionListRequest<>(httpClient, @@ -93,25 +103,21 @@ public SubscriptionGetRequest get(String identity) { * * This fails with: * - * - `validation_failed` if invalid data is provided when attempting to update a subscription. - * - * - `subscription_not_active` if the subscription is no longer active. - * - * - `subscription_already_ended` if the subscription has taken all payments. - * - * - `mandate_payments_require_approval` if the amount is being changed and the mandate requires - * approval. - * - * - `number_of_subscription_amendments_exceeded` error if the subscription amount has already - * been changed 10 times. - * - * - `forbidden` if the amount is being changed, and the subscription was created by an app and - * you are not authenticated as that app, or if the subscription was not created by an app and - * you are authenticated as an app - * - * - `resource_created_by_another_app` if the app fee is being changed, and the subscription was - * created by an app other than the app you are authenticated as - * + *
    + *
  • validation_failed if invalid data is provided when attempting to update a + * subscription.
  • + *
  • subscription_not_active if the subscription is no longer active.
  • + *
  • subscription_already_ended if the subscription has taken all payments.
  • + *
  • mandate_payments_require_approval if the amount is being changed and the + * mandate requires approval.
  • + *
  • number_of_subscription_amendments_exceeded error if the subscription amount + * has already been changed 10 times.
  • + *
  • forbidden if the amount is being changed, and the subscription was created + * by an app and you are not authenticated as that app, or if the subscription was not created + * by an app and you are authenticated as an app
  • + *
  • resource_created_by_another_app if the app fee is being changed, and the + * subscription was created by an app other than the app you are authenticated as
  • + *
*/ public SubscriptionUpdateRequest update(String identity) { return new SubscriptionUpdateRequest(httpClient, identity); @@ -121,35 +127,36 @@ public SubscriptionUpdateRequest update(String identity) { * Pause a subscription object. No payments will be created until it is resumed. * * This can only be used when a subscription is collecting a fixed number of payments (created - * using `count`), when they continue forever (created without `count` or `end_date`) or the - * subscription is already paused for a number of cycles. + * using count), when they continue forever (created without count or + * end_date) or the subscription is already paused for a number of cycles. * - * When `pause_cycles` is omitted the subscription is paused until the [resume - * endpoint](#subscriptions-resume-a-subscription) is called. If the subscription is collecting - * a fixed number of payments, `end_date` will be set to `null`. When paused indefinitely, - * `upcoming_payments` will be empty. + * When pause_cycles is omitted the subscription is paused until the resume + * endpoint is called. If the subscription is collecting a fixed number of payments, + * end_date will be set to null. When paused indefinitely, + * upcoming_payments will be empty. * - * When `pause_cycles` is provided the subscription will be paused for the number of cycles - * requested. If the subscription is collecting a fixed number of payments, `end_date` will be - * set to a new value. When paused for a number of cycles, `upcoming_payments` will still - * contain the upcoming charge dates. + * When pause_cycles is provided the subscription will be paused for the number of + * cycles requested. If the subscription is collecting a fixed number of payments, + * end_date will be set to a new value. When paused for a number of cycles, + * upcoming_payments will still contain the upcoming charge dates. * * This fails with: * - * - `forbidden` if the subscription was created by an app and you are not authenticated as that - * app, or if the subscription was not created by an app and you are authenticated as an app - * - * - `validation_failed` if invalid data is provided when attempting to pause a subscription. - * - * - `subscription_paused_cannot_update_cycles` if the subscription is already paused for a - * number of cycles and the request provides a value for `pause_cycle`. - * - * - `subscription_cannot_be_paused` if the subscription cannot be paused. - * - * - `subscription_already_ended` if the subscription has taken all payments. - * - * - `pause_cycles_must_be_greater_than_or_equal_to` if the provided value for `pause_cycles` - * cannot be satisfied. + *
    + *
  • forbidden if the subscription was created by an app and you are not + * authenticated as that app, or if the subscription was not created by an app and you are + * authenticated as an app
  • + *
  • validation_failed if invalid data is provided when attempting to pause a + * subscription.
  • + *
  • subscription_paused_cannot_update_cycles if the subscription is already + * paused for a number of cycles and the request provides a value for + * pause_cycle.
  • + *
  • subscription_cannot_be_paused if the subscription cannot be paused.
  • + *
  • subscription_already_ended if the subscription has taken all payments.
  • + *
  • pause_cycles_must_be_greater_than_or_equal_to if the provided value for + * pause_cycles cannot be satisfied.
  • + *
*/ public SubscriptionPauseRequest pause(String identity) { return new SubscriptionPauseRequest(httpClient, identity); @@ -157,18 +164,19 @@ public SubscriptionPauseRequest pause(String identity) { /** * Resume a subscription object. Payments will start to be created again based on the - * subscriptions recurrence rules. The `charge_date` on the next payment will be the same as the - * subscriptions `earliest_charge_date_after_resume` + * subscriptions recurrence rules. The charge_date on the next payment will be the + * same as the subscriptions earliest_charge_date_after_resume * * This fails with: * - * - `forbidden` if the subscription was created by an app and you are not authenticated as that - * app, or if the subscription was not created by an app and you are authenticated as an app - * - * - `validation_failed` if invalid data is provided when attempting to resume a subscription. - * - * - `subscription_not_paused` if the subscription is not paused. - * + *
    + *
  • forbidden if the subscription was created by an app and you are not + * authenticated as that app, or if the subscription was not created by an app and you are + * authenticated as an app
  • + *
  • validation_failed if invalid data is provided when attempting to resume a + * subscription.
  • + *
  • subscription_not_paused if the subscription is not paused.
  • + *
*/ public SubscriptionResumeRequest resume(String identity) { return new SubscriptionResumeRequest(httpClient, identity); @@ -235,8 +243,8 @@ public SubscriptionCreateRequest withCount(Integer count) { } /** - * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently - * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. + * ISO 4217 currency code. + * Currently "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported. */ public SubscriptionCreateRequest withCurrency(String currency) { this.currency = currency; @@ -244,8 +252,11 @@ public SubscriptionCreateRequest withCurrency(String currency) { } /** - * As per RFC 2445. The day of the month to charge customers on. `1`-`28` or `-1` to - * indicate the last day of the month. + * As per RFC 2445. The day of the month to charge customers on. 1 + *
    + *
  • + *
+ * 28 or -1 to indicate the last day of the month. */ public SubscriptionCreateRequest withDayOfMonth(Integer dayOfMonth) { this.dayOfMonth = dayOfMonth; @@ -253,12 +264,15 @@ public SubscriptionCreateRequest withDayOfMonth(Integer dayOfMonth) { } /** - * Date on or after which no further payments should be created.
- * If this field is blank and `count` is not specified, the subscription will continue - * forever.
+ * Date on or after which no further payments should be created.
+ *
+ * If this field is blank and count is not specified, the subscription will + * continue forever.
+ *
+ * *

* Deprecated: This field will be removed in a future API version. Use - * `count` to specify a number of payments instead. + * count to specify a number of payments instead. *

*/ public SubscriptionCreateRequest withEndDate(String endDate) { @@ -267,8 +281,9 @@ public SubscriptionCreateRequest withEndDate(String endDate) { } /** - * Number of `interval_units` between customer charge dates. Must be greater than or equal - * to `1`. Must result in at least one charge date per year. Defaults to `1`. + * Number of interval_units between customer charge dates. Must be greater than + * or equal to 1. Must result in at least one charge date per year. Defaults to + * 1. */ public SubscriptionCreateRequest withInterval(Integer interval) { this.interval = interval; @@ -276,7 +291,8 @@ public SubscriptionCreateRequest withInterval(Integer interval) { } /** - * The unit of time between customer charge dates. One of `weekly`, `monthly` or `yearly`. + * The unit of time between customer charge dates. One of weekly, + * monthly or yearly. */ public SubscriptionCreateRequest withIntervalUnit(IntervalUnit intervalUnit) { this.intervalUnit = intervalUnit; @@ -289,8 +305,9 @@ public SubscriptionCreateRequest withLinks(Links links) { } /** - * ID of the associated [mandate](#core-endpoints-mandates) which the subscription will - * create payments against. + * ID of the associated mandate + * which the subscription will create payments against. */ public SubscriptionCreateRequest withLinksMandate(String mandate) { if (links == null) { @@ -323,8 +340,7 @@ public SubscriptionCreateRequest withMetadata(String key, String value) { /** * Name of the month on which to charge a customer. Must be lowercase. Only applies when the - * interval_unit is `yearly`. - * + * interval_unit is yearly. */ public SubscriptionCreateRequest withMonth(Month month) { this.month = month; @@ -342,8 +358,11 @@ public SubscriptionCreateRequest withName(String name) { /** * An optional payment reference. This will be set as the reference on each payment created - * and will appear on your customer's bank statement. See the documentation for the [create - * payment endpoint](#payments-create-a-payment) for more details.
+ * and will appear on your customer's bank statement. See the documentation for the create + * payment endpoint for more details.
+ *
+ * *

* Restricted: You need your own Service User Number to specify a payment * reference for Bacs payments. @@ -355,11 +374,12 @@ public SubscriptionCreateRequest withPaymentReference(String paymentReference) { } /** - * On failure, automatically retry payments using [intelligent - * retries](/success-plus/overview). Default is `false`. + * On failure, automatically retry payments using + * intelligent retries. + * Default is false. *

* Important: To be able to use intelligent retries, Success+ needs to be - * enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus). + * enabled in GoCardless dashboard. *

*/ public SubscriptionCreateRequest withRetryIfPossible(Boolean retryIfPossible) { @@ -368,11 +388,12 @@ public SubscriptionCreateRequest withRetryIfPossible(Boolean retryIfPossible) { } /** - * The date on which the first payment should be charged. Must be on or after the - * [mandate](#core-endpoints-mandates)'s `next_possible_charge_date`. When left blank and - * `month` or `day_of_month` are provided, this will be set to the date of the first - * payment. If created without `month` or `day_of_month` this will be set as the mandate's - * `next_possible_charge_date` + * The date on which the first payment should be charged. Must be on or after the mandate's + * next_possible_charge_date. When left blank and month or + * day_of_month are provided, this will be set to the date of the first + * payment. If created without month or day_of_month this will be + * set as the mandate's next_possible_charge_date */ public SubscriptionCreateRequest withStartDate(String startDate) { this.startDate = startDate; @@ -461,8 +482,9 @@ public static class Links { private String mandate; /** - * ID of the associated [mandate](#core-endpoints-mandates) which the subscription will - * create payments against. + * ID of the associated mandate + * which the subscription will create payments against. */ public Links withMandate(String mandate) { this.mandate = mandate; @@ -474,9 +496,10 @@ public Links withMandate(String mandate) { /** * Request class for {@link SubscriptionService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your subscriptions. Please - * note if the subscriptions are related to customers who have been removed, they will not be - * shown in the response. + * Returns a cursor-paginated + * list of your subscriptions. Please note if the subscriptions are related to customers who + * have been removed, they will not be shown in the response. */ public static final class SubscriptionListRequest extends ListRequest { private CreatedAt createdAt; @@ -576,13 +599,14 @@ public SubscriptionListRequest withMandate(String mandate) { /** * Upto 5 of: + * *
    - *
  • `pending_customer_approval`
  • - *
  • `customer_approval_denied`
  • - *
  • `active`
  • - *
  • `finished`
  • - *
  • `cancelled`
  • - *
  • `paused`
  • + *
  • pending_customer_approval
  • + *
  • customer_approval_denied
  • + *
  • active
  • + *
  • finished
  • + *
  • cancelled
  • + *
  • paused
  • *
* Omit entirely to include subscriptions in all states. */ @@ -593,13 +617,14 @@ public SubscriptionListRequest withStatus(List status) { /** * Upto 5 of: + * *
    - *
  • `pending_customer_approval`
  • - *
  • `customer_approval_denied`
  • - *
  • `active`
  • - *
  • `finished`
  • - *
  • `cancelled`
  • - *
  • `paused`
  • + *
  • pending_customer_approval
  • + *
  • customer_approval_denied
  • + *
  • active
  • + *
  • finished
  • + *
  • cancelled
  • + *
  • paused
  • *
* Omit entirely to include subscriptions in all states. */ @@ -761,25 +786,21 @@ protected Class getResponseClass() { * * This fails with: * - * - `validation_failed` if invalid data is provided when attempting to update a subscription. - * - * - `subscription_not_active` if the subscription is no longer active. - * - * - `subscription_already_ended` if the subscription has taken all payments. - * - * - `mandate_payments_require_approval` if the amount is being changed and the mandate requires - * approval. - * - * - `number_of_subscription_amendments_exceeded` error if the subscription amount has already - * been changed 10 times. - * - * - `forbidden` if the amount is being changed, and the subscription was created by an app and - * you are not authenticated as that app, or if the subscription was not created by an app and - * you are authenticated as an app - * - * - `resource_created_by_another_app` if the app fee is being changed, and the subscription was - * created by an app other than the app you are authenticated as - * + *
    + *
  • validation_failed if invalid data is provided when attempting to update a + * subscription.
  • + *
  • subscription_not_active if the subscription is no longer active.
  • + *
  • subscription_already_ended if the subscription has taken all payments.
  • + *
  • mandate_payments_require_approval if the amount is being changed and the + * mandate requires approval.
  • + *
  • number_of_subscription_amendments_exceeded error if the subscription amount + * has already been changed 10 times.
  • + *
  • forbidden if the amount is being changed, and the subscription was created + * by an app and you are not authenticated as that app, or if the subscription was not created + * by an app and you are authenticated as an app
  • + *
  • resource_created_by_another_app if the app fee is being changed, and the + * subscription was created by an app other than the app you are authenticated as
  • + *
*/ public static final class SubscriptionUpdateRequest extends PutRequest { @PathParam @@ -841,8 +862,11 @@ public SubscriptionUpdateRequest withName(String name) { /** * An optional payment reference. This will be set as the reference on each payment created - * and will appear on your customer's bank statement. See the documentation for the [create - * payment endpoint](#payments-create-a-payment) for more details.
+ * and will appear on your customer's bank statement. See the documentation for the create + * payment endpoint for more details.
+ *
+ * *

* Restricted: You need your own Service User Number to specify a payment * reference for Bacs payments. @@ -854,11 +878,12 @@ public SubscriptionUpdateRequest withPaymentReference(String paymentReference) { } /** - * On failure, automatically retry payments using [intelligent - * retries](/success-plus/overview). Default is `false`. + * On failure, automatically retry payments using + * intelligent retries. + * Default is false. *

* Important: To be able to use intelligent retries, Success+ needs to be - * enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus). + * enabled in GoCardless dashboard. *

*/ public SubscriptionUpdateRequest withRetryIfPossible(Boolean retryIfPossible) { @@ -910,35 +935,36 @@ protected boolean hasBody() { * Pause a subscription object. No payments will be created until it is resumed. * * This can only be used when a subscription is collecting a fixed number of payments (created - * using `count`), when they continue forever (created without `count` or `end_date`) or the - * subscription is already paused for a number of cycles. + * using count), when they continue forever (created without count or + * end_date) or the subscription is already paused for a number of cycles. * - * When `pause_cycles` is omitted the subscription is paused until the [resume - * endpoint](#subscriptions-resume-a-subscription) is called. If the subscription is collecting - * a fixed number of payments, `end_date` will be set to `null`. When paused indefinitely, - * `upcoming_payments` will be empty. + * When pause_cycles is omitted the subscription is paused until the resume + * endpoint is called. If the subscription is collecting a fixed number of payments, + * end_date will be set to null. When paused indefinitely, + * upcoming_payments will be empty. * - * When `pause_cycles` is provided the subscription will be paused for the number of cycles - * requested. If the subscription is collecting a fixed number of payments, `end_date` will be - * set to a new value. When paused for a number of cycles, `upcoming_payments` will still - * contain the upcoming charge dates. + * When pause_cycles is provided the subscription will be paused for the number of + * cycles requested. If the subscription is collecting a fixed number of payments, + * end_date will be set to a new value. When paused for a number of cycles, + * upcoming_payments will still contain the upcoming charge dates. * * This fails with: * - * - `forbidden` if the subscription was created by an app and you are not authenticated as that - * app, or if the subscription was not created by an app and you are authenticated as an app - * - * - `validation_failed` if invalid data is provided when attempting to pause a subscription. - * - * - `subscription_paused_cannot_update_cycles` if the subscription is already paused for a - * number of cycles and the request provides a value for `pause_cycle`. - * - * - `subscription_cannot_be_paused` if the subscription cannot be paused. - * - * - `subscription_already_ended` if the subscription has taken all payments. - * - * - `pause_cycles_must_be_greater_than_or_equal_to` if the provided value for `pause_cycles` - * cannot be satisfied. + *
    + *
  • forbidden if the subscription was created by an app and you are not + * authenticated as that app, or if the subscription was not created by an app and you are + * authenticated as an app
  • + *
  • validation_failed if invalid data is provided when attempting to pause a + * subscription.
  • + *
  • subscription_paused_cannot_update_cycles if the subscription is already + * paused for a number of cycles and the request provides a value for + * pause_cycle.
  • + *
  • subscription_cannot_be_paused if the subscription cannot be paused.
  • + *
  • subscription_already_ended if the subscription has taken all payments.
  • + *
  • pause_cycles_must_be_greater_than_or_equal_to if the provided value for + * pause_cycles cannot be satisfied.
  • + *
*/ public static final class SubscriptionPauseRequest extends PostRequest { @PathParam @@ -968,12 +994,15 @@ public SubscriptionPauseRequest withMetadata(String key, String value) { } /** - * The number of cycles to pause a subscription for. A cycle is one duration of `interval` - * and `interval_unit`. This should be a non zero positive value. For AUD subscriptions with - * `interval_unit: weekly` the minimum value varies between `3` & `4` because of the - * [mandatory minimum waiting period](#subscriptions-resume-a-subscription). For NZD - * subscriptions with `interval_unit: weekly` the minimum value is `2` because of the - * [mandatory minimum waiting period](#subscriptions-resume-a-subscription). + * The number of cycles to pause a subscription for. A cycle is one duration of + * interval and interval_unit. This should be a non zero positive + * value. For AUD subscriptions with interval_unit: weekly the minimum value + * varies between 3 & 4 because of the mandatory + * minimum waiting period. For NZD subscriptions with interval_unit: weekly + * the minimum value is 2 because of the mandatory + * minimum waiting period. */ public SubscriptionPauseRequest withPauseCycles(Integer pauseCycles) { this.pauseCycles = pauseCycles; @@ -1027,18 +1056,19 @@ protected String getRequestEnvelope() { * Request class for {@link SubscriptionService#resume }. * * Resume a subscription object. Payments will start to be created again based on the - * subscriptions recurrence rules. The `charge_date` on the next payment will be the same as the - * subscriptions `earliest_charge_date_after_resume` + * subscriptions recurrence rules. The charge_date on the next payment will be the + * same as the subscriptions earliest_charge_date_after_resume * * This fails with: * - * - `forbidden` if the subscription was created by an app and you are not authenticated as that - * app, or if the subscription was not created by an app and you are authenticated as an app - * - * - `validation_failed` if invalid data is provided when attempting to resume a subscription. - * - * - `subscription_not_paused` if the subscription is not paused. - * + *
    + *
  • forbidden if the subscription was created by an app and you are not + * authenticated as that app, or if the subscription was not created by an app and you are + * authenticated as an app
  • + *
  • validation_failed if invalid data is provided when attempting to resume a + * subscription.
  • + *
  • subscription_not_paused if the subscription is not paused.
  • + *
*/ public static final class SubscriptionResumeRequest extends PostRequest { @PathParam diff --git a/src/main/java/com/gocardless/services/TaxRateService.java b/src/main/java/com/gocardless/services/TaxRateService.java index 8e1222c4..2b11f72e 100644 --- a/src/main/java/com/gocardless/services/TaxRateService.java +++ b/src/main/java/com/gocardless/services/TaxRateService.java @@ -12,7 +12,9 @@ * * Tax rates from tax authority. * - * We also maintain a [static list of the tax rates for each jurisdiction](#appendix-tax-rates). + * We also maintain a + * static list of the + * tax rates for each jurisdiction. */ public class TaxRateService { private final HttpClient httpClient; @@ -26,7 +28,9 @@ public TaxRateService(HttpClient httpClient) { } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of all tax rates. + * Returns a cursor-paginated + * list of all tax rates. */ public TaxRateListRequest> list() { return new TaxRateListRequest<>(httpClient, ListRequest.pagingExecutor()); @@ -46,7 +50,9 @@ public TaxRateGetRequest get(String identity) { /** * Request class for {@link TaxRateService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of all tax rates. + * Returns a cursor-paginated + * list of all tax rates. */ public static final class TaxRateListRequest extends ListRequest { private String jurisdiction; diff --git a/src/main/java/com/gocardless/services/VerificationDetailService.java b/src/main/java/com/gocardless/services/VerificationDetailService.java index 859f6a82..280bc7c7 100644 --- a/src/main/java/com/gocardless/services/VerificationDetailService.java +++ b/src/main/java/com/gocardless/services/VerificationDetailService.java @@ -15,8 +15,9 @@ * *

* Restricted: These endpoints are restricted to customers who want to collect - * their merchant's verification details and pass them to GoCardless via our API. Please [get in - * touch](mailto:help@gocardless.com) if you wish to enable this feature on your account. + * their merchant's verification details and pass them to GoCardless via our API. Please + * get in touch if you wish to enable this feature on your + * account. *

*/ public class VerificationDetailService { @@ -142,7 +143,8 @@ public VerificationDetailCreateRequest withLinks(Links links) { } /** - * ID of the associated [creditor](#core-endpoints-creditors). + * ID of the associated creditor. */ public VerificationDetailCreateRequest withLinksCreditor(String creditor) { if (links == null) { @@ -215,8 +217,9 @@ public Directors withCity(String city) { } /** - * [ISO 3166-1 alpha-2 - * code.](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) + * ISO + * 3166-1 alpha-2 code. */ public Directors withCountryCode(String countryCode) { this.countryCode = countryCode; @@ -268,7 +271,8 @@ public static class Links { private String creditor; /** - * ID of the associated [creditor](#core-endpoints-creditors). + * ID of the associated creditor. */ public Links withCreditor(String creditor) { this.creditor = creditor; diff --git a/src/main/java/com/gocardless/services/WebhookService.java b/src/main/java/com/gocardless/services/WebhookService.java index 8198a920..cad9bb68 100644 --- a/src/main/java/com/gocardless/services/WebhookService.java +++ b/src/main/java/com/gocardless/services/WebhookService.java @@ -24,7 +24,9 @@ public WebhookService(HttpClient httpClient) { } /** - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your webhooks. + * Returns a cursor-paginated + * list of your webhooks. */ public WebhookListRequest> list() { return new WebhookListRequest<>(httpClient, ListRequest.pagingExecutor()); @@ -51,7 +53,9 @@ public WebhookRetryRequest retry(String identity) { /** * Request class for {@link WebhookService#list }. * - * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your webhooks. + * Returns a cursor-paginated + * list of your webhooks. */ public static final class WebhookListRequest extends ListRequest { private CreatedAt createdAt; diff --git a/src/test/java/com/gocardless/code_samples/CustomerNotificationsHandleCodeSampleTest.java b/src/test/java/com/gocardless/code_samples/CustomerNotificationsHandleCodeSampleTest.java index 041f19ef..55422809 100644 --- a/src/test/java/com/gocardless/code_samples/CustomerNotificationsHandleCodeSampleTest.java +++ b/src/test/java/com/gocardless/code_samples/CustomerNotificationsHandleCodeSampleTest.java @@ -46,7 +46,7 @@ public void testHandleCodeSample() throws Exception { System.setOut(new PrintStream(new ByteArrayOutputStream())); try { CustomerNotification customerNotification = - client.customerNotifications().handle("PCN123").execute(); + client.customerNotifications().handle("EV1D18JEXAMPLE").execute(); } finally { System.setOut(originalOut); }