diff --git a/src/main/java/com/gocardless/services/MandateImportEntryService.java b/src/main/java/com/gocardless/services/MandateImportEntryService.java index cf79aa06..b5fed44f 100644 --- a/src/main/java/com/gocardless/services/MandateImportEntryService.java +++ b/src/main/java/com/gocardless/services/MandateImportEntryService.java @@ -473,6 +473,25 @@ public MandateImportEntryCreateRequest withMandate(Mandate mandate) { return this; } + /** + * This field is ACH specific, sometimes referred to as [SEC + * code](https://www.moderntreasury.com/learn/sec-codes). + * + * 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) { + if (mandate == null) { + mandate = new Mandate(); + } + mandate.withAuthorisationSource(authorisationSource); + 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. @@ -856,9 +875,26 @@ public Links withMandateImport(String mandateImport) { } public static class Mandate { + private AuthorisationSource authorisationSource; private Map metadata; private String reference; + /** + * This field is ACH specific, sometimes referred to as [SEC + * code](https://www.moderntreasury.com/learn/sec-codes). + * + * 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; + 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. @@ -877,6 +913,19 @@ public Mandate withReference(String reference) { this.reference = reference; return this; } + + public enum AuthorisationSource { + @SerializedName("web") + WEB, @SerializedName("telephone") + TELEPHONE, @SerializedName("paper") + PAPER, @SerializedName("unknown") + UNKNOWN; + + @Override + public String toString() { + return name().toLowerCase(); + } + } } }