Skip to content

Commit d471bbf

Browse files
authored
Merge pull request #821 from Adyen/develop
Release 18.1.1
2 parents b1069b1 + 34ceb10 commit d471bbf

File tree

15 files changed

+827
-10
lines changed

15 files changed

+827
-10
lines changed

.github/workflows/javaci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
distribution: 'adopt'
1717

1818
- name: Run the tests with Maven
19-
run: mvn test
19+
run: mvn -B test --no-transfer-progress

.github/workflows/models.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Java Models
2+
3+
on: [ workflow_dispatch ]
4+
5+
jobs:
6+
generate:
7+
runs-on: ubuntu-latest
8+
name: Generate Models
9+
steps:
10+
- uses: actions/checkout@v3
11+
- run: make models
12+
- name: Set PR variables
13+
id: vars
14+
run: |
15+
cd target/spec
16+
echo ::set-output name=pr_title::"Update models"
17+
echo ::set-output name=pr_body::"OpenAPI spec or templates produced new models on $(date +%d-%m-%Y) \
18+
by [commit](https://github.com/Adyen/adyen-openapi/commit/$(git rev-parse HEAD))."
19+
- name: Create Pull Request
20+
uses: peter-evans/create-pull-request@v4
21+
with:
22+
token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }}
23+
committer: ${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }}
24+
author: ${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }}
25+
base: develop
26+
branch: automation/models
27+
title: ${{ steps.vars.outputs.pr_title }}
28+
body: ${{ steps.vars.outputs.pr_body }}
29+
add-paths: |
30+
src/main/java/com/adyen/model

.openapi-generator-ignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These models cannot properly represent additional data, a `Map<String, String>` is used instead
2+
target/out/src/main/java/com/adyen/model/payments/AdditionalData*
3+
target/out/src/main/java/com/adyen/model/payments/ResponseAdditionalData*

Makefile

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
openapi-generator-version:=6.0.1
2+
openapi-generator-url:=https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/$(openapi-generator-version)/openapi-generator-cli-$(openapi-generator-version).jar
3+
openapi-generator-jar:=target/openapi-generator-cli.jar
4+
openapi-generator-cli:=java -jar $(openapi-generator-jar)
5+
6+
generator:=java
7+
library:=okhttp-gson
8+
services:=payments
9+
models:=src/main/java/com/adyen/model
10+
output:=target/out
11+
12+
13+
# Generate models (for each service)
14+
models: $(services)
15+
16+
binlookup: spec=BinLookupService-v52
17+
checkout: spec=CheckoutService-v69
18+
storedValue: spec=StoredValueService-v46
19+
posterminalmanagement: spec=TfmAPIService-v1
20+
payments: spec=PaymentService-v68
21+
recurring: spec=RecurringService-v68
22+
payout: spec=PayoutService-v68
23+
management: spec=ManagementService-v1
24+
balanceplatform: spec=BalancePlatformService-v2
25+
transfers: spec=TransferService-v3
26+
# Classic Platforms
27+
marketpay/account: spec=AccountService-v6
28+
marketpay/fund: spec=FundService-v6
29+
marketpay/configuration: spec=NotificationConfigurationService-v6
30+
marketpay/webhooks: spec=MarketPayNotificationService-v6
31+
hop: spec=HopService-v6
32+
33+
$(services): target/spec $(openapi-generator-jar)
34+
rm -rf $(models)/$@ $(output)
35+
$(openapi-generator-cli) generate \
36+
-i target/spec/json/$(spec).json \
37+
-g $(generator) \
38+
-t templates \
39+
-o $(output) \
40+
--ignore-file-override ./.openapi-generator-ignore \
41+
--skip-validate-spec \
42+
--model-package $(subst /,.,com.adyen.model.$@) \
43+
--library $(library) \
44+
--global-property models \
45+
--global-property modelDocs=false \
46+
--global-property modelTests=false \
47+
--additional-properties=dateLibrary=legacy
48+
mv $(output)/$(models)/$@ $(models)/$@
49+
50+
51+
# Checkout spec (and patch version)
52+
target/spec:
53+
git clone https://github.com/Adyen/adyen-openapi.git target/spec
54+
perl -i -pe's/"openapi" : "3.[0-9].[0-9]"/"openapi" : "3.0.0"/' target/spec/json/*.json
55+
56+
57+
# Extract templates (copy them for modifications)
58+
templates: $(openapi-generator-jar)
59+
$(openapi-generator-cli) author template -g $(generator) --library $(library) -o target/templates
60+
61+
62+
# Download the generator
63+
$(openapi-generator-jar):
64+
wget --quiet -o /dev/null $(openapi-generator-url) -O $(openapi-generator-jar)
65+
66+
67+
# Discard generated artifacts and changed models
68+
clean:
69+
rm -rf $(output)
70+
git checkout $(models)
71+
git clean -f -d $(models)
72+
73+
74+
.PHONY: templates models $(services)

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ You can use Maven and add this dependency to your project's POM:
3939
<dependency>
4040
<groupId>com.adyen</groupId>
4141
<artifactId>adyen-java-api-library</artifactId>
42-
<version>18.1.0</version>
42+
<version>18.1.1</version>
4343
</dependency>
4444
```
4545

@@ -118,6 +118,15 @@ adyenHttpClientWithProxy.setProxy(proxy);
118118
client.setHttpClient(adyenHttpClientWithProxy);
119119
~~~~
120120

121+
If your proxy requires authentication, set all the settings as system properties instead (don't mix with previous approach), for example:
122+
123+
~~~~ java
124+
System.setProperty("https.proxyHost", "127.0.0.1");
125+
System.setProperty("https.proxyPort", "3128");
126+
System.setProperty("https.proxyUser", "squid");
127+
System.setProperty("https.proxyPassword", "ward");
128+
~~~~
129+
121130
### Example integrations
122131

123132
For a closer look at how our Java library works, you can clone one of our example integrations:

checkstyle.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@
4141

4242
<property name="fileExtensions" value="java, properties, xml"/>
4343

44+
<!-- Ignore generated models -->
45+
<module name="BeforeExecutionExclusionFileFilter">
46+
<property name="fileNamePattern" value="model[\\/].*$"/>
47+
</module>
48+
4449
<!-- Checks that a package-info.java file exists for each package. -->
4550
<!-- See http://checkstyle.sf.net/config_javadoc.html#JavadocPackage -->
4651
<!--<module name="JavadocPackage"/>-->

pom.xml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>com.adyen</groupId>
55
<artifactId>adyen-java-api-library</artifactId>
66
<packaging>jar</packaging>
7-
<version>18.1.0</version>
7+
<version>18.1.1</version>
88
<name>Adyen Java API Library</name>
99
<description>Adyen API Client Library for Java</description>
1010
<url>https://github.com/adyen/adyen-java-api-library</url>
@@ -25,6 +25,7 @@
2525
<properties>
2626
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2727
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
28+
<swagger-core-version>1.6.5</swagger-core-version>
2829
</properties>
2930
<scm>
3031
<connection>scm:git:[email protected]:Adyen/adyen-java-api-library.git</connection>
@@ -45,7 +46,7 @@
4546
<plugin>
4647
<groupId>org.apache.maven.plugins</groupId>
4748
<artifactId>maven-jar-plugin</artifactId>
48-
<version>3.2.2</version>
49+
<version>3.3.0</version>
4950
<configuration>
5051
<archive>
5152
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
@@ -137,7 +138,6 @@
137138
<version>3.2.0</version>
138139
<configuration>
139140
<configLocation>checkstyle.xml</configLocation>
140-
<encoding>UTF-8</encoding>
141141
<consoleOutput>true</consoleOutput>
142142
<failsOnError>true</failsOnError>
143143
</configuration>
@@ -186,7 +186,7 @@
186186
<dependency>
187187
<groupId>com.fasterxml.jackson.core</groupId>
188188
<artifactId>jackson-annotations</artifactId>
189-
<version>2.13.3</version>
189+
<version>2.13.4</version>
190190
</dependency>
191191
<dependency>
192192
<groupId>com.fasterxml.jackson.core</groupId>
@@ -207,13 +207,13 @@
207207
<dependency>
208208
<groupId>org.mockito</groupId>
209209
<artifactId>mockito-core</artifactId>
210-
<version>4.7.0</version>
210+
<version>4.8.0</version>
211211
<scope>test</scope>
212212
</dependency>
213213
<dependency>
214214
<groupId>com.fasterxml.jackson.datatype</groupId>
215215
<artifactId>jackson-datatype-jdk8</artifactId>
216-
<version>2.13.3</version>
216+
<version>2.13.4</version>
217217
<scope>test</scope>
218218
</dependency>
219219
<dependency>
@@ -231,5 +231,17 @@
231231
<artifactId>swagger-annotations</artifactId>
232232
<version>2.2.2</version>
233233
</dependency>
234+
<!-- Generated model annotations -->
235+
<dependency>
236+
<groupId>io.swagger</groupId>
237+
<artifactId>swagger-annotations</artifactId>
238+
<version>${swagger-core-version}</version>
239+
</dependency>
240+
<!-- @Nullable annotation -->
241+
<dependency>
242+
<groupId>com.google.code.findbugs</groupId>
243+
<artifactId>jsr305</artifactId>
244+
<version>3.0.2</version>
245+
</dependency>
234246
</dependencies>
235247
</project>

src/main/java/com/adyen/Client.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class Client {
4747
public static final String MARKETPAY_NOTIFICATION_API_VERSION = "v6";
4848
public static final String MARKETPAY_HOP_API_VERSION = "v6";
4949
public static final String LIB_NAME = "adyen-java-api-library";
50-
public static final String LIB_VERSION = "18.1.0";
50+
public static final String LIB_VERSION = "18.1.1";
5151
public static final String CHECKOUT_ENDPOINT_TEST = "https://checkout-test.adyen.com/checkout";
5252
public static final String CHECKOUT_ENDPOINT_LIVE_SUFFIX = "-checkout-live.adyenpayments.com/checkout";
5353
public static final String CHECKOUT_ENDPOINT_CERT_LIVE = "https://checkoutcert-live-%s.adyen.com/checkout";

src/main/java/com/adyen/httpclient/AdyenHttpClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ private CloseableHttpClient createCloseableHttpClient(Config config) throws HTTP
196196
if (config.getTerminalCertificate() != null) {
197197
return createHttpClientWithSocketFactory(getTerminalCertificateSocketFactory(config));
198198
}
199-
return HttpClients.createDefault();
199+
return HttpClients.createSystem();
200200
}
201201

202202
private CloseableHttpClient createHttpClientWithSocketFactory(SSLConnectionSocketFactory socketFactory) {

src/main/java/com/adyen/model/PaymentResult.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ public class PaymentResult {
7575
public enum ResultCodeEnum {
7676
@SerializedName("AuthenticationFinished")
7777
AUTHENTICATIONFINISHED("AuthenticationFinished"),
78+
@SerializedName("AuthenticationNotRequired")
79+
AUTHENTICATIONNOTREQUIRED("AuthenticationNotRequired"),
7880
@SerializedName("Authorised")
7981
AUTHORISED("Authorised"),
8082
@SerializedName("Cancelled")

0 commit comments

Comments
 (0)