Skip to content

Commit

Permalink
Merge pull request #118 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Template changes
  • Loading branch information
barrucadu authored Jan 10, 2024
2 parents 1084283 + 1bb8817 commit 2b51b25
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 5 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.22.0</version>
<version>5.23.0</version>
</dependency>
```

With Gradle:

```
implementation 'com.gocardless:gocardless-pro:5.22.0'
implementation 'com.gocardless:gocardless-pro:5.23.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.22.0'
version = '5.23.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.22.0 java/%s %s/%s %s/%s",
String.format("gocardless-pro-java/5.23.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.22.0");
builder.put("GoCardless-Client-Version", "5.23.0");
HEADERS = builder.build();
}
private final OkHttpClient rawClient;
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/com/gocardless/resources/Mandate.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ private Mandate() {
private Links links;
private Map<String, Object> metadata;
private String nextPossibleChargeDate;
private String nextPossibleStandardAchChargeDate;
private Boolean paymentsRequireApproval;
private String reference;
private String scheme;
Expand Down Expand Up @@ -99,6 +100,17 @@ 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.
*
* It is only present in the API response for ACH mandates.
*/
public String getNextPossibleStandardAchChargeDate() {
return nextPossibleStandardAchChargeDate;
}

/**
* Boolean value showing whether payments and subscriptions under this mandate require approval
* via an automated email before being processed.
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/gocardless/resources/Payment.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ private Payment() {
private String createdAt;
private Currency currency;
private String description;
private Boolean fasterAch;
private Fx fx;
private String id;
private Links links;
Expand Down Expand Up @@ -81,6 +82,15 @@ public String getDescription() {
return description;
}

/**
* This field indicates whether the ACH payment is processed through Faster ACH or standard ACH.
*
* It is only present in the API response for ACH payments.
*/
public Boolean getFasterAch() {
return fasterAch;
}

public Fx getFx() {
return fx;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ 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 @@ -50,6 +53,9 @@ 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 @@ -68,12 +74,22 @@ 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
11 changes: 11 additions & 0 deletions src/main/java/com/gocardless/services/PaymentService.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public static final class PaymentCreateRequest extends IdempotentPostRequest<Pay
private String chargeDate;
private Currency currency;
private String description;
private Boolean fasterAch;
private Links links;
private Map<String, String> metadata;
private String reference;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2b51b25

Please sign in to comment.