Skip to content

Commit 1d47e02

Browse files
authored
Merge pull request #22 from BlinkPay/feature/bd-784
BD-784: Bumped dependencies and updated data transfer objects based o…
2 parents f038a32 + 9d1f693 commit 1d47e02

File tree

71 files changed

+1739
-1516
lines changed

Some content is hidden

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

71 files changed

+1739
-1516
lines changed

.github/workflows/maven-build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616

1717
- name: Set up 64-bit Corretto 21
1818
uses: actions/setup-java@v4

.github/workflows/maven-deploy.yml

+17-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ jobs:
99
publish:
1010
runs-on: ubuntu-latest
1111
environment: production
12-
if: github.ref == 'refs/heads/master'
12+
if: github.event.release.target_commitish == 'master' || startsWith(github.event.release.target_commitish, 'release/')
1313

1414
steps:
15-
- uses: actions/checkout@v4
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
1617

17-
- name: Set up Apache Maven Central
18+
- name: Set up JDK 21 (Corretto)
1819
uses: actions/setup-java@v4
1920
with:
2021
java-version: '21'
@@ -25,9 +26,21 @@ jobs:
2526
server-password: MAVEN_PASSWORD
2627
gpg-passphrase: MAVEN_GPG_PASSPHRASE
2728

29+
- name: Cache Maven dependencies
30+
uses: actions/cache@v4
31+
with:
32+
path: ~/.m2/repository
33+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
34+
restore-keys: |
35+
${{ runner.os }}-maven-
36+
2837
- name: Install GPG secret key
2938
run: |
30-
cat <(echo -e "${{ secrets.OSSRH_GPG_PRIVATE_KEY }}") | gpg --batch --import
39+
echo "${{ secrets.OSSRH_GPG_PRIVATE_KEY }}" | gpg --batch --yes --import
40+
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
41+
echo "use-agent" >> ~/.gnupg/gpg.conf
42+
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
43+
gpgconf --kill gpg-agent
3144
gpg --list-secret-keys --keyid-format LONG
3245
3346
- name: Publish to Apache Maven Central

core/pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
<parent>
66
<groupId>nz.co.blinkpay</groupId>
77
<artifactId>blink-debit-api-client-java-parent</artifactId>
8-
<version>1.3.0</version>
8+
<version>1.4.0</version>
99
</parent>
1010

1111
<modelVersion>4.0.0</modelVersion>
1212
<artifactId>blink-debit-api-client-java-core</artifactId>
13-
<version>1.3.0</version>
13+
<version>1.4.0</version>
1414

1515
<name>blink-debit-api-client-java-core</name>
1616
<description>Blink Debit API Client shared library</description>
@@ -21,7 +21,7 @@
2121
<maven.compiler.source>${java.version}</maven.compiler.source>
2222
<maven.compiler.target>${java.version}</maven.compiler.target>
2323

24-
<snakeyaml.version>2.3</snakeyaml.version>
24+
<snakeyaml.version>2.4</snakeyaml.version>
2525
<system.stubs.jupiter.version>2.1.7</system.stubs.jupiter.version>
2626
</properties>
2727

core/src/main/java/nz/co/blink/debit/enums/BlinkDebitConstant.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public enum BlinkDebitConstant {
5757

5858
REFUNDS_PATH("/payments/v1/refunds"),
5959

60-
USER_AGENT_VALUE("Java/Blink SDK 1.3");
60+
USER_AGENT_VALUE("Java/Blink SDK 1.4");
6161

6262
private final String value;
6363

java-spring6/pom.xml

+26-14
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,34 @@
55
<parent>
66
<groupId>nz.co.blinkpay</groupId>
77
<artifactId>blink-debit-api-client-java-parent</artifactId>
8-
<version>1.3.0</version>
8+
<version>1.4.0</version>
99
</parent>
1010

1111
<modelVersion>4.0.0</modelVersion>
1212
<artifactId>blink-debit-api-client-java-spring6</artifactId>
13-
<version>1.3.0</version>
13+
<version>1.4.0</version>
1414

1515
<name>blink-debit-api-client-java-spring6</name>
16-
<description>Blink Debit API Client for Java 17 and Spring Framework 6 / Spring Boot 3</description>
16+
<description>Blink Debit API Client for Java 21 and Spring Framework 6 / Spring Boot 3</description>
1717
<url>https://www.blinkpay.co.nz</url>
1818

1919
<properties>
2020
<java.version>21</java.version>
2121
<maven.compiler.source>${java.version}</maven.compiler.source>
2222
<maven.compiler.target>${java.version}</maven.compiler.target>
2323

24-
<core.version>1.3.0</core.version>
25-
<spring.boot.version>3.3.4</spring.boot.version>
26-
<spring.cloud.starter.circuitbreaker.reactor.resilience4j.version>3.1.2</spring.cloud.starter.circuitbreaker.reactor.resilience4j.version>
27-
<resilience4j.version>2.2.0</resilience4j.version>
28-
<swagger.version>2.2.25</swagger.version>
29-
<java.jwt.version>4.4.0</java.jwt.version>
30-
<slf4j.version>2.0.16</slf4j.version>
31-
<logback.version>1.5.11</logback.version>
24+
<core.version>1.4.0</core.version>
25+
<spring.boot.version>3.4.4</spring.boot.version>
26+
<spring.security.version>6.4.4</spring.security.version>
27+
<spring.cloud.starter.circuitbreaker.reactor.resilience4j.version>3.2.1</spring.cloud.starter.circuitbreaker.reactor.resilience4j.version>
28+
<resilience4j.version>2.3.0</resilience4j.version>
29+
<swagger.version>2.2.29</swagger.version>
30+
<java.jwt.version>4.5.0</java.jwt.version>
31+
<slf4j.version>2.0.17</slf4j.version>
32+
<logback.version>1.5.18</logback.version>
3233

33-
<spring.cloud.contract.wiremock.version>4.1.4</spring.cloud.contract.wiremock.version>
34-
<reactor.test.version>3.6.11</reactor.test.version>
34+
<spring.cloud.contract.wiremock.version>4.2.1</spring.cloud.contract.wiremock.version>
35+
<reactor.test.version>3.7.4</reactor.test.version>
3536
</properties>
3637

3738
<dependencies>
@@ -151,6 +152,17 @@
151152
</dependency>
152153
</dependencies>
153154

155+
<dependencyManagement>
156+
<dependencies>
157+
<!-- Force fix for CVE-2025-22228 -->
158+
<dependency>
159+
<groupId>org.springframework.security</groupId>
160+
<artifactId>spring-security-crypto</artifactId>
161+
<version>${spring.security.version}</version>
162+
</dependency>
163+
</dependencies>
164+
</dependencyManagement>
165+
154166
<build>
155167
<plugins>
156168
<plugin>
@@ -173,7 +185,7 @@
173185
<profile>
174186
<id>versioning</id>
175187
<properties>
176-
<revision>1.1.0</revision>
188+
<revision>1.4.0</revision>
177189
</properties>
178190
</profile>
179191
</profiles>

java-spring6/src/componentTest/java/nz/co/blink/debit/client/v1/EnduringConsentsApiClientComponentTest.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ void getEnduringConsentWithRedirectFlow() throws BlinkServiceException {
150150
Consent actual = consentMono.block();
151151
assertThat(actual)
152152
.isNotNull()
153-
.extracting(Consent::getStatus, Consent::getAccounts, Consent::getPayments)
154-
.containsExactly(Consent.StatusEnum.AWAITINGAUTHORISATION, null, Collections.emptySet());
153+
.extracting(Consent::getStatus, Consent::getPayments, Consent::getCardNetwork)
154+
.containsExactly(Consent.StatusEnum.AWAITINGAUTHORISATION, Collections.emptyList(), null);
155155
assertThat(actual.getCreationTimestamp()).isNotNull();
156156
assertThat(actual.getStatusUpdatedTimestamp()).isNotNull();
157157
assertThat(actual.getDetail())
@@ -223,8 +223,8 @@ void getEnduringConsentWithDecoupledFlow() throws BlinkServiceException {
223223
Consent actual = consentMono.block();
224224
assertThat(actual)
225225
.isNotNull()
226-
.extracting(Consent::getStatus, Consent::getAccounts, Consent::getPayments)
227-
.containsExactly(Consent.StatusEnum.AUTHORISED, null, Collections.emptySet());
226+
.extracting(Consent::getStatus, Consent::getPayments, Consent::getCardNetwork)
227+
.containsExactly(Consent.StatusEnum.AUTHORISED, Collections.emptyList(), null);
228228
assertThat(actual.getCreationTimestamp()).isNotNull();
229229
assertThat(actual.getStatusUpdatedTimestamp()).isNotNull();
230230
assertThat(actual.getDetail())
@@ -322,8 +322,8 @@ void getEnduringConsentWithGatewayFlow() throws BlinkServiceException {
322322
Consent actual = consentMono.block();
323323
assertThat(actual)
324324
.isNotNull()
325-
.extracting(Consent::getStatus, Consent::getAccounts, Consent::getPayments)
326-
.containsExactly(Consent.StatusEnum.GATEWAYAWAITINGSUBMISSION, null, Collections.emptySet());
325+
.extracting(Consent::getStatus, Consent::getPayments, Consent::getCardNetwork)
326+
.containsExactly(Consent.StatusEnum.GATEWAYAWAITINGSUBMISSION, Collections.emptyList(), null);
327327
assertThat(actual.getCreationTimestamp()).isNotNull();
328328
assertThat(actual.getStatusUpdatedTimestamp()).isNull();
329329
assertThat(actual.getDetail())

java-spring6/src/componentTest/java/nz/co/blink/debit/client/v1/MetaApiClientComponentTest.java

+34-3
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,17 @@
2424
import io.github.resilience4j.retry.Retry;
2525
import nz.co.blink.debit.config.BlinkDebitConfiguration;
2626
import nz.co.blink.debit.config.BlinkPayProperties;
27+
import nz.co.blink.debit.dto.v1.Amount;
2728
import nz.co.blink.debit.dto.v1.Bank;
2829
import nz.co.blink.debit.dto.v1.BankMetadata;
2930
import nz.co.blink.debit.dto.v1.BankmetadataFeatures;
31+
import nz.co.blink.debit.dto.v1.BankmetadataFeaturesCardPayment;
3032
import nz.co.blink.debit.dto.v1.BankmetadataFeaturesDecoupledFlow;
3133
import nz.co.blink.debit.dto.v1.BankmetadataFeaturesDecoupledFlowAvailableIdentifiers;
3234
import nz.co.blink.debit.dto.v1.BankmetadataFeaturesEnduringConsent;
3335
import nz.co.blink.debit.dto.v1.BankmetadataRedirectFlow;
36+
import nz.co.blink.debit.dto.v1.CardNetwork;
37+
import nz.co.blink.debit.dto.v1.CardPaymentType;
3438
import nz.co.blink.debit.dto.v1.IdentifierType;
3539
import nz.co.blink.debit.exception.BlinkServiceException;
3640
import nz.co.blink.debit.helpers.AccessTokenHandler;
@@ -49,6 +53,7 @@
4953

5054
import java.util.Collections;
5155
import java.util.HashSet;
56+
import java.util.List;
5257
import java.util.Set;
5358
import java.util.stream.Stream;
5459

@@ -96,6 +101,9 @@ void setUp() {
96101
void getMeta() throws BlinkServiceException {
97102
BankMetadata bnz = new BankMetadata()
98103
.name(Bank.BNZ)
104+
.paymentLimit(new Amount()
105+
.currency(Amount.CurrencyEnum.NZD)
106+
.total("50000"))
99107
.features(new BankmetadataFeatures()
100108
.decoupledFlow(new BankmetadataFeaturesDecoupledFlow()
101109
.enabled(true)
@@ -113,6 +121,9 @@ void getMeta() throws BlinkServiceException {
113121

114122
BankMetadata pnz = new BankMetadata()
115123
.name(Bank.PNZ)
124+
.paymentLimit(new Amount()
125+
.currency(Amount.CurrencyEnum.NZD)
126+
.total("50000"))
116127
.features(new BankmetadataFeatures()
117128
.enduringConsent(new BankmetadataFeaturesEnduringConsent()
118129
.enabled(true)
@@ -134,13 +145,19 @@ void getMeta() throws BlinkServiceException {
134145

135146
BankMetadata westpac = new BankMetadata()
136147
.name(Bank.WESTPAC)
148+
.paymentLimit(new Amount()
149+
.currency(Amount.CurrencyEnum.NZD)
150+
.total("10000"))
137151
.features(new BankmetadataFeatures())
138152
.redirectFlow(new BankmetadataRedirectFlow()
139153
.enabled(true)
140154
.requestTimeout("PT10M"));
141155

142156
BankMetadata asb = new BankMetadata()
143157
.name(Bank.ASB)
158+
.paymentLimit(new Amount()
159+
.currency(Amount.CurrencyEnum.NZD)
160+
.total("30000"))
144161
.features(new BankmetadataFeatures()
145162
.enduringConsent(new BankmetadataFeaturesEnduringConsent()
146163
.enabled(true)
@@ -151,6 +168,9 @@ void getMeta() throws BlinkServiceException {
151168

152169
BankMetadata anz = new BankMetadata()
153170
.name(Bank.ANZ)
171+
.paymentLimit(new Amount()
172+
.currency(Amount.CurrencyEnum.NZD)
173+
.total("1000"))
154174
.features(new BankmetadataFeatures()
155175
.decoupledFlow(new BankmetadataFeaturesDecoupledFlow()
156176
.enabled(true)
@@ -161,7 +181,17 @@ void getMeta() throws BlinkServiceException {
161181
.toList())
162182
.requestTimeout("PT7M")))
163183
.redirectFlow(new BankmetadataRedirectFlow()
164-
.enabled(false));
184+
.enabled(true)
185+
.requestTimeout("PT10M"));
186+
187+
BankMetadata cybersource = new BankMetadata()
188+
.name(Bank.CYBERSOURCE)
189+
.features(new BankmetadataFeatures()
190+
.cardPayment(new BankmetadataFeaturesCardPayment()
191+
.enabled(true)
192+
.allowedCardPaymentTypes(List.of(CardPaymentType.PANENTRY, CardPaymentType.GOOGLEPAY))
193+
.allowedCardNetworks(List.of(CardNetwork.VISA, CardNetwork.MASTERCARD,
194+
CardNetwork.AMEX))));
165195

166196
Flux<BankMetadata> actual = client.getMeta();
167197

@@ -174,9 +204,10 @@ void getMeta() throws BlinkServiceException {
174204
.consumeNextWith(set::add)
175205
.consumeNextWith(set::add)
176206
.consumeNextWith(set::add)
207+
.consumeNextWith(set::add)
177208
.verifyComplete();
178209
assertThat(set)
179-
.hasSize(5)
180-
.containsExactlyInAnyOrder(bnz, pnz, westpac, asb, anz);
210+
.hasSize(6)
211+
.containsExactlyInAnyOrder(bnz, pnz, westpac, asb, anz, cybersource);
181212
}
182213
}

java-spring6/src/componentTest/java/nz/co/blink/debit/client/v1/PaymentsApiClientComponentTest.java

+12-17
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import nz.co.blink.debit.config.BlinkDebitConfiguration;
2626
import nz.co.blink.debit.config.BlinkPayProperties;
2727
import nz.co.blink.debit.dto.v1.Amount;
28-
import nz.co.blink.debit.dto.v1.EnduringPaymentRequest;
2928
import nz.co.blink.debit.dto.v1.Payment;
3029
import nz.co.blink.debit.dto.v1.PaymentRequest;
3130
import nz.co.blink.debit.dto.v1.PaymentResponse;
@@ -131,8 +130,7 @@ void getPaymentForSingleConsent() throws BlinkServiceException {
131130
PaymentRequest paymentRequest = actual.getDetail();
132131
assertThat(paymentRequest)
133132
.isNotNull()
134-
.extracting(PaymentRequest::getConsentId, PaymentRequest::getAccountReferenceId,
135-
PaymentRequest::getEnduringPayment)
133+
.extracting(PaymentRequest::getConsentId, PaymentRequest::getPcr, PaymentRequest::getAmount)
136134
.containsExactly(UUID.fromString("c14427fb-8ae8-4e5f-8685-3f6ab4c2f99a"), null, null);
137135
}
138136

@@ -142,14 +140,13 @@ void getPaymentForSingleConsent() throws BlinkServiceException {
142140
void createEnduringPayment() throws BlinkServiceException {
143141
PaymentRequest request = new PaymentRequest()
144142
.consentId(UUID.fromString("0500c560-c156-439f-9aed-753d82884323"))
145-
.enduringPayment(new EnduringPaymentRequest()
146-
.amount(new Amount()
147-
.currency(Amount.CurrencyEnum.NZD)
148-
.total("45.00"))
149-
.pcr(new Pcr()
150-
.particulars("particulars")
151-
.code("code")
152-
.reference("reference")));
143+
.amount(new Amount()
144+
.currency(Amount.CurrencyEnum.NZD)
145+
.total("45.00"))
146+
.pcr(new Pcr()
147+
.particulars("particulars")
148+
.code("code")
149+
.reference("reference"));
153150

154151
Mono<PaymentResponse> paymentResponseMono = client.createPayment(request);
155152

@@ -180,15 +177,13 @@ void getPaymentForEnduringConsent() throws BlinkServiceException {
180177
PaymentRequest paymentRequest = actual.getDetail();
181178
assertThat(paymentRequest)
182179
.isNotNull()
183-
.extracting(PaymentRequest::getConsentId, PaymentRequest::getAccountReferenceId)
184-
.containsExactly(UUID.fromString("0500c560-c156-439f-9aed-753d82884323"), null);
185-
EnduringPaymentRequest enduringPaymentRequest = paymentRequest.getEnduringPayment();
186-
assertThat(enduringPaymentRequest).isNotNull();
187-
assertThat(enduringPaymentRequest.getAmount())
180+
.extracting(PaymentRequest::getConsentId)
181+
.isEqualTo(UUID.fromString("0500c560-c156-439f-9aed-753d82884323"));
182+
assertThat(paymentRequest.getAmount())
188183
.isNotNull()
189184
.extracting(Amount::getCurrency, Amount::getTotal)
190185
.containsExactly(Amount.CurrencyEnum.NZD, "45.00");
191-
assertThat(enduringPaymentRequest.getPcr())
186+
assertThat(paymentRequest.getPcr())
192187
.isNotNull()
193188
.extracting(Pcr::getParticulars, Pcr::getCode, Pcr::getReference)
194189
.containsExactly("particulars", "code", "reference");

java-spring6/src/componentTest/java/nz/co/blink/debit/client/v1/QuickPaymentsApiClientComponentTest.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ void getQuickPaymentWithRedirectFlow() throws BlinkServiceException {
157157
Consent consent = actual.getConsent();
158158
assertThat(consent)
159159
.isNotNull()
160-
.extracting(Consent::getStatus, Consent::getAccounts, Consent::getPayments)
161-
.containsExactly(Consent.StatusEnum.AWAITINGAUTHORISATION, null, Collections.emptySet());
160+
.extracting(Consent::getStatus, Consent::getPayments, Consent::getCardNetwork)
161+
.containsExactly(Consent.StatusEnum.AWAITINGAUTHORISATION, Collections.emptyList(), null);
162162
assertThat(consent.getCreationTimestamp()).isNotNull();
163163
assertThat(consent.getStatusUpdatedTimestamp()).isNotNull();
164164
assertThat(consent.getDetail())
@@ -269,8 +269,8 @@ void getQuickPaymentWithGatewayFlow() throws BlinkServiceException {
269269
Consent consent = actual.getConsent();
270270
assertThat(consent)
271271
.isNotNull()
272-
.extracting(Consent::getStatus, Consent::getAccounts, Consent::getPayments)
273-
.containsExactly(Consent.StatusEnum.GATEWAYAWAITINGSUBMISSION, null, Collections.emptySet());
272+
.extracting(Consent::getStatus, Consent::getPayments, Consent::getCardNetwork)
273+
.containsExactly(Consent.StatusEnum.GATEWAYAWAITINGSUBMISSION, Collections.emptyList(), null);
274274
assertThat(consent.getCreationTimestamp()).isNotNull();
275275
assertThat(consent.getStatusUpdatedTimestamp()).isNull();
276276
assertThat(consent.getDetail())
@@ -349,7 +349,7 @@ void getQuickPaymentWithDecoupledFlow() throws BlinkServiceException {
349349
Consent consent = actual.getConsent();
350350
assertThat(consent)
351351
.isNotNull()
352-
.extracting(Consent::getStatus, Consent::getAccounts)
352+
.extracting(Consent::getStatus, Consent::getCardNetwork)
353353
.containsExactly(Consent.StatusEnum.CONSUMED, null);
354354
assertThat(consent.getPayments())
355355
.isNotNull()

0 commit comments

Comments
 (0)