Skip to content

Commit

Permalink
Merge branch 'master' into test-email
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-nef authored Jul 12, 2024
2 parents 6be4b1d + f6f7d34 commit 71c18b6
Show file tree
Hide file tree
Showing 55 changed files with 1,707 additions and 430 deletions.
106 changes: 40 additions & 66 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,44 @@
name: gocardless/gocardless-pro-java/build
on: push
name: build & test

on:
push:
branches: [master]
pull_request:
types: [opened, reopened, synchronize]

jobs:
test_library_jdk8:
runs-on: ubuntu-latest
container:
image: openjdk:8
steps:
- uses: actions/checkout@v2
- name: Test
run: |-
export TERM=${TERM:-dumb}
./install_crypto_deps.sh
./gradlew test
- name: Save test results
run: |-
mkdir -p ~/junit
find . -type f -regex "$OUT_DIR/build/test-results/test/.*xml" -exec cp {} ~/junit/ \;
if: always()
- uses: actions/upload-artifact@v2
with:
path: "~/junit"
- uses: actions/upload-artifact@v2
with:
path: "~/junit"
test_library_jdk9:
runs-on: ubuntu-latest
container:
image: openjdk:9
steps:
- uses: actions/checkout@v2
- name: Test
run: |-
export TERM=${TERM:-dumb}
./install_crypto_deps.sh
./gradlew test --debug
- name: Save test results
run: |-
mkdir -p ~/junit
find . -type f -regex "$OUT_DIR/build/test-results/test/.*xml" -exec cp {} ~/junit/ \;
if: always()
- uses: actions/upload-artifact@v2
with:
path: "~/junit"
- uses: actions/upload-artifact@v2
with:
path: "~/junit"
test_library_jdk11:
test:
runs-on: ubuntu-latest
container:
image: openjdk:11
strategy:
fail-fast: false
matrix:
jdk-version: [ 8, 9, 11 ]
steps:
- uses: actions/checkout@v2
- name: Test
run: |-
export TERM=${TERM:-dumb}
./install_crypto_deps.sh
./gradlew test
- name: Save test results
run: |-
mkdir -p ~/junit
find . -type f -regex "$OUT_DIR/build/test-results/test/.*xml" -exec cp {} ~/junit/ \;
if: always()
- uses: actions/upload-artifact@v2
with:
path: "~/junit"
- uses: actions/upload-artifact@v2
with:
path: "~/junit"
- uses: actions/checkout@v4
- uses: actions/setup-java@v2
with:
java-version: "${{ matrix.jdk-version }}"
distribution: adopt
- name: Verify java installed properly
run: java -version
- name: Grant execute permission for gradlew
run: chmod +x gradlew
# test
- name: Test
run: |-
export TERM=${TERM:-dumb}
./gradlew test --debug
# test build
- name: Build with Gradle
run: ./gradlew build
- name: Save test results
if: always()
run: |-
mkdir -p ~/junit
find . -type f -regex "./build/test-results/test/.*xml" -exec cp {} ~/junit/ \;
- uses: actions/upload-artifact@v4
if: always()
with:
name: test_library_jdk${{ matrix.jdk-version }}_junit
path: "~/junit"
retention-days: 7
4 changes: 2 additions & 2 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ jobs:
- name: Publish package
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
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.OSSRH_ACCESS_TOKEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_ACCESS_TOKEN_PASSWORD }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ out/
##############################
## Visual Studio Code
##############################
.vscode/
.vscode/

tmp-push-files-checkout/
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.14.2</version>
<version>5.26.1</version>
</dependency>
```

With Gradle:

```
implementation 'com.gocardless:gocardless-pro:5.14.2'
implementation 'com.gocardless:gocardless-pro:5.26.1'
```

## Initializing the client
Expand Down
13 changes: 12 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ buildscript {
repositories {
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
jcenter()
google()
maven {
url 'https://maven.google.com'
}
}

dependencies {
Expand All @@ -20,12 +25,18 @@ plugins {
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'com.gocardless'
version = '5.14.2'
version = '5.26.1'

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

repositories {
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
jcenter()
google()
maven {
url 'https://maven.google.com'
}
}

dependencies {
Expand Down
1 change: 1 addition & 0 deletions gradlew
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env sh
set -x

##############################################################################
##
Expand Down
36 changes: 36 additions & 0 deletions src/main/java/com/gocardless/GoCardlessClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ public class GoCardlessClient {
private final EventService events;
private final InstalmentScheduleService instalmentSchedules;
private final InstitutionService institutions;
private final LogoService logos;
private final MandateService mandates;
private final MandateImportService mandateImports;
private final MandateImportEntryService mandateImportEntries;
private final MandatePdfService mandatePdfs;
private final NegativeBalanceLimitService negativeBalanceLimits;
private final PayerAuthorisationService payerAuthorisations;
private final PayerThemeService payerThemes;
private final PaymentService payments;
private final PayoutService payouts;
private final PayoutItemService payoutItems;
Expand All @@ -43,6 +46,7 @@ public class GoCardlessClient {
private final SchemeIdentifierService schemeIdentifiers;
private final SubscriptionService subscriptions;
private final TaxRateService taxRates;
private final TransferredMandateService transferredMandates;
private final VerificationDetailService verificationDetails;
private final WebhookService webhooks;

Expand Down Expand Up @@ -181,11 +185,14 @@ private GoCardlessClient(HttpClient httpClient) {
this.events = new EventService(httpClient);
this.instalmentSchedules = new InstalmentScheduleService(httpClient);
this.institutions = new InstitutionService(httpClient);
this.logos = new LogoService(httpClient);
this.mandates = new MandateService(httpClient);
this.mandateImports = new MandateImportService(httpClient);
this.mandateImportEntries = new MandateImportEntryService(httpClient);
this.mandatePdfs = new MandatePdfService(httpClient);
this.negativeBalanceLimits = new NegativeBalanceLimitService(httpClient);
this.payerAuthorisations = new PayerAuthorisationService(httpClient);
this.payerThemes = new PayerThemeService(httpClient);
this.payments = new PaymentService(httpClient);
this.payouts = new PayoutService(httpClient);
this.payoutItems = new PayoutItemService(httpClient);
Expand All @@ -195,6 +202,7 @@ private GoCardlessClient(HttpClient httpClient) {
this.schemeIdentifiers = new SchemeIdentifierService(httpClient);
this.subscriptions = new SubscriptionService(httpClient);
this.taxRates = new TaxRateService(httpClient);
this.transferredMandates = new TransferredMandateService(httpClient);
this.verificationDetails = new VerificationDetailService(httpClient);
this.webhooks = new WebhookService(httpClient);
}
Expand Down Expand Up @@ -304,6 +312,13 @@ public InstitutionService institutions() {
return institutions;
}

/**
* A service class for working with logo resources.
*/
public LogoService logos() {
return logos;
}

/**
* A service class for working with mandate resources.
*/
Expand Down Expand Up @@ -332,13 +347,27 @@ public MandatePdfService mandatePdfs() {
return mandatePdfs;
}

/**
* A service class for working with negative balance limit resources.
*/
public NegativeBalanceLimitService negativeBalanceLimits() {
return negativeBalanceLimits;
}

/**
* A service class for working with payer authorisation resources.
*/
public PayerAuthorisationService payerAuthorisations() {
return payerAuthorisations;
}

/**
* A service class for working with payer theme resources.
*/
public PayerThemeService payerThemes() {
return payerThemes;
}

/**
* A service class for working with payment resources.
*/
Expand Down Expand Up @@ -402,6 +431,13 @@ public TaxRateService taxRates() {
return taxRates;
}

/**
* A service class for working with transferred mandate resources.
*/
public TransferredMandateService transferredMandates() {
return transferredMandates;
}

/**
* A service class for working with verification detail resources.
*/
Expand Down
5 changes: 3 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.14.1 java/%s %s/%s %s/%s",
String.format("gocardless-pro-java/5.26.1 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 @@ -47,8 +47,9 @@ public class HttpClient {
static {
ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
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.14.1");
builder.put("GoCardless-Client-Version", "5.26.1");
HEADERS = builder.build();
}
private final OkHttpClient rawClient;
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/gocardless/resources/BankAuthorisation.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ private BankAuthorisation() {
private String id;
private String lastVisitedAt;
private Links links;
private String qrCodeUrl;
private String redirectUri;
private String url;

Expand Down Expand Up @@ -74,6 +75,15 @@ public Links getLinks() {
return links;
}

/**
* URL to a QR code PNG image of the bank authorisation url. This QR code can be used as an
* alternative to providing the `url` to the payer to allow them to authorise with their mobile
* devices.
*/
public String getQrCodeUrl() {
return qrCodeUrl;
}

/**
* URL that the payer can be redirected to after authorising the payment.
*
Expand Down
Loading

0 comments on commit 71c18b6

Please sign in to comment.