Skip to content

Commit 5c9b11b

Browse files
authored
Merge pull request #159 from gocardless/template-changes
Changes from gocardless/gocardless-pro-java-template
2 parents 83a6484 + 79ad987 commit 5c9b11b

28 files changed

Lines changed: 1025 additions & 78 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ With Maven:
1414
<dependency>
1515
<groupId>com.gocardless</groupId>
1616
<artifactId>gocardless-pro</artifactId>
17-
<version>7.4.0</version>
17+
<version>7.5.0</version>
1818
</dependency>
1919
```
2020

2121
With Gradle:
2222

2323
```
24-
implementation 'com.gocardless:gocardless-pro:7.4.0'
24+
implementation 'com.gocardless:gocardless-pro:7.5.0'
2525
```
2626

2727
## Initializing the client

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ plugins {
2525
sourceCompatibility = 1.8
2626
targetCompatibility = 1.8
2727
group = 'com.gocardless'
28-
version = '7.4.0'
28+
version = '7.5.0'
2929

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

src/main/java/com/gocardless/GoCardlessClient.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public class GoCardlessClient {
1616
private final HttpClient httpClient;
1717
private final BalanceService balances;
1818
private final BankAccountDetailService bankAccountDetails;
19+
private final BankAccountHolderVerificationService bankAccountHolderVerifications;
1920
private final BankAuthorisationService bankAuthorisations;
2021
private final BankDetailsLookupService bankDetailsLookups;
2122
private final BillingRequestService billingRequests;
@@ -43,6 +44,8 @@ public class GoCardlessClient {
4344
private final PayerAuthorisationService payerAuthorisations;
4445
private final PayerThemeService payerThemes;
4546
private final PaymentService payments;
47+
private final PaymentAccountService paymentAccounts;
48+
private final PaymentAccountTransactionService paymentAccountTransactions;
4649
private final PayoutService payouts;
4750
private final PayoutItemService payoutItems;
4851
private final RedirectFlowService redirectFlows;
@@ -177,6 +180,7 @@ private GoCardlessClient(HttpClient httpClient) {
177180
this.httpClient = httpClient;
178181
this.balances = new BalanceService(httpClient);
179182
this.bankAccountDetails = new BankAccountDetailService(httpClient);
183+
this.bankAccountHolderVerifications = new BankAccountHolderVerificationService(httpClient);
180184
this.bankAuthorisations = new BankAuthorisationService(httpClient);
181185
this.bankDetailsLookups = new BankDetailsLookupService(httpClient);
182186
this.billingRequests = new BillingRequestService(httpClient);
@@ -204,6 +208,8 @@ private GoCardlessClient(HttpClient httpClient) {
204208
this.payerAuthorisations = new PayerAuthorisationService(httpClient);
205209
this.payerThemes = new PayerThemeService(httpClient);
206210
this.payments = new PaymentService(httpClient);
211+
this.paymentAccounts = new PaymentAccountService(httpClient);
212+
this.paymentAccountTransactions = new PaymentAccountTransactionService(httpClient);
207213
this.payouts = new PayoutService(httpClient);
208214
this.payoutItems = new PayoutItemService(httpClient);
209215
this.redirectFlows = new RedirectFlowService(httpClient);
@@ -231,6 +237,13 @@ public BankAccountDetailService bankAccountDetails() {
231237
return bankAccountDetails;
232238
}
233239

240+
/**
241+
* A service class for working with bank account holder verification resources.
242+
*/
243+
public BankAccountHolderVerificationService bankAccountHolderVerifications() {
244+
return bankAccountHolderVerifications;
245+
}
246+
234247
/**
235248
* A service class for working with bank authorisation resources.
236249
*/
@@ -420,6 +433,20 @@ public PaymentService payments() {
420433
return payments;
421434
}
422435

436+
/**
437+
* A service class for working with payment account resources.
438+
*/
439+
public PaymentAccountService paymentAccounts() {
440+
return paymentAccounts;
441+
}
442+
443+
/**
444+
* A service class for working with payment account transaction resources.
445+
*/
446+
public PaymentAccountTransactionService paymentAccountTransactions() {
447+
return paymentAccountTransactions;
448+
}
449+
423450
/**
424451
* A service class for working with payout resources.
425452
*/

src/main/java/com/gocardless/http/HttpClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class HttpClient {
3535
private static final String DISALLOWED_USER_AGENT_CHARACTERS =
3636
"[^\\w!#$%&'\\*\\+\\-\\.\\^`\\|~]";
3737
private static final String USER_AGENT =
38-
String.format("gocardless-pro-java/7.4.0 java/%s %s/%s %s/%s",
38+
String.format("gocardless-pro-java/7.5.0 java/%s %s/%s %s/%s",
3939
cleanUserAgentToken(System.getProperty("java.vm.specification.version")),
4040
cleanUserAgentToken(System.getProperty("java.vm.name")),
4141
cleanUserAgentToken(System.getProperty("java.version")),
@@ -49,7 +49,7 @@ public class HttpClient {
4949
builder.put("GoCardless-Version", "2015-07-06");
5050
builder.put("Accept", "application/json");
5151
builder.put("GoCardless-Client-Library", "gocardless-pro-java");
52-
builder.put("GoCardless-Client-Version", "7.4.0");
52+
builder.put("GoCardless-Client-Version", "7.5.0");
5353
HEADERS = builder.build();
5454
}
5555
private final OkHttpClient rawClient;
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
package com.gocardless.resources;
2+
3+
import com.google.gson.annotations.SerializedName;
4+
5+
/**
6+
* Represents a bank account holder verification resource returned from the API.
7+
*
8+
* Create a bank account holder verification for a bank account.
9+
*/
10+
public class BankAccountHolderVerification {
11+
private BankAccountHolderVerification() {
12+
// blank to prevent instantiation
13+
}
14+
15+
private String actualAccountName;
16+
private String id;
17+
private Result result;
18+
private Status status;
19+
private Type type;
20+
21+
/**
22+
* The actual account name returned by the recipient's bank, populated only in the case of a
23+
* partial match.
24+
*/
25+
public String getActualAccountName() {
26+
return actualAccountName;
27+
}
28+
29+
/**
30+
* The unique identifier for the bank account holder verification resource, e.g. "BAHV123".
31+
*/
32+
public String getId() {
33+
return id;
34+
}
35+
36+
/**
37+
* Result of the verification, could be one of
38+
* <ul>
39+
* <li>`full_match`: The verification has confirmed that the account name exactly matches the
40+
* details provided.</li>
41+
* <li>`partial_match`: The verification has confirmed that the account name is similar but does
42+
* not match to the details provided.</li>
43+
* <li>`no_match`: The verification concludes the provided name does not match the account
44+
* details.</li>
45+
* <li>`unable_to_match`: The verification could not be performed due to recipient bank issues
46+
* or technical issues</li>
47+
* </ul>
48+
*/
49+
public Result getResult() {
50+
return result;
51+
}
52+
53+
/**
54+
* The status of the bank account holder verification.
55+
* <ul>
56+
* <li>`pending`: We have triggered the verification, but the result has not come back yet.</li>
57+
* <li>`completed`: The verification is complete and is ready to be used.</li>
58+
* </ul>
59+
*
60+
*/
61+
public Status getStatus() {
62+
return status;
63+
}
64+
65+
/**
66+
* Type of the verification that has been performed eg. [Confirmation of
67+
* Payee](https://www.wearepay.uk/what-we-do/overlay-services/confirmation-of-payee/)
68+
*/
69+
public Type getType() {
70+
return type;
71+
}
72+
73+
public enum Result {
74+
@SerializedName("full_match")
75+
FULL_MATCH, @SerializedName("partial_match")
76+
PARTIAL_MATCH, @SerializedName("no_match")
77+
NO_MATCH, @SerializedName("unable_to_match")
78+
UNABLE_TO_MATCH, @SerializedName("unknown")
79+
UNKNOWN
80+
}
81+
82+
public enum Status {
83+
@SerializedName("pending")
84+
PENDING, @SerializedName("completed")
85+
COMPLETED, @SerializedName("unknown")
86+
UNKNOWN
87+
}
88+
89+
public enum Type {
90+
@SerializedName("confirmation_of_payee")
91+
CONFIRMATION_OF_PAYEE, @SerializedName("unknown")
92+
UNKNOWN
93+
}
94+
}

src/main/java/com/gocardless/resources/BillingRequest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ public String getPaymentReference() {
478478

479479
/**
480480
* On failure, automatically retry payments using [intelligent
481-
* retries](#success-intelligent-retries). Default is `false`.
481+
* retries](/success-plus/overview). Default is `false`.
482482
* <p class="notice">
483483
* <strong>Important</strong>: To be able to use intelligent retries, Success+ needs to be
484484
* enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus).
@@ -1386,9 +1386,10 @@ private CustomerBankAccount() {
13861386
private Map<String, Object> metadata;
13871387

13881388
/**
1389-
* Name of the account holder, as known by the bank. This field will be transliterated,
1390-
* upcased and truncated to 18 characters. This field is required unless the request
1391-
* includes a [customer bank account
1389+
* Name of the account holder, as known by the bank. The full name provided when the
1390+
* customer is created is stored and is available via the API, but is transliterated,
1391+
* upcased, and truncated to 18 characters in bank submissions. This field is required
1392+
* unless the request includes a [customer bank account
13921393
* token](#javascript-flow-customer-bank-account-tokens).
13931394
*/
13941395
public String getAccountHolderName() {
@@ -1756,7 +1757,7 @@ public String getPaymentReference() {
17561757

17571758
/**
17581759
* On failure, automatically retry payments using [intelligent
1759-
* retries](#success-intelligent-retries). Default is `false`.
1760+
* retries](/success-plus/overview). Default is `false`.
17601761
* <p class="notice">
17611762
* <strong>Important</strong>: To be able to use intelligent retries, Success+ needs to be
17621763
* enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus).

src/main/java/com/gocardless/resources/BillingRequestWithAction.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ public String getPaymentReference() {
680680

681681
/**
682682
* On failure, automatically retry payments using [intelligent
683-
* retries](#success-intelligent-retries). Default is `false`.
683+
* retries](/success-plus/overview). Default is `false`.
684684
* <p class="notice">
685685
* <strong>Important</strong>: To be able to use intelligent retries, Success+ needs to
686686
* be enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus).
@@ -1597,9 +1597,10 @@ private CustomerBankAccount() {
15971597
private Map<String, Object> metadata;
15981598

15991599
/**
1600-
* Name of the account holder, as known by the bank. This field will be
1601-
* transliterated, upcased and truncated to 18 characters. This field is required
1602-
* unless the request includes a [customer bank account
1600+
* Name of the account holder, as known by the bank. The full name provided when the
1601+
* customer is created is stored and is available via the API, but is
1602+
* transliterated, upcased, and truncated to 18 characters in bank submissions. This
1603+
* field is required unless the request includes a [customer bank account
16031604
* token](#javascript-flow-customer-bank-account-tokens).
16041605
*/
16051606
public String getAccountHolderName() {
@@ -1970,7 +1971,7 @@ public String getPaymentReference() {
19701971

19711972
/**
19721973
* On failure, automatically retry payments using [intelligent
1973-
* retries](#success-intelligent-retries). Default is `false`.
1974+
* retries](/success-plus/overview). Default is `false`.
19741975
* <p class="notice">
19751976
* <strong>Important</strong>: To be able to use intelligent retries, Success+ needs to
19761977
* be enabled in [GoCardless dashboard](https://manage.gocardless.com/success-plus).

src/main/java/com/gocardless/resources/CustomerBankAccount.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ private CustomerBankAccount() {
3838
private Map<String, Object> metadata;
3939

4040
/**
41-
* Name of the account holder, as known by the bank. This field will be transliterated, upcased
42-
* and truncated to 18 characters. This field is required unless the request includes a
41+
* Name of the account holder, as known by the bank. The full name provided when the customer is
42+
* created is stored and is available via the API, but is transliterated, upcased, and truncated
43+
* to 18 characters in bank submissions. This field is required unless the request includes a
4344
* [customer bank account token](#javascript-flow-customer-bank-account-tokens).
4445
*/
4546
public String getAccountHolderName() {

src/main/java/com/gocardless/resources/Event.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ private Links() {
352352
private String newCustomerBankAccount;
353353
private String newMandate;
354354
private String organisation;
355+
private String outboundPayment;
355356
private String parentEvent;
356357
private String payerAuthorisation;
357358
private String payment;
@@ -461,6 +462,14 @@ public String getOrganisation() {
461462
return organisation;
462463
}
463464

465+
/**
466+
* If `resource_type` is `outbound_payments`, this is the ID of the outbound_payment which
467+
* has been updated.
468+
*/
469+
public String getOutboundPayment() {
470+
return outboundPayment;
471+
}
472+
464473
/**
465474
* If this event was caused by another, this is the ID of the cause. For example, if a
466475
* mandate is cancelled it automatically cancels all pending payments associated with it; in

src/main/java/com/gocardless/resources/OutboundPayment.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
* GoCardless will notify you via a [webhook](#appendix-webhooks) when the status of the outbound
1212
* payment [changes](#event-types-outbound-payment).
1313
*
14-
* <p class="restricted-notice">
15-
* <strong>Restricted</strong>: Outbound Payments are currently in Early Access and available only
16-
* to a limited list of organisations. If you are interested in using this feature, please stay
17-
* tuned for our public launch announcement. We are actively testing and refining our API to ensure
18-
* it meets your needs and provides the best experience.
19-
* </p>
14+
* ####Rate limiting
15+
*
16+
* Two rate limits apply to the Outbound Payments APIs: - All POST Outbound Payment endpoints
17+
* (create, withdraw, approve, cancel and etc.) share a single rate-limit group of 300 requests per
18+
* minute. As initiating a payment typically requires two API calls (one to create the payment and
19+
* one to approve it), this allows you to add approximately 150 outbound payments per minute. - All
20+
* remaining Outbound Payment endpoints are limited to 500 requests per minute.
2021
*/
2122
public class OutboundPayment {
2223
private OutboundPayment() {

0 commit comments

Comments
 (0)