Skip to content

Commit 71c18b6

Browse files
authored
Merge branch 'master' into test-email
2 parents 6be4b1d + f6f7d34 commit 71c18b6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1707
-430
lines changed

.github/workflows/build.yml

Lines changed: 40 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,44 @@
1-
name: gocardless/gocardless-pro-java/build
2-
on: push
1+
name: build & test
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
types: [opened, reopened, synchronize]
38

49
jobs:
5-
test_library_jdk8:
6-
runs-on: ubuntu-latest
7-
container:
8-
image: openjdk:8
9-
steps:
10-
- uses: actions/checkout@v2
11-
- name: Test
12-
run: |-
13-
export TERM=${TERM:-dumb}
14-
./install_crypto_deps.sh
15-
./gradlew test
16-
- name: Save test results
17-
run: |-
18-
mkdir -p ~/junit
19-
find . -type f -regex "$OUT_DIR/build/test-results/test/.*xml" -exec cp {} ~/junit/ \;
20-
if: always()
21-
- uses: actions/upload-artifact@v2
22-
with:
23-
path: "~/junit"
24-
- uses: actions/upload-artifact@v2
25-
with:
26-
path: "~/junit"
27-
test_library_jdk9:
28-
runs-on: ubuntu-latest
29-
container:
30-
image: openjdk:9
31-
steps:
32-
- uses: actions/checkout@v2
33-
- name: Test
34-
run: |-
35-
export TERM=${TERM:-dumb}
36-
./install_crypto_deps.sh
37-
./gradlew test --debug
38-
- name: Save test results
39-
run: |-
40-
mkdir -p ~/junit
41-
find . -type f -regex "$OUT_DIR/build/test-results/test/.*xml" -exec cp {} ~/junit/ \;
42-
if: always()
43-
- uses: actions/upload-artifact@v2
44-
with:
45-
path: "~/junit"
46-
- uses: actions/upload-artifact@v2
47-
with:
48-
path: "~/junit"
49-
test_library_jdk11:
10+
test:
5011
runs-on: ubuntu-latest
51-
container:
52-
image: openjdk:11
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
jdk-version: [ 8, 9, 11 ]
5316
steps:
54-
- uses: actions/checkout@v2
55-
- name: Test
56-
run: |-
57-
export TERM=${TERM:-dumb}
58-
./install_crypto_deps.sh
59-
./gradlew test
60-
- name: Save test results
61-
run: |-
62-
mkdir -p ~/junit
63-
find . -type f -regex "$OUT_DIR/build/test-results/test/.*xml" -exec cp {} ~/junit/ \;
64-
if: always()
65-
- uses: actions/upload-artifact@v2
66-
with:
67-
path: "~/junit"
68-
- uses: actions/upload-artifact@v2
69-
with:
70-
path: "~/junit"
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-java@v2
19+
with:
20+
java-version: "${{ matrix.jdk-version }}"
21+
distribution: adopt
22+
- name: Verify java installed properly
23+
run: java -version
24+
- name: Grant execute permission for gradlew
25+
run: chmod +x gradlew
26+
# test
27+
- name: Test
28+
run: |-
29+
export TERM=${TERM:-dumb}
30+
./gradlew test --debug
31+
# test build
32+
- name: Build with Gradle
33+
run: ./gradlew build
34+
- name: Save test results
35+
if: always()
36+
run: |-
37+
mkdir -p ~/junit
38+
find . -type f -regex "./build/test-results/test/.*xml" -exec cp {} ~/junit/ \;
39+
- uses: actions/upload-artifact@v4
40+
if: always()
41+
with:
42+
name: test_library_jdk${{ matrix.jdk-version }}_junit
43+
path: "~/junit"
44+
retention-days: 7

.github/workflows/maven-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ jobs:
3131
- name: Publish package
3232
run: ./gradlew publishToSonatype closeAndReleaseStagingRepository -Psigning.keyId=${{secrets.SIGNING_KEY_ID}} -Psigning.password=${{secrets.SIGNING_KEY_PASSWORD}} -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg) -Dorg.gradle.internal.http.socketTimeout=300000 --stacktrace
3333
env:
34-
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
35-
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
34+
MAVEN_USERNAME: ${{ secrets.OSSRH_ACCESS_TOKEN_USERNAME }}
35+
MAVEN_PASSWORD: ${{ secrets.OSSRH_ACCESS_TOKEN_PASSWORD }}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ out/
2626
##############################
2727
## Visual Studio Code
2828
##############################
29-
.vscode/
29+
.vscode/
30+
31+
tmp-push-files-checkout/

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>5.14.2</version>
17+
<version>5.26.1</version>
1818
</dependency>
1919
```
2020

2121
With Gradle:
2222

2323
```
24-
implementation 'com.gocardless:gocardless-pro:5.14.2'
24+
implementation 'com.gocardless:gocardless-pro:5.26.1'
2525
```
2626

2727
## Initializing the client

build.gradle

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ buildscript {
22
repositories {
33
mavenCentral()
44
maven { url 'https://plugins.gradle.org/m2/' }
5+
jcenter()
6+
google()
7+
maven {
8+
url 'https://maven.google.com'
9+
}
510
}
611

712
dependencies {
@@ -20,12 +25,18 @@ plugins {
2025
sourceCompatibility = 1.8
2126
targetCompatibility = 1.8
2227
group = 'com.gocardless'
23-
version = '5.14.2'
28+
version = '5.26.1'
2429

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

2732
repositories {
2833
mavenCentral()
34+
maven { url 'https://plugins.gradle.org/m2/' }
35+
jcenter()
36+
google()
37+
maven {
38+
url 'https://maven.google.com'
39+
}
2940
}
3041

3142
dependencies {

gradlew

100755100644
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env sh
2+
set -x
23

34
##############################################################################
45
##

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,14 @@ public class GoCardlessClient {
2929
private final EventService events;
3030
private final InstalmentScheduleService instalmentSchedules;
3131
private final InstitutionService institutions;
32+
private final LogoService logos;
3233
private final MandateService mandates;
3334
private final MandateImportService mandateImports;
3435
private final MandateImportEntryService mandateImportEntries;
3536
private final MandatePdfService mandatePdfs;
37+
private final NegativeBalanceLimitService negativeBalanceLimits;
3638
private final PayerAuthorisationService payerAuthorisations;
39+
private final PayerThemeService payerThemes;
3740
private final PaymentService payments;
3841
private final PayoutService payouts;
3942
private final PayoutItemService payoutItems;
@@ -43,6 +46,7 @@ public class GoCardlessClient {
4346
private final SchemeIdentifierService schemeIdentifiers;
4447
private final SubscriptionService subscriptions;
4548
private final TaxRateService taxRates;
49+
private final TransferredMandateService transferredMandates;
4650
private final VerificationDetailService verificationDetails;
4751
private final WebhookService webhooks;
4852

@@ -181,11 +185,14 @@ private GoCardlessClient(HttpClient httpClient) {
181185
this.events = new EventService(httpClient);
182186
this.instalmentSchedules = new InstalmentScheduleService(httpClient);
183187
this.institutions = new InstitutionService(httpClient);
188+
this.logos = new LogoService(httpClient);
184189
this.mandates = new MandateService(httpClient);
185190
this.mandateImports = new MandateImportService(httpClient);
186191
this.mandateImportEntries = new MandateImportEntryService(httpClient);
187192
this.mandatePdfs = new MandatePdfService(httpClient);
193+
this.negativeBalanceLimits = new NegativeBalanceLimitService(httpClient);
188194
this.payerAuthorisations = new PayerAuthorisationService(httpClient);
195+
this.payerThemes = new PayerThemeService(httpClient);
189196
this.payments = new PaymentService(httpClient);
190197
this.payouts = new PayoutService(httpClient);
191198
this.payoutItems = new PayoutItemService(httpClient);
@@ -195,6 +202,7 @@ private GoCardlessClient(HttpClient httpClient) {
195202
this.schemeIdentifiers = new SchemeIdentifierService(httpClient);
196203
this.subscriptions = new SubscriptionService(httpClient);
197204
this.taxRates = new TaxRateService(httpClient);
205+
this.transferredMandates = new TransferredMandateService(httpClient);
198206
this.verificationDetails = new VerificationDetailService(httpClient);
199207
this.webhooks = new WebhookService(httpClient);
200208
}
@@ -304,6 +312,13 @@ public InstitutionService institutions() {
304312
return institutions;
305313
}
306314

315+
/**
316+
* A service class for working with logo resources.
317+
*/
318+
public LogoService logos() {
319+
return logos;
320+
}
321+
307322
/**
308323
* A service class for working with mandate resources.
309324
*/
@@ -332,13 +347,27 @@ public MandatePdfService mandatePdfs() {
332347
return mandatePdfs;
333348
}
334349

350+
/**
351+
* A service class for working with negative balance limit resources.
352+
*/
353+
public NegativeBalanceLimitService negativeBalanceLimits() {
354+
return negativeBalanceLimits;
355+
}
356+
335357
/**
336358
* A service class for working with payer authorisation resources.
337359
*/
338360
public PayerAuthorisationService payerAuthorisations() {
339361
return payerAuthorisations;
340362
}
341363

364+
/**
365+
* A service class for working with payer theme resources.
366+
*/
367+
public PayerThemeService payerThemes() {
368+
return payerThemes;
369+
}
370+
342371
/**
343372
* A service class for working with payment resources.
344373
*/
@@ -402,6 +431,13 @@ public TaxRateService taxRates() {
402431
return taxRates;
403432
}
404433

434+
/**
435+
* A service class for working with transferred mandate resources.
436+
*/
437+
public TransferredMandateService transferredMandates() {
438+
return transferredMandates;
439+
}
440+
405441
/**
406442
* A service class for working with verification detail resources.
407443
*/

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

Lines changed: 3 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/5.14.1 java/%s %s/%s %s/%s",
38+
String.format("gocardless-pro-java/5.26.1 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")),
@@ -47,8 +47,9 @@ public class HttpClient {
4747
static {
4848
ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
4949
builder.put("GoCardless-Version", "2015-07-06");
50+
builder.put("Accept", "application/json");
5051
builder.put("GoCardless-Client-Library", "gocardless-pro-java");
51-
builder.put("GoCardless-Client-Version", "5.14.1");
52+
builder.put("GoCardless-Client-Version", "5.26.1");
5253
HEADERS = builder.build();
5354
}
5455
private final OkHttpClient rawClient;

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ private BankAuthorisation() {
2323
private String id;
2424
private String lastVisitedAt;
2525
private Links links;
26+
private String qrCodeUrl;
2627
private String redirectUri;
2728
private String url;
2829

@@ -74,6 +75,15 @@ public Links getLinks() {
7475
return links;
7576
}
7677

78+
/**
79+
* URL to a QR code PNG image of the bank authorisation url. This QR code can be used as an
80+
* alternative to providing the `url` to the payer to allow them to authorise with their mobile
81+
* devices.
82+
*/
83+
public String getQrCodeUrl() {
84+
return qrCodeUrl;
85+
}
86+
7787
/**
7888
* URL that the payer can be redirected to after authorising the payment.
7989
*

0 commit comments

Comments
 (0)