getMetadata() {
return metadata;
}
diff --git a/src/main/java/com/gocardless/resources/PayoutItem.java b/src/main/java/com/gocardless/resources/PayoutItem.java
index 65ac36f7..5aa875d8 100644
--- a/src/main/java/com/gocardless/resources/PayoutItem.java
+++ b/src/main/java/com/gocardless/resources/PayoutItem.java
@@ -98,7 +98,8 @@ public enum Type {
GOCARDLESS_FEE, @SerializedName("app_fee")
APP_FEE, @SerializedName("revenue_share")
REVENUE_SHARE, @SerializedName("surcharge_fee")
- SURCHARGE_FEE, @SerializedName("unknown")
+ SURCHARGE_FEE, @SerializedName("refund_funds_returned")
+ REFUND_FUNDS_RETURNED, @SerializedName("unknown")
UNKNOWN
}
diff --git a/src/main/java/com/gocardless/resources/RedirectFlow.java b/src/main/java/com/gocardless/resources/RedirectFlow.java
index b23a2e8d..b65b7fe3 100644
--- a/src/main/java/com/gocardless/resources/RedirectFlow.java
+++ b/src/main/java/com/gocardless/resources/RedirectFlow.java
@@ -7,9 +7,9 @@
* Represents a redirect flow resource returned from the API.
*
*
- * Deprecated: Redirect Flows are our legacy APIs for setting up mandates and will
- * no longer be supported in the future. We strongly recommend using the [Billing Request
- * flow](#billing-requests) instead.
+ * 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.
*
*
* Redirect flows enable you to use GoCardless' [hosted payment
@@ -52,7 +52,7 @@ private RedirectFlow() {
private String id;
private Links links;
private String mandateReference;
- private Map metadata;
+ private Map metadata;
private String redirectUrl;
private Scheme scheme;
private String sessionToken;
@@ -108,7 +108,7 @@ public String getMandateReference() {
* characters and values up to 500 characters. _Note:_ This should not be used for storing PII
* data.
*/
- public Map getMetadata() {
+ public Map getMetadata() {
return metadata;
}
diff --git a/src/main/java/com/gocardless/resources/Refund.java b/src/main/java/com/gocardless/resources/Refund.java
index ab1f6c02..0b37fc0b 100644
--- a/src/main/java/com/gocardless/resources/Refund.java
+++ b/src/main/java/com/gocardless/resources/Refund.java
@@ -23,7 +23,7 @@ private Refund() {
private Fx fx;
private String id;
private Links links;
- private Map metadata;
+ private Map metadata;
private String reference;
private Status status;
@@ -68,7 +68,7 @@ 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.
*/
- public Map getMetadata() {
+ public Map getMetadata() {
return metadata;
}
diff --git a/src/main/java/com/gocardless/resources/ScenarioSimulator.java b/src/main/java/com/gocardless/resources/ScenarioSimulator.java
index 878d9273..f9025be8 100644
--- a/src/main/java/com/gocardless/resources/ScenarioSimulator.java
+++ b/src/main/java/com/gocardless/resources/ScenarioSimulator.java
@@ -86,7 +86,7 @@ private ScenarioSimulator() {
* `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, SEPA and Autogiro mandates.
+ * `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.
diff --git a/src/main/java/com/gocardless/resources/Subscription.java b/src/main/java/com/gocardless/resources/Subscription.java
index 5789245f..f5e15536 100644
--- a/src/main/java/com/gocardless/resources/Subscription.java
+++ b/src/main/java/com/gocardless/resources/Subscription.java
@@ -13,10 +13,10 @@
*
* The following rules apply when specifying recurrence:
*
- * - The first payment must be charged within 1 year. - 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:
+ * - 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__ | | :---------------- |
* :--------------------------------------------- | :----------------------------------------- | |
@@ -40,7 +40,6 @@
* - 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() {
@@ -59,9 +58,10 @@ private Subscription() {
private Integer interval;
private IntervalUnit intervalUnit;
private Links links;
- private Map metadata;
+ private Map metadata;
private Month month;
private String name;
+ private Boolean parentPlanPaused;
private String paymentReference;
private Boolean retryIfPossible;
private String startDate;
@@ -166,7 +166,7 @@ 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.
*/
- public Map getMetadata() {
+ public Map getMetadata() {
return metadata;
}
@@ -187,6 +187,13 @@ public String getName() {
return name;
}
+ /**
+ * Whether the parent plan of this subscription is paused.
+ */
+ public Boolean getParentPlanPaused() {
+ return parentPlanPaused;
+ }
+
/**
* 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
diff --git a/src/main/java/com/gocardless/resources/TransferredMandate.java b/src/main/java/com/gocardless/resources/TransferredMandate.java
new file mode 100644
index 00000000..f548272e
--- /dev/null
+++ b/src/main/java/com/gocardless/resources/TransferredMandate.java
@@ -0,0 +1,67 @@
+package com.gocardless.resources;
+
+/**
+ * Represents a transferred mandate resource returned from the API.
+ *
+ * Mandates that have been transferred using Current Account Switch Service
+ */
+public class TransferredMandate {
+ private TransferredMandate() {
+ // blank to prevent instantiation
+ }
+
+ private String encryptedCustomerBankDetails;
+ private String encryptedDecryptionKey;
+ private Links links;
+ private String publicKeyId;
+
+ /**
+ * Encrypted customer bank account details, containing: `iban`, `account_holder_name`,
+ * `swift_bank_code`, `swift_branch_code`, `swift_account_number`
+ */
+ public String getEncryptedCustomerBankDetails() {
+ return encryptedCustomerBankDetails;
+ }
+
+ /**
+ * Random AES-256 key used to encrypt bank account details, itself encrypted with your public
+ * key.
+ */
+ public String getEncryptedDecryptionKey() {
+ return encryptedDecryptionKey;
+ }
+
+ public Links getLinks() {
+ return links;
+ }
+
+ /**
+ * The ID of an RSA-2048 public key, from your JWKS, used to encrypt the AES key.
+ */
+ public String getPublicKeyId() {
+ return publicKeyId;
+ }
+
+ public static class Links {
+ private Links() {
+ // blank to prevent instantiation
+ }
+
+ private String customerBankAccount;
+ private String mandate;
+
+ /**
+ * The ID of the updated [customer_bank_account](#core-endpoints-customer-bank-accounts)
+ */
+ public String getCustomerBankAccount() {
+ return customerBankAccount;
+ }
+
+ /**
+ * The ID of the transferred mandate
+ */
+ public String getMandate() {
+ return mandate;
+ }
+ }
+}
diff --git a/src/main/java/com/gocardless/resources/Webhook.java b/src/main/java/com/gocardless/resources/Webhook.java
index 73531d26..afd77989 100644
--- a/src/main/java/com/gocardless/resources/Webhook.java
+++ b/src/main/java/com/gocardless/resources/Webhook.java
@@ -16,11 +16,11 @@ private Webhook() {
private String id;
private Boolean isTest;
private String requestBody;
- private Map requestHeaders;
+ private Map requestHeaders;
private String responseBody;
private Boolean responseBodyTruncated;
private Integer responseCode;
- private Map responseHeaders;
+ private Map responseHeaders;
private Boolean responseHeadersContentTruncated;
private Boolean responseHeadersCountTruncated;
private Boolean successful;
@@ -57,7 +57,7 @@ public String getRequestBody() {
/**
* The request headers sent with the webhook
*/
- public Map getRequestHeaders() {
+ public Map getRequestHeaders() {
return requestHeaders;
}
@@ -85,7 +85,7 @@ public Integer getResponseCode() {
/**
* The headers sent with the response from the webhook URL
*/
- public Map getResponseHeaders() {
+ public Map getResponseHeaders() {
return responseHeaders;
}
diff --git a/src/main/java/com/gocardless/services/BankAuthorisationService.java b/src/main/java/com/gocardless/services/BankAuthorisationService.java
index db4e7391..f99fdc57 100644
--- a/src/main/java/com/gocardless/services/BankAuthorisationService.java
+++ b/src/main/java/com/gocardless/services/BankAuthorisationService.java
@@ -47,18 +47,9 @@ public BankAuthorisationGetRequest get(String identity) {
*/
public static final class BankAuthorisationCreateRequest
extends IdempotentPostRequest {
- private String authorisationType;
private Links links;
private String redirectUri;
- /**
- * Type of authorisation, can be either 'mandate' or 'payment'.
- */
- public BankAuthorisationCreateRequest withAuthorisationType(String authorisationType) {
- this.authorisationType = authorisationType;
- return this;
- }
-
public BankAuthorisationCreateRequest withLinks(Links links) {
this.links = links;
return this;
diff --git a/src/main/java/com/gocardless/services/BankDetailsLookupService.java b/src/main/java/com/gocardless/services/BankDetailsLookupService.java
index e681e975..f6336246 100644
--- a/src/main/java/com/gocardless/services/BankDetailsLookupService.java
+++ b/src/main/java/com/gocardless/services/BankDetailsLookupService.java
@@ -24,6 +24,10 @@ public BankDetailsLookupService(HttpClient httpClient) {
* Performs a bank details lookup. As part of the lookup, a modulus check and reachability check
* are performed.
*
+ * For UK-based bank accounts, where an account holder name is provided (and an account number,
+ * 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
@@ -50,6 +54,10 @@ public BankDetailsLookupCreateRequest create() {
* Performs a bank details lookup. As part of the lookup, a modulus check and reachability check
* are performed.
*
+ * For UK-based bank accounts, where an account holder name is provided (and an account number,
+ * 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
@@ -68,12 +76,22 @@ public BankDetailsLookupCreateRequest create() {
*/
public static final class BankDetailsLookupCreateRequest
extends PostRequest {
+ private String accountHolderName;
private String accountNumber;
private String bankCode;
private String branchCode;
private String countryCode;
private String iban;
+ /**
+ * The account holder name associated with the account number (if available). If provided
+ * and the country code is GB, a payer name verification will be performed.
+ */
+ public BankDetailsLookupCreateRequest withAccountHolderName(String accountHolderName) {
+ this.accountHolderName = accountHolderName;
+ return this;
+ }
+
/**
* Bank account number - see [local details](#appendix-local-bank-details) for more
* information. Alternatively you can provide an `iban`.
diff --git a/src/main/java/com/gocardless/services/BillingRequestFlowService.java b/src/main/java/com/gocardless/services/BillingRequestFlowService.java
index 644e01de..399d234c 100644
--- a/src/main/java/com/gocardless/services/BillingRequestFlowService.java
+++ b/src/main/java/com/gocardless/services/BillingRequestFlowService.java
@@ -47,6 +47,7 @@ public BillingRequestFlowInitialiseRequest initialise(String identity) {
public static final class BillingRequestFlowCreateRequest
extends PostRequest {
private Boolean autoFulfil;
+ private Boolean customerDetailsCaptured;
private String exitUri;
private String language;
private Links links;
@@ -57,6 +58,7 @@ public static final class BillingRequestFlowCreateRequest
private PrefilledCustomer prefilledCustomer;
private String redirectUri;
private Boolean showRedirectButtons;
+ private Boolean showSuccessRedirectButton;
/**
* (Experimental feature) Fulfil the Billing Request on completion of the flow (true by
@@ -67,6 +69,15 @@ public BillingRequestFlowCreateRequest withAutoFulfil(Boolean autoFulfil) {
return this;
}
+ /**
+ * Identifies whether a Billing Request belongs to a specific customer
+ */
+ public BillingRequestFlowCreateRequest withCustomerDetailsCaptured(
+ Boolean customerDetailsCaptured) {
+ this.customerDetailsCaptured = customerDetailsCaptured;
+ return this;
+ }
+
/**
* URL that the payer can be taken to if there isn't a way to progress ahead in flow.
*/
@@ -350,6 +361,18 @@ public BillingRequestFlowCreateRequest withShowRedirectButtons(
return this;
}
+ /**
+ * If true, the payer will be able to see a redirect action button on the Success page. This
+ * action button will provide a way to redirect the payer to the given redirect_uri. This
+ * functionality is helpful when merchants do not want payers to be automatically redirected
+ * or on Android devices, where automatic redirections are not possible.
+ */
+ public BillingRequestFlowCreateRequest withShowSuccessRedirectButton(
+ Boolean showSuccessRedirectButton) {
+ this.showSuccessRedirectButton = showSuccessRedirectButton;
+ return this;
+ }
+
private BillingRequestFlowCreateRequest(HttpClient httpClient) {
super(httpClient);
}
diff --git a/src/main/java/com/gocardless/services/BillingRequestService.java b/src/main/java/com/gocardless/services/BillingRequestService.java
index 56d017f5..219b2ec7 100644
--- a/src/main/java/com/gocardless/services/BillingRequestService.java
+++ b/src/main/java/com/gocardless/services/BillingRequestService.java
@@ -59,10 +59,18 @@ public BillingRequestCollectCustomerDetailsRequest collectCustomerDetails(String
* The endpoint takes the same payload as Customer Bank Accounts, but check the bank account is
* valid for the billing request scheme before creating and attaching it.
*
+ * 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.
+ *
+ * _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.
*/
public BillingRequestCollectBankAccountRequest collectBankAccount(String identity) {
return new BillingRequestCollectBankAccountRequest(httpClient, identity);
@@ -165,7 +173,7 @@ public static final class BillingRequestCreateRequest
* debit. Should not be set if GoCardless payment intelligence feature is used.
*
* See [Billing Requests: Retain customers with
- * Fallbacks](https://developer.gocardless.com/getting-started/billing-requests/retain-customers-with-fallbacks/)
+ * Fallbacks](https://developer.gocardless.com/billing-requests/retain-customers-with-fallbacks/)
* for more information.
*/
public BillingRequestCreateRequest withFallbackEnabled(Boolean fallbackEnabled) {
@@ -423,6 +431,23 @@ public BillingRequestCreateRequest withPaymentRequestDescription(String descript
return this;
}
+ /**
+ * 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.
+ *
+ */
+ public BillingRequestCreateRequest withPaymentRequestFundsSettlement(
+ PaymentRequest.FundsSettlement fundsSettlement) {
+ if (paymentRequest == null) {
+ paymentRequest = new PaymentRequest();
+ }
+ paymentRequest.withFundsSettlement(fundsSettlement);
+ return this;
+ }
+
/**
* 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.
@@ -584,7 +609,8 @@ public PeriodicLimits withAlignment(Alignment alignment) {
}
/**
- * The maximum number of payments that can be collected in this periodic limit
+ * (Optional) The maximum number of payments that can be collected in this periodic
+ * limit.
*/
public PeriodicLimits withMaxPayments(Integer maxPayments) {
this.maxPayments = maxPayments;
@@ -592,7 +618,9 @@ public PeriodicLimits withMaxPayments(Integer maxPayments) {
}
/**
- * The maximum total amount that can be charged for all payments in this periodic limit
+ * The maximum total amount that can be charged for all payments in this periodic limit.
+ * Required for VRP.
+ *
*/
public PeriodicLimits withMaxTotalAmount(Integer maxTotalAmount) {
this.maxTotalAmount = maxTotalAmount;
@@ -673,7 +701,7 @@ public Constraints withEndDate(String endDate) {
}
/**
- * The maximum amount that can be charged for a single payment
+ * The maximum amount that can be charged for a single payment. Required for VRP.
*/
public Constraints withMaxAmountPerPayment(Integer maxAmountPerPayment) {
this.maxAmountPerPayment = maxAmountPerPayment;
@@ -865,6 +893,7 @@ public static class PaymentRequest {
private Integer appFee;
private String currency;
private String description;
+ private FundsSettlement fundsSettlement;
private Map metadata;
private String scheme;
@@ -906,6 +935,19 @@ public PaymentRequest withDescription(String description) {
return this;
}
+ /**
+ * 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.
+ *
+ */
+ public PaymentRequest withFundsSettlement(FundsSettlement fundsSettlement) {
+ this.fundsSettlement = fundsSettlement;
+ return this;
+ }
+
/**
* 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.
@@ -926,6 +968,18 @@ public PaymentRequest withScheme(String scheme) {
this.scheme = scheme;
return this;
}
+
+ public enum FundsSettlement {
+ @SerializedName("managed")
+ MANAGED, @SerializedName("direct")
+ DIRECT, @SerializedName("unknown")
+ UNKNOWN;
+
+ @Override
+ public String toString() {
+ return name().toLowerCase();
+ }
+ }
}
}
@@ -1008,8 +1062,8 @@ public BillingRequestCollectCustomerDetailsRequest withCustomerGivenName(String
* 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".
+ * 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) {
@@ -1277,8 +1331,9 @@ public Customer withGivenName(String givenName) {
* 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".
+ * 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;
@@ -1420,10 +1475,18 @@ public CustomerBillingDetail withSwedishIdentityNumber(String swedishIdentityNum
* The endpoint takes the same payload as Customer Bank Accounts, but check the bank account is
* valid for the billing request scheme before creating and attaching it.
*
+ * 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.
+ *
+ * _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.
*/
public static final class BillingRequestCollectBankAccountRequest
extends PostRequest {
@@ -1439,6 +1502,7 @@ public static final class BillingRequestCollectBankAccountRequest
private String currency;
private String iban;
private Map metadata;
+ private String payId;
/**
* Name of the account holder, as known by the bank. Usually this is the same as the name
@@ -1550,6 +1614,15 @@ public BillingRequestCollectBankAccountRequest withMetadata(String key, String v
return this;
}
+ /**
+ * A unique record such as an email address, mobile number or company number, that can be
+ * used to make and accept payments.
+ */
+ public BillingRequestCollectBankAccountRequest withPayId(String payId) {
+ this.payId = payId;
+ return this;
+ }
+
private BillingRequestCollectBankAccountRequest(HttpClient httpClient, String identity) {
super(httpClient);
this.identity = identity;
@@ -1617,6 +1690,7 @@ public static final class BillingRequestConfirmPayerDetailsRequest
@PathParam
private final String identity;
private Map metadata;
+ private Boolean payerRequestedDualSignature;
/**
* Key-value store of custom data. Up to 3 keys are permitted, with key names up to 50
@@ -1639,6 +1713,19 @@ public BillingRequestConfirmPayerDetailsRequest withMetadata(String key, String
return this;
}
+ /**
+ * This attribute can be set to true if the payer has indicated that multiple signatures are
+ * required for the mandate. As long as every other Billing Request actions have been
+ * completed, the payer will receive an email notification containing instructions on how to
+ * complete the additional signature. The dual signature flow can only be completed using
+ * GoCardless branded pages.
+ */
+ public BillingRequestConfirmPayerDetailsRequest withPayerRequestedDualSignature(
+ Boolean payerRequestedDualSignature) {
+ this.payerRequestedDualSignature = payerRequestedDualSignature;
+ return this;
+ }
+
private BillingRequestConfirmPayerDetailsRequest(HttpClient httpClient, String identity) {
super(httpClient);
this.identity = identity;
diff --git a/src/main/java/com/gocardless/services/BillingRequestTemplateService.java b/src/main/java/com/gocardless/services/BillingRequestTemplateService.java
index c222a31e..73668184 100644
--- a/src/main/java/com/gocardless/services/BillingRequestTemplateService.java
+++ b/src/main/java/com/gocardless/services/BillingRequestTemplateService.java
@@ -12,7 +12,16 @@
/**
* Service class for working with billing request template resources.
*
- * Billing Request Templates
+ * Billing Request Templates are reusable templates that result in numerous Billing Requests with
+ * similar attributes. They provide a no-code solution for generating various types of multi-user
+ * payment links.
+ *
+ * Each template includes a reusable URL that can be embedded in a website or shared with customers
+ * via email. Every time the URL is opened, it generates a new Billing Request.
+ *
+ * Billing Request Templates overcome the key limitation of the Billing Request: a Billing Request
+ * cannot be shared among multiple users because it is intended for single-use and is designed to
+ * cater to the unique needs of individual customers.
*/
public class BillingRequestTemplateService {
private final HttpClient httpClient;
diff --git a/src/main/java/com/gocardless/services/CreditorBankAccountService.java b/src/main/java/com/gocardless/services/CreditorBankAccountService.java
index 0e0667bd..17b23d32 100644
--- a/src/main/java/com/gocardless/services/CreditorBankAccountService.java
+++ b/src/main/java/com/gocardless/services/CreditorBankAccountService.java
@@ -373,7 +373,8 @@ public CreditorBankAccountListRequest withCreditor(String creditor) {
}
/**
- * Boolean value showing whether the bank account is enabled or disabled
+ * If `true`, only return enabled bank accounts. If `false`, only return disabled bank
+ * accounts.
*/
public CreditorBankAccountListRequest withEnabled(Boolean enabled) {
this.enabled = enabled;
diff --git a/src/main/java/com/gocardless/services/CreditorService.java b/src/main/java/com/gocardless/services/CreditorService.java
index 8018bff3..9e6f2fb3 100644
--- a/src/main/java/com/gocardless/services/CreditorService.java
+++ b/src/main/java/com/gocardless/services/CreditorService.java
@@ -62,28 +62,31 @@ public CreditorUpdateRequest update(String identity) {
return new CreditorUpdateRequest(httpClient, identity);
}
- /**
- * Applies a [scheme identifier](#core-endpoints-scheme-identifiers) to a creditor. If the
- * creditor already has a scheme identifier for the scheme, it will be replaced, and any
- * mandates attached to it transferred asynchronously. For some schemes, the application of the
- * scheme identifier will be performed asynchronously.
- *
- */
- public CreditorApplySchemeIdentifierRequest applySchemeIdentifier(String identity) {
- return new CreditorApplySchemeIdentifierRequest(httpClient, identity);
- }
-
/**
* Request class for {@link CreditorService#create }.
*
* Creates a new creditor.
*/
public static final class CreditorCreateRequest extends IdempotentPostRequest {
+ private String bankReferencePrefix;
private String countryCode;
private CreditorType creditorType;
private Map links;
private String name;
+ /**
+ * 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`.
+ *
+ * This prefix is also used for refunds in EUR and GBP.
+ *
+ */
+ public CreditorCreateRequest withBankReferencePrefix(String bankReferencePrefix) {
+ this.bankReferencePrefix = bankReferencePrefix;
+ return this;
+ }
+
/**
* [ISO 3166-1 alpha-2
* code.](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
@@ -415,6 +418,7 @@ public static final class CreditorUpdateRequest extends PutRequest {
private String addressLine1;
private String addressLine2;
private String addressLine3;
+ private String bankReferencePrefix;
private String city;
private String countryCode;
private Links links;
@@ -446,6 +450,19 @@ public CreditorUpdateRequest withAddressLine3(String addressLine3) {
return this;
}
+ /**
+ * 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`.
+ *
+ * This prefix is also used for refunds in EUR and GBP.
+ *
+ */
+ public CreditorUpdateRequest withBankReferencePrefix(String bankReferencePrefix) {
+ this.bankReferencePrefix = bankReferencePrefix;
+ return this;
+ }
+
/**
* The city of the creditor's address.
*/
@@ -716,94 +733,4 @@ public Links withDefaultUsdPayoutAccount(String defaultUsdPayoutAccount) {
}
}
}
-
- /**
- * Request class for {@link CreditorService#applySchemeIdentifier }.
- *
- * Applies a [scheme identifier](#core-endpoints-scheme-identifiers) to a creditor. If the
- * creditor already has a scheme identifier for the scheme, it will be replaced, and any
- * mandates attached to it transferred asynchronously. For some schemes, the application of the
- * scheme identifier will be performed asynchronously.
- *
- */
- public static final class CreditorApplySchemeIdentifierRequest extends PostRequest {
- @PathParam
- private final String identity;
- private Links links;
-
- /**
- * The ID of the scheme identifier to apply
- */
- public CreditorApplySchemeIdentifierRequest withLinks(Links links) {
- this.links = links;
- return this;
- }
-
- /**
- * Unique identifier, usually beginning with "SU".
- */
- public CreditorApplySchemeIdentifierRequest withLinksSchemeIdentifier(
- String schemeIdentifier) {
- if (links == null) {
- links = new Links();
- }
- links.withSchemeIdentifier(schemeIdentifier);
- return this;
- }
-
- private CreditorApplySchemeIdentifierRequest(HttpClient httpClient, String identity) {
- super(httpClient);
- this.identity = identity;
- }
-
- public CreditorApplySchemeIdentifierRequest 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 "creditors/:identity/actions/apply_scheme_identifier";
- }
-
- @Override
- protected String getEnvelope() {
- return "creditors";
- }
-
- @Override
- protected Class getResponseClass() {
- return Creditor.class;
- }
-
- @Override
- protected boolean hasBody() {
- return true;
- }
-
- @Override
- protected String getRequestEnvelope() {
- return "data";
- }
-
- public static class Links {
- private String schemeIdentifier;
-
- /**
- * Unique identifier, usually beginning with "SU".
- */
- public Links withSchemeIdentifier(String schemeIdentifier) {
- this.schemeIdentifier = schemeIdentifier;
- return this;
- }
- }
- }
}
diff --git a/src/main/java/com/gocardless/services/CurrencyExchangeRateService.java b/src/main/java/com/gocardless/services/CurrencyExchangeRateService.java
index 3fe83fd5..6270d55f 100644
--- a/src/main/java/com/gocardless/services/CurrencyExchangeRateService.java
+++ b/src/main/java/com/gocardless/services/CurrencyExchangeRateService.java
@@ -44,7 +44,6 @@ public CurrencyExchangeRateListRequest> all() {
*/
public static final class CurrencyExchangeRateListRequest
extends ListRequest {
- private CreatedAt createdAt;
private String source;
private String target;
@@ -64,55 +63,6 @@ public CurrencyExchangeRateListRequest withBefore(String before) {
return this;
}
- public CurrencyExchangeRateListRequest withCreatedAt(CreatedAt createdAt) {
- this.createdAt = createdAt;
- return this;
- }
-
- /**
- * Limit to records created after the specified date-time.
- */
- public CurrencyExchangeRateListRequest withCreatedAtGt(String gt) {
- if (createdAt == null) {
- createdAt = new CreatedAt();
- }
- createdAt.withGt(gt);
- return this;
- }
-
- /**
- * Limit to records created on or after the specified date-time.
- */
- public CurrencyExchangeRateListRequest withCreatedAtGte(String gte) {
- if (createdAt == null) {
- createdAt = new CreatedAt();
- }
- createdAt.withGte(gte);
- return this;
- }
-
- /**
- * Limit to records created before the specified date-time.
- */
- public CurrencyExchangeRateListRequest 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 CurrencyExchangeRateListRequest withCreatedAtLte(String lte) {
- if (createdAt == null) {
- createdAt = new CreatedAt();
- }
- createdAt.withLte(lte);
- return this;
- }
-
/**
* Number of records to return.
*/
@@ -152,9 +102,6 @@ public CurrencyExchangeRateListRequest withHeader(String headerName,
protected Map getQueryParams() {
ImmutableMap.Builder params = ImmutableMap.builder();
params.putAll(super.getQueryParams());
- if (createdAt != null) {
- params.putAll(createdAt.getQueryParams());
- }
if (source != null) {
params.put("source", source);
}
@@ -178,61 +125,5 @@ 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/InstitutionService.java b/src/main/java/com/gocardless/services/InstitutionService.java
index 4cd9fc9c..d36ae07a 100644
--- a/src/main/java/com/gocardless/services/InstitutionService.java
+++ b/src/main/java/com/gocardless/services/InstitutionService.java
@@ -117,9 +117,20 @@ public static final class InstitutionListForBillingRequestRequest
extends ListRequest {
@PathParam
private final String identity;
+ private String countryCode;
private List ids;
private String search;
+ /**
+ * [ISO
+ * 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
+ * alpha-2 code. The country code of the institution.
+ */
+ public InstitutionListForBillingRequestRequest withCountryCode(String countryCode) {
+ this.countryCode = countryCode;
+ return this;
+ }
+
/**
* ID(s) of the institution(s) to retrieve. More than one ID can be specified using a
* comma-separated string.
@@ -172,6 +183,9 @@ protected Map getPathParams() {
protected Map getQueryParams() {
ImmutableMap.Builder params = ImmutableMap.builder();
params.putAll(super.getQueryParams());
+ if (countryCode != null) {
+ params.put("country_code", countryCode);
+ }
if (ids != null) {
params.put("ids", Joiner.on(",").join(ids));
}
diff --git a/src/main/java/com/gocardless/services/LogoService.java b/src/main/java/com/gocardless/services/LogoService.java
new file mode 100644
index 00000000..0f9ba10a
--- /dev/null
+++ b/src/main/java/com/gocardless/services/LogoService.java
@@ -0,0 +1,116 @@
+package com.gocardless.services;
+
+import com.gocardless.http.*;
+import com.gocardless.resources.Logo;
+
+/**
+ * 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.
+ */
+public class LogoService {
+ 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#logos() }.
+ */
+ public LogoService(HttpClient httpClient) {
+ this.httpClient = httpClient;
+ }
+
+ /**
+ * Creates a new logo associated with a creditor. If a creditor already has a logo, this will
+ * update the existing logo linked to the creditor.
+ *
+ * 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).
+ */
+ public LogoCreateForCreditorRequest createForCreditor() {
+ return new LogoCreateForCreditorRequest(httpClient);
+ }
+
+ /**
+ * Request class for {@link LogoService#createForCreditor }.
+ *
+ * Creates a new logo associated with a creditor. If a creditor already has a logo, this will
+ * update the existing logo linked to the creditor.
+ *
+ * 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).
+ */
+ public static final class LogoCreateForCreditorRequest extends PostRequest {
+ private String image;
+ private Links links;
+
+ /**
+ * Base64 encoded string.
+ */
+ public LogoCreateForCreditorRequest withImage(String image) {
+ this.image = image;
+ return this;
+ }
+
+ public LogoCreateForCreditorRequest withLinks(Links links) {
+ this.links = links;
+ return this;
+ }
+
+ /**
+ * ID of the creditor the logo belongs to
+ */
+ public LogoCreateForCreditorRequest withLinksCreditor(String creditor) {
+ if (links == null) {
+ links = new Links();
+ }
+ links.withCreditor(creditor);
+ return this;
+ }
+
+ private LogoCreateForCreditorRequest(HttpClient httpClient) {
+ super(httpClient);
+ }
+
+ public LogoCreateForCreditorRequest withHeader(String headerName, String headerValue) {
+ this.addHeader(headerName, headerValue);
+ return this;
+ }
+
+ @Override
+ protected String getPathTemplate() {
+ return "branding/logos";
+ }
+
+ @Override
+ protected String getEnvelope() {
+ return "logos";
+ }
+
+ @Override
+ protected Class getResponseClass() {
+ return Logo.class;
+ }
+
+ @Override
+ protected boolean hasBody() {
+ return true;
+ }
+
+ public static class Links {
+ private String creditor;
+
+ /**
+ * ID of the creditor the logo belongs to
+ */
+ public Links withCreditor(String creditor) {
+ this.creditor = creditor;
+ return this;
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/gocardless/services/MandateImportEntryService.java b/src/main/java/com/gocardless/services/MandateImportEntryService.java
index a881b37f..1066dd62 100644
--- a/src/main/java/com/gocardless/services/MandateImportEntryService.java
+++ b/src/main/java/com/gocardless/services/MandateImportEntryService.java
@@ -3,6 +3,7 @@
import com.gocardless.http.*;
import com.gocardless.resources.MandateImportEntry;
import com.google.common.collect.ImmutableMap;
+import com.google.gson.annotations.SerializedName;
import com.google.gson.reflect.TypeToken;
import java.util.List;
import java.util.Map;
@@ -89,6 +90,7 @@ public static final class MandateImportEntryCreateRequest
private BankAccount bankAccount;
private Customer customer;
private Links links;
+ private Mandate mandate;
private String recordIdentifier;
public MandateImportEntryCreateRequest withAmendment(Amendment amendment) {
@@ -170,6 +172,20 @@ public MandateImportEntryCreateRequest withBankAccountAccountNumber(String accou
return this;
}
+ /**
+ * 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.
+ */
+ public MandateImportEntryCreateRequest withBankAccountAccountType(
+ BankAccount.AccountType accountType) {
+ if (bankAccount == null) {
+ bankAccount = new BankAccount();
+ }
+ bankAccount.withAccountType(accountType);
+ return this;
+ }
+
/**
* Bank code - see [local details](#appendix-local-bank-details) for more information.
* Alternatively you can provide an `iban`.
@@ -220,6 +236,19 @@ public MandateImportEntryCreateRequest withBankAccountIban(String iban) {
return this;
}
+ /**
+ * 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.
+ */
+ public MandateImportEntryCreateRequest withBankAccountMetadata(
+ Map metadata) {
+ if (bankAccount == null) {
+ bankAccount = new BankAccount();
+ }
+ bankAccount.withMetadata(metadata);
+ return this;
+ }
+
public MandateImportEntryCreateRequest withCustomer(Customer customer) {
this.customer = customer;
return this;
@@ -360,6 +389,18 @@ public MandateImportEntryCreateRequest withCustomerLanguage(String language) {
return this;
}
+ /**
+ * 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.
+ */
+ public MandateImportEntryCreateRequest withCustomerMetadata(Map metadata) {
+ if (customer == null) {
+ customer = new Customer();
+ }
+ customer.withMetadata(metadata);
+ return this;
+ }
+
/**
* [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone number, including
* country code.
@@ -427,6 +468,36 @@ public MandateImportEntryCreateRequest withLinksMandateImport(String mandateImpo
return this;
}
+ public MandateImportEntryCreateRequest withMandate(Mandate mandate) {
+ this.mandate = mandate;
+ return this;
+ }
+
+ /**
+ * 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.
+ */
+ public MandateImportEntryCreateRequest withMandateMetadata(Map metadata) {
+ if (mandate == null) {
+ mandate = new Mandate();
+ }
+ mandate.withMetadata(metadata);
+ return this;
+ }
+
+ /**
+ * 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.
+ */
+ public MandateImportEntryCreateRequest withMandateReference(String reference) {
+ if (mandate == null) {
+ mandate = new Mandate();
+ }
+ mandate.withReference(reference);
+ return this;
+ }
+
/**
* 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.
@@ -504,10 +575,12 @@ public Amendment withOriginalMandateReference(String originalMandateReference) {
public static class BankAccount {
private String accountHolderName;
private String accountNumber;
+ private AccountType accountType;
private String bankCode;
private String branchCode;
private String countryCode;
private String iban;
+ private Map metadata;
/**
* Name of the account holder, as known by the bank. Usually this is the same as the
@@ -530,6 +603,16 @@ public BankAccount withAccountNumber(String accountNumber) {
return this;
}
+ /**
+ * 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.
+ */
+ public BankAccount withAccountType(AccountType accountType) {
+ this.accountType = accountType;
+ return this;
+ }
+
/**
* Bank code - see [local details](#appendix-local-bank-details) for more information.
* Alternatively you can provide an `iban`.
@@ -568,6 +651,27 @@ public BankAccount withIban(String iban) {
this.iban = iban;
return this;
}
+
+ /**
+ * 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.
+ */
+ public BankAccount withMetadata(Map metadata) {
+ this.metadata = metadata;
+ return this;
+ }
+
+ public enum AccountType {
+ @SerializedName("savings")
+ SAVINGS, @SerializedName("checking")
+ CHECKING, @SerializedName("unknown")
+ UNKNOWN;
+
+ @Override
+ public String toString() {
+ return name().toLowerCase();
+ }
+ }
}
public static class Customer {
@@ -582,6 +686,7 @@ public static class Customer {
private String familyName;
private String givenName;
private String language;
+ private Map metadata;
private String phoneNumber;
private String postalCode;
private String region;
@@ -688,6 +793,15 @@ public Customer withLanguage(String language) {
return this;
}
+ /**
+ * 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.
+ */
+ public Customer withMetadata(Map metadata) {
+ this.metadata = metadata;
+ return this;
+ }
+
/**
* [ITU E.123](https://en.wikipedia.org/wiki/E.123) formatted phone number, including
* country code.
@@ -740,6 +854,30 @@ public Links withMandateImport(String mandateImport) {
return this;
}
}
+
+ public static class Mandate {
+ private Map metadata;
+ private String reference;
+
+ /**
+ * 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.
+ */
+ public Mandate withMetadata(Map metadata) {
+ this.metadata = metadata;
+ return this;
+ }
+
+ /**
+ * 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.
+ */
+ public Mandate withReference(String reference) {
+ this.reference = reference;
+ return this;
+ }
+ }
}
/**
diff --git a/src/main/java/com/gocardless/services/MandateImportService.java b/src/main/java/com/gocardless/services/MandateImportService.java
index 29b2d27a..1e3abb82 100644
--- a/src/main/java/com/gocardless/services/MandateImportService.java
+++ b/src/main/java/com/gocardless/services/MandateImportService.java
@@ -97,8 +97,28 @@ public MandateImportCancelRequest cancel(String identity) {
*/
public static final class MandateImportCreateRequest
extends IdempotentPostRequest {
+ private Links links;
private Scheme scheme;
+ /**
+ * Related resources
+ */
+ public MandateImportCreateRequest withLinks(Links links) {
+ this.links = links;
+ return this;
+ }
+
+ /**
+ * ID of the associated creditor. Only required if your account manages multiple creditors.
+ */
+ public MandateImportCreateRequest withLinksCreditor(String creditor) {
+ if (links == null) {
+ links = new Links();
+ }
+ links.withCreditor(creditor);
+ return this;
+ }
+
/**
* A bank payment scheme. Currently "ach", "autogiro", "bacs", "becs", "becs_nz",
* "betalingsservice", "faster_payments", "pad", "pay_to" and "sepa_core" are supported.
@@ -170,6 +190,19 @@ public String toString() {
return name().toLowerCase();
}
}
+
+ public static class Links {
+ private String creditor;
+
+ /**
+ * ID of the associated creditor. Only required if your account manages multiple
+ * creditors.
+ */
+ public Links withCreditor(String creditor) {
+ this.creditor = creditor;
+ return this;
+ }
+ }
}
/**
diff --git a/src/main/java/com/gocardless/services/MandatePdfService.java b/src/main/java/com/gocardless/services/MandatePdfService.java
index 4f044fdb..57ed02a7 100644
--- a/src/main/java/com/gocardless/services/MandatePdfService.java
+++ b/src/main/java/com/gocardless/services/MandatePdfService.java
@@ -80,8 +80,11 @@ public static final class MandatePdfCreateRequest extends PostRequest> list() {
+ return new NegativeBalanceLimitListRequest<>(httpClient,
+ ListRequest.pagingExecutor());
+ }
+
+ public NegativeBalanceLimitListRequest> all() {
+ return new NegativeBalanceLimitListRequest<>(httpClient,
+ ListRequest.iteratingExecutor());
+ }
+
+ /**
+ * Creates a new negative balance limit, which replaces the existing limit (if present) for that
+ * currency and creditor combination.
+ *
+ */
+ public NegativeBalanceLimitCreateRequest create() {
+ return new NegativeBalanceLimitCreateRequest(httpClient);
+ }
+
+ /**
+ * Request class for {@link NegativeBalanceLimitService#list }.
+ *
+ * Returns a [cursor-paginated](#api-usage-cursor-pagination) list of negative balance limits.
+ */
+ public static final class NegativeBalanceLimitListRequest
+ extends ListRequest {
+ private String creditor;
+ private Currency currency;
+
+ /**
+ * Cursor pointing to the start of the desired set.
+ */
+ public NegativeBalanceLimitListRequest withAfter(String after) {
+ setAfter(after);
+ return this;
+ }
+
+ /**
+ * Cursor pointing to the end of the desired set.
+ */
+ public NegativeBalanceLimitListRequest withBefore(String before) {
+ setBefore(before);
+ return this;
+ }
+
+ /**
+ * Unique identifier, beginning with "CR".
+ */
+ public NegativeBalanceLimitListRequest withCreditor(String creditor) {
+ this.creditor = creditor;
+ return this;
+ }
+
+ /**
+ * [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently
+ * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported.
+ */
+ public NegativeBalanceLimitListRequest withCurrency(Currency currency) {
+ this.currency = currency;
+ return this;
+ }
+
+ /**
+ * Number of records to return.
+ */
+ public NegativeBalanceLimitListRequest withLimit(Integer limit) {
+ setLimit(limit);
+ return this;
+ }
+
+ private NegativeBalanceLimitListRequest(HttpClient httpClient,
+ ListRequestExecutor executor) {
+ super(httpClient, executor);
+ }
+
+ public NegativeBalanceLimitListRequest 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);
+ }
+ if (currency != null) {
+ params.put("currency", currency);
+ }
+ return params.build();
+ }
+
+ @Override
+ protected String getPathTemplate() {
+ return "negative_balance_limits";
+ }
+
+ @Override
+ protected String getEnvelope() {
+ return "negative_balance_limits";
+ }
+
+ @Override
+ protected TypeToken> getTypeToken() {
+ return new TypeToken>() {};
+ }
+
+ public enum Currency {
+ @SerializedName("AUD")
+ AUD, @SerializedName("CAD")
+ CAD, @SerializedName("DKK")
+ DKK, @SerializedName("EUR")
+ EUR, @SerializedName("GBP")
+ GBP, @SerializedName("NZD")
+ NZD, @SerializedName("SEK")
+ SEK, @SerializedName("USD")
+ USD, @SerializedName("unknown")
+ UNKNOWN;
+
+ @Override
+ public String toString() {
+ return name();
+ }
+ }
+ }
+
+ /**
+ * Request class for {@link NegativeBalanceLimitService#create }.
+ *
+ * Creates a new negative balance limit, which replaces the existing limit (if present) for that
+ * currency and creditor combination.
+ *
+ */
+ public static final class NegativeBalanceLimitCreateRequest
+ extends PostRequest {
+ private Integer balanceLimit;
+ private Currency currency;
+ private Links links;
+
+ /**
+ * The limit amount in pence (e.g. 10000 for a -100 GBP limit).
+ */
+ public NegativeBalanceLimitCreateRequest withBalanceLimit(Integer balanceLimit) {
+ this.balanceLimit = balanceLimit;
+ return this;
+ }
+
+ /**
+ * [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code. Currently
+ * "AUD", "CAD", "DKK", "EUR", "GBP", "NZD", "SEK" and "USD" are supported.
+ */
+ public NegativeBalanceLimitCreateRequest withCurrency(Currency currency) {
+ this.currency = currency;
+ return this;
+ }
+
+ public NegativeBalanceLimitCreateRequest withLinks(Links links) {
+ this.links = links;
+ return this;
+ }
+
+ /**
+ * ID of the [creditor](#core-endpoints-creditors) this limit relates to
+ */
+ public NegativeBalanceLimitCreateRequest withLinksCreditor(String creditor) {
+ if (links == null) {
+ links = new Links();
+ }
+ links.withCreditor(creditor);
+ return this;
+ }
+
+ private NegativeBalanceLimitCreateRequest(HttpClient httpClient) {
+ super(httpClient);
+ }
+
+ public NegativeBalanceLimitCreateRequest withHeader(String headerName, String headerValue) {
+ this.addHeader(headerName, headerValue);
+ return this;
+ }
+
+ @Override
+ protected String getPathTemplate() {
+ return "negative_balance_limits";
+ }
+
+ @Override
+ protected String getEnvelope() {
+ return "negative_balance_limits";
+ }
+
+ @Override
+ protected Class getResponseClass() {
+ return NegativeBalanceLimit.class;
+ }
+
+ @Override
+ protected boolean hasBody() {
+ return true;
+ }
+
+ public enum Currency {
+ @SerializedName("AUD")
+ AUD, @SerializedName("CAD")
+ CAD, @SerializedName("DKK")
+ DKK, @SerializedName("EUR")
+ EUR, @SerializedName("GBP")
+ GBP, @SerializedName("NZD")
+ NZD, @SerializedName("SEK")
+ SEK, @SerializedName("USD")
+ USD, @SerializedName("unknown")
+ UNKNOWN;
+
+ @Override
+ public String toString() {
+ return name();
+ }
+ }
+
+ public static class Links {
+ private String creditor;
+
+ /**
+ * ID of the [creditor](#core-endpoints-creditors) this limit relates to
+ */
+ public Links withCreditor(String creditor) {
+ this.creditor = creditor;
+ return this;
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/gocardless/services/PayerThemeService.java b/src/main/java/com/gocardless/services/PayerThemeService.java
new file mode 100644
index 00000000..d41183c0
--- /dev/null
+++ b/src/main/java/com/gocardless/services/PayerThemeService.java
@@ -0,0 +1,136 @@
+package com.gocardless.services;
+
+import com.gocardless.http.*;
+import com.gocardless.resources.PayerTheme;
+
+/**
+ * Service class for working with payer theme resources.
+ *
+ * Custom colour themes for payment pages and customer notifications.
+ */
+public class PayerThemeService {
+ 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#payerThemes() }.
+ */
+ public PayerThemeService(HttpClient httpClient) {
+ this.httpClient = httpClient;
+ }
+
+ /**
+ * Creates a new payer theme associated with a creditor. If a creditor already has payer themes,
+ * this will update the existing payer theme linked to the creditor.
+ */
+ public PayerThemeCreateForCreditorRequest createForCreditor() {
+ return new PayerThemeCreateForCreditorRequest(httpClient);
+ }
+
+ /**
+ * Request class for {@link PayerThemeService#createForCreditor }.
+ *
+ * Creates a new payer theme associated with a creditor. If a creditor already has payer themes,
+ * this will update the existing payer theme linked to the creditor.
+ */
+ public static final class PayerThemeCreateForCreditorRequest extends PostRequest {
+ private String buttonBackgroundColour;
+ private String contentBoxBorderColour;
+ private String headerBackgroundColour;
+ private String linkTextColour;
+ private Links links;
+
+ /**
+ * Colour for buttons background (hexcode)
+ */
+ public PayerThemeCreateForCreditorRequest withButtonBackgroundColour(
+ String buttonBackgroundColour) {
+ this.buttonBackgroundColour = buttonBackgroundColour;
+ return this;
+ }
+
+ /**
+ * Colour for content box border (hexcode)
+ */
+ public PayerThemeCreateForCreditorRequest withContentBoxBorderColour(
+ String contentBoxBorderColour) {
+ this.contentBoxBorderColour = contentBoxBorderColour;
+ return this;
+ }
+
+ /**
+ * Colour for header background (hexcode)
+ */
+ public PayerThemeCreateForCreditorRequest withHeaderBackgroundColour(
+ String headerBackgroundColour) {
+ this.headerBackgroundColour = headerBackgroundColour;
+ return this;
+ }
+
+ /**
+ * Colour for text links (hexcode)
+ */
+ public PayerThemeCreateForCreditorRequest withLinkTextColour(String linkTextColour) {
+ this.linkTextColour = linkTextColour;
+ return this;
+ }
+
+ public PayerThemeCreateForCreditorRequest withLinks(Links links) {
+ this.links = links;
+ return this;
+ }
+
+ /**
+ * ID of the creditor the payer theme belongs to
+ */
+ public PayerThemeCreateForCreditorRequest withLinksCreditor(String creditor) {
+ if (links == null) {
+ links = new Links();
+ }
+ links.withCreditor(creditor);
+ return this;
+ }
+
+ private PayerThemeCreateForCreditorRequest(HttpClient httpClient) {
+ super(httpClient);
+ }
+
+ public PayerThemeCreateForCreditorRequest withHeader(String headerName,
+ String headerValue) {
+ this.addHeader(headerName, headerValue);
+ return this;
+ }
+
+ @Override
+ protected String getPathTemplate() {
+ return "branding/payer_themes";
+ }
+
+ @Override
+ protected String getEnvelope() {
+ return "payer_themes";
+ }
+
+ @Override
+ protected Class getResponseClass() {
+ return PayerTheme.class;
+ }
+
+ @Override
+ protected boolean hasBody() {
+ return true;
+ }
+
+ public static class Links {
+ private String creditor;
+
+ /**
+ * ID of the creditor the payer theme belongs to
+ */
+ public Links withCreditor(String creditor) {
+ this.creditor = creditor;
+ return this;
+ }
+ }
+ }
+}
diff --git a/src/main/java/com/gocardless/services/PaymentService.java b/src/main/java/com/gocardless/services/PaymentService.java
index b348acad..a1fe6bb5 100644
--- a/src/main/java/com/gocardless/services/PaymentService.java
+++ b/src/main/java/com/gocardless/services/PaymentService.java
@@ -109,6 +109,7 @@ public static final class PaymentCreateRequest extends IdempotentPostRequest metadata;
private String reference;
@@ -161,6 +162,16 @@ public PaymentCreateRequest withDescription(String description) {
return this;
}
+ /**
+ * Set this to true or false in the request to create an ACH payment to explicitly choose
+ * whether the payment should be processed through Faster ACH or standard ACH, rather than
+ * relying on the presence or absence of the charge date to indicate that.
+ */
+ public PaymentCreateRequest withFasterAch(Boolean fasterAch) {
+ this.fasterAch = fasterAch;
+ return this;
+ }
+
public PaymentCreateRequest withLinks(Links links) {
this.links = links;
return this;
diff --git a/src/main/java/com/gocardless/services/RedirectFlowService.java b/src/main/java/com/gocardless/services/RedirectFlowService.java
index fa171959..843b90ba 100644
--- a/src/main/java/com/gocardless/services/RedirectFlowService.java
+++ b/src/main/java/com/gocardless/services/RedirectFlowService.java
@@ -11,9 +11,9 @@
* Service class for working with redirect flow resources.
*
*
- * Deprecated: Redirect Flows are our legacy APIs for setting up mandates and will
- * no longer be supported in the future. We strongly recommend using the [Billing Request
- * flow](#billing-requests) instead.
+ * 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.
*
*
* Redirect flows enable you to use GoCardless' [hosted payment
diff --git a/src/main/java/com/gocardless/services/SchemeIdentifierService.java b/src/main/java/com/gocardless/services/SchemeIdentifierService.java
index 782ad316..e169019c 100644
--- a/src/main/java/com/gocardless/services/SchemeIdentifierService.java
+++ b/src/main/java/com/gocardless/services/SchemeIdentifierService.java
@@ -28,26 +28,32 @@ public SchemeIdentifierService(HttpClient httpClient) {
}
/**
- * Creates a new scheme identifier. The scheme identifier must be [applied to a
- * creditor](#creditors-apply-a-scheme-identifier) before payments are taken using it. The
- * scheme identifier must also have the `status` of active before it can be used. For some
- * schemes e.g. faster_payments this will happen instantly. For other schemes e.g. bacs this can
- * take several days.
+ * 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
+ * #### Scheme identifier name validations
*
- * Each scheme has different rules for the length and permitted characters in the scheme
- * identifier name field. The rules are:
+ * The `name` field of a scheme identifier can contain alphanumeric characters, spaces and
+ * special characters.
*
- * | __scheme__ | __maximum length__ | __allowed characters__ | __spaces__ | | :-------------- |
- * :----------------- | :----------------------- | :--------- | | bacs | 18 characters |
- * `a-zA-Z0-9/.&-` | yes | | sepa_core | 70 characters | `a-zA-Z0-9/?:().,+&<>'"` | yes | | ach
- * | 16 characters | `a-zA-Z0-9/?:().,'+-` | yes | | faster_payments | 18 characters |
- * `a-zA-Z0-9/?:().,'+-` | yes |
+ * 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);
@@ -76,32 +82,56 @@ public SchemeIdentifierGetRequest get(String identity) {
/**
* Request class for {@link SchemeIdentifierService#create }.
*
- * Creates a new scheme identifier. The scheme identifier must be [applied to a
- * creditor](#creditors-apply-a-scheme-identifier) before payments are taken using it. The
- * scheme identifier must also have the `status` of active before it can be used. For some
- * schemes e.g. faster_payments this will happen instantly. For other schemes e.g. bacs this can
- * take several days.
+ * 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
*
- * ### Scheme identifier name validations
+ * The `name` field of a scheme identifier can contain alphanumeric characters, spaces and
+ * special characters.
*
- * Each scheme has different rules for the length and permitted characters in the scheme
- * identifier name field. The rules are:
+ * Its maximum length and the special characters it supports depend on the scheme:
*
- * | __scheme__ | __maximum length__ | __allowed characters__ | __spaces__ | | :-------------- |
- * :----------------- | :----------------------- | :--------- | | bacs | 18 characters |
- * `a-zA-Z0-9/.&-` | yes | | sepa_core | 70 characters | `a-zA-Z0-9/?:().,+&<>'"` | yes | | ach
- * | 16 characters | `a-zA-Z0-9/?:().,'+-` | yes | | faster_payments | 18 characters |
- * `a-zA-Z0-9/?:().,'+-` | yes |
+ * | __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.
@@ -183,6 +213,19 @@ public String toString() {
return name().toLowerCase();
}
}
+
+ public static class Links {
+ private String creditor;
+
+ /**
+ * required ID of the associated [creditor](#core-endpoints-creditors).
+ *
+ */
+ public Links withCreditor(String creditor) {
+ this.creditor = creditor;
+ return this;
+ }
+ }
}
/**
@@ -192,6 +235,8 @@ public String toString() {
*/
public static final class SchemeIdentifierListRequest
extends ListRequest {
+ private String creditor;
+
/**
* Cursor pointing to the start of the desired set.
*/
@@ -208,6 +253,14 @@ public SchemeIdentifierListRequest withBefore(String before) {
return this;
}
+ /**
+ * Unique identifier, beginning with "CR".
+ */
+ public SchemeIdentifierListRequest withCreditor(String creditor) {
+ this.creditor = creditor;
+ return this;
+ }
+
/**
* Number of records to return.
*/
@@ -230,6 +283,9 @@ public SchemeIdentifierListRequest withHeader(String headerName, String heade
protected Map getQueryParams() {
ImmutableMap.Builder params = ImmutableMap.builder();
params.putAll(super.getQueryParams());
+ if (creditor != null) {
+ params.put("creditor", creditor);
+ }
return params.build();
}
diff --git a/src/main/java/com/gocardless/services/SubscriptionService.java b/src/main/java/com/gocardless/services/SubscriptionService.java
index 7b405ceb..22d8d595 100644
--- a/src/main/java/com/gocardless/services/SubscriptionService.java
+++ b/src/main/java/com/gocardless/services/SubscriptionService.java
@@ -20,10 +20,10 @@
*
* The following rules apply when specifying recurrence:
*
- * - The first payment must be charged within 1 year. - 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:
+ * - 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__ | | :---------------- |
* :--------------------------------------------- | :----------------------------------------- | |
@@ -47,7 +47,6 @@
* - 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;
@@ -151,7 +150,6 @@ public SubscriptionUpdateRequest update(String identity) {
*
* - `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);
@@ -941,7 +939,6 @@ protected boolean hasBody() {
*
* - `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
@@ -972,7 +969,11 @@ 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.
+ * 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).
*/
public SubscriptionPauseRequest withPauseCycles(Integer pauseCycles) {
this.pauseCycles = pauseCycles;
diff --git a/src/main/java/com/gocardless/services/TaxRateService.java b/src/main/java/com/gocardless/services/TaxRateService.java
index ee4299c3..8e1222c4 100644
--- a/src/main/java/com/gocardless/services/TaxRateService.java
+++ b/src/main/java/com/gocardless/services/TaxRateService.java
@@ -75,6 +75,14 @@ public TaxRateListRequest withJurisdiction(String jurisdiction) {
return this;
}
+ /**
+ * Number of records to return.
+ */
+ public TaxRateListRequest withLimit(Integer limit) {
+ setLimit(limit);
+ return this;
+ }
+
private TaxRateListRequest(HttpClient httpClient,
ListRequestExecutor executor) {
super(httpClient, executor);
diff --git a/src/main/java/com/gocardless/services/TransferredMandateService.java b/src/main/java/com/gocardless/services/TransferredMandateService.java
new file mode 100644
index 00000000..29b05c80
--- /dev/null
+++ b/src/main/java/com/gocardless/services/TransferredMandateService.java
@@ -0,0 +1,83 @@
+package com.gocardless.services;
+
+import com.gocardless.http.*;
+import com.gocardless.resources.TransferredMandate;
+import com.google.common.collect.ImmutableMap;
+import java.util.Map;
+
+/**
+ * Service class for working with transferred mandate resources.
+ *
+ * Mandates that have been transferred using Current Account Switch Service
+ */
+public class TransferredMandateService {
+ 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#transferredMandates() }.
+ */
+ public TransferredMandateService(HttpClient httpClient) {
+ this.httpClient = httpClient;
+ }
+
+ /**
+ * Returns new customer bank details for a mandate that's been recently transferred
+ */
+ public TransferredMandateTransferredMandatesRequest transferredMandates(String identity) {
+ return new TransferredMandateTransferredMandatesRequest(httpClient, identity);
+ }
+
+ /**
+ * Request class for {@link TransferredMandateService#transferredMandates }.
+ *
+ * Returns new customer bank details for a mandate that's been recently transferred
+ */
+ public static final class TransferredMandateTransferredMandatesRequest
+ extends GetRequest {
+ @PathParam
+ private final String identity;
+
+ private TransferredMandateTransferredMandatesRequest(HttpClient httpClient,
+ String identity) {
+ super(httpClient);
+ this.identity = identity;
+ }
+
+ public TransferredMandateTransferredMandatesRequest 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 Map getQueryParams() {
+ ImmutableMap.Builder params = ImmutableMap.builder();
+ params.putAll(super.getQueryParams());
+ return params.build();
+ }
+
+ @Override
+ protected String getPathTemplate() {
+ return "transferred_mandates/:identity";
+ }
+
+ @Override
+ protected String getEnvelope() {
+ return "transferred_mandates";
+ }
+
+ @Override
+ protected Class getResponseClass() {
+ return TransferredMandate.class;
+ }
+ }
+}