Skip to content

Commit

Permalink
Merge pull request #119 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Template changes
  • Loading branch information
opsz2 authored Jan 18, 2024
2 parents 2b51b25 + 6e9f222 commit caf99f5
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 21 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ With Maven:
<dependency>
<groupId>com.gocardless</groupId>
<artifactId>gocardless-pro</artifactId>
<version>5.23.0</version>
<version>5.24.0</version>
</dependency>
```

With Gradle:

```
implementation 'com.gocardless:gocardless-pro:5.23.0'
implementation 'com.gocardless:gocardless-pro:5.24.0'
```

## Initializing the client
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'com.gocardless'
version = '5.23.0'
version = '5.24.0'

apply plugin: 'ch.raffael.pegdown-doclet'

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/gocardless/http/HttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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/5.23.0 java/%s %s/%s %s/%s",
String.format("gocardless-pro-java/5.24.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")),
Expand All @@ -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", "5.23.0");
builder.put("GoCardless-Client-Version", "5.24.0");
HEADERS = builder.build();
}
private final OkHttpClient rawClient;
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/com/gocardless/resources/BillingRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ private MandateRequest() {
private String description;
private Links links;
private Map<String, Object> metadata;
private Boolean payerRequestedDualSignature;
private String scheme;
private Verify verify;

Expand Down Expand Up @@ -535,6 +536,17 @@ public Map<String, Object> getMetadata() {
return metadata;
}

/**
* 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 Boolean getPayerRequestedDualSignature() {
return payerRequestedDualSignature;
}

/**
* A bank payment scheme. Currently "ach", "autogiro", "bacs", "becs", "becs_nz",
* "betalingsservice", "faster_payments", "pad", "pay_to" and "sepa_core" are supported.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ public BankDetailsLookupService(HttpClient httpClient) {
* Performs a bank details lookup. As part of the lookup, a modulus check and reachability check
* are performed.
*
* In case an account holder name is provided (and an account number, a sort code or an iban are
* already present) an account holder name verification will also be performed.
*
* 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
Expand All @@ -53,9 +50,6 @@ public BankDetailsLookupCreateRequest create() {
* Performs a bank details lookup. As part of the lookup, a modulus check and reachability check
* are performed.
*
* In case an account holder name is provided (and an account number, a sort code or an iban are
* already present) an account holder name verification will also be performed.
*
* 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
Expand All @@ -74,22 +68,12 @@ public BankDetailsLookupCreateRequest create() {
*/
public static final class BankDetailsLookupCreateRequest
extends PostRequest<BankDetailsLookup> {
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`.
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/com/gocardless/services/BillingRequestService.java
Original file line number Diff line number Diff line change
Expand Up @@ -1637,6 +1637,7 @@ public static final class BillingRequestConfirmPayerDetailsRequest
@PathParam
private final String identity;
private Map<String, String> metadata;
private Boolean payerRequestedDualSignature;

/**
* Key-value store of custom data. Up to 3 keys are permitted, with key names up to 50
Expand All @@ -1659,6 +1660,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,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) {
Expand Down Expand Up @@ -427,6 +428,24 @@ public MandateImportEntryCreateRequest withLinksMandateImport(String mandateImpo
return this;
}

public MandateImportEntryCreateRequest withMandate(Mandate mandate) {
this.mandate = mandate;
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.
Expand Down Expand Up @@ -740,6 +759,20 @@ public Links withMandateImport(String mandateImport) {
return this;
}
}

public static class Mandate {
private String reference;

/**
* 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;
}
}
}

/**
Expand Down

0 comments on commit caf99f5

Please sign in to comment.