Skip to content

Commit 8b7c040

Browse files
authored
Merge pull request #1021 from Adyen/develop
Adyen Java API Library Release v20.0.0
2 parents 1caad26 + 08cd39c commit 8b7c040

File tree

672 files changed

+56767
-14502
lines changed

Some content is hidden

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

672 files changed

+56767
-14502
lines changed

Diff for: .github/workflows/models.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
echo ::set-output name=pr_body::"OpenAPI spec or templates produced new models on $(date +%d-%m-%Y) \
1818
by [commit](https://github.com/Adyen/adyen-openapi/commit/$(git rev-parse HEAD))."
1919
- name: Create Pull Request
20-
uses: peter-evans/create-pull-request@v4
20+
uses: peter-evans/create-pull-request@v5
2121
with:
2222
token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }}
2323
committer: ${{ secrets.ADYEN_AUTOMATION_BOT_EMAIL }}

Diff for: Makefile

+77-7
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,35 @@ openapi-generator-cli:=java -jar $(openapi-generator-jar)
55

66
generator:=java
77
library:=okhttp-gson
8-
services:=balanceplatform binlookup checkout legalentitymanagement management payments payout recurring transfers
8+
modelGen:=balanceplatform binlookup checkout legalentitymanagement management payment payout recurring transfers
99
models:=src/main/java/com/adyen/model
1010
output:=target/out
1111

1212
# Generate models (for each service)
13-
models: $(services)
13+
models: $(modelGen)
1414

15-
binlookup: spec=BinLookupService-v52
15+
balancecontrol: spec=BalanceControlService-v1
16+
balancecontrol: smallServiceName=BalanceControlApi
17+
binlookup: spec=BinLookupService-v54
18+
binlookup: smallServiceName=BinLookupApi
1619
checkout: spec=CheckoutService-v70
17-
storedValue: spec=StoredValueService-v46
20+
dataprotection: spec=DataProtectionService-v1
21+
dataprotection: smallServiceName=DataProtectionApi
22+
capital: spec=GrantService-v3
23+
capital: smallServiceName=CapitalApi
24+
storedvalue: spec=StoredValueService-v46
25+
storedvalue: smallServiceName=StoredValueApi
1826
posterminalmanagement: spec=TfmAPIService-v1
19-
payments: spec=PaymentService-v68
27+
posterminalmanagement: smallServiceName=PosTerminalManagementApi
28+
payment: spec=PaymentService-v68
29+
payment: smallServiceName=PaymentApi
2030
recurring: spec=RecurringService-v68
31+
recurring: smallServiceName=RecurringApi
2132
payout: spec=PayoutService-v68
2233
management: spec=ManagementService-v1
23-
management: resourceClass=Management
2434
balanceplatform: spec=BalancePlatformService-v2
2535
transfers: spec=TransferService-v3
26-
legalentitymanagement: spec=LegalEntityService-v2
36+
legalentitymanagement: spec=LegalEntityService-v3
2737
# Classic Platforms
2838
marketpay/account: spec=AccountService-v6
2939
marketpay/fund: spec=FundService-v6
@@ -45,13 +55,73 @@ $(services): target/spec $(openapi-generator-jar)
4555
--library $(library) \
4656
--global-property modelDocs=false \
4757
--global-property modelTests=false \
58+
--inline-schema-name-mappings PaymentDonationRequest_paymentMethod=CheckoutPaymentMethod \
4859
--additional-properties=dateLibrary=java8 \
4960
--additional-properties=serializationLibrary=gson \
5061
--additional-properties=openApiNullable=false \
5162
--additional-properties=resourceClass=$(resourceClass)Resource
5263
mv $(output)/$(models)/$@ $(models)/$@
5364
mv $(output)/$(models)/JSON.java $(models)/$@
5465

66+
# Full service + models automation
67+
bigServices:=balanceplatform checkout storedValue payout management legalentitymanagement transfers
68+
singleFileServices:=balancecontrol binlookup dataprotection storedvalue posterminalmanagement recurring payment capital
69+
70+
services: $(bigServices) $(singleFileServices)
71+
72+
$(bigServices): target/spec $(openapi-generator-jar)
73+
rm -rf $(models)/$@ $(output)
74+
rm -rf src/main/java/com/adyen/service/$@ $(output)
75+
$(openapi-generator-cli) generate \
76+
-i target/spec/json/$(spec).json \
77+
-g $(generator) \
78+
-t templates \
79+
-o $(output) \
80+
--reserved-words-mappings configuration=configuration \
81+
--ignore-file-override ./.openapi-generator-ignore \
82+
--skip-validate-spec \
83+
--model-package $(subst /,.,com.adyen.model.$@) \
84+
--library $(library) \
85+
--api-package com.adyen.service.$@ \
86+
--api-name-suffix Api \
87+
--global-property modelDocs=false \
88+
--global-property modelTests=false \
89+
--inline-schema-name-mappings PaymentDonationRequest_paymentMethod=CheckoutPaymentMethod \
90+
--additional-properties=dateLibrary=java8 \
91+
--additional-properties=serializationLibrary=gson \
92+
--additional-properties=openApiNullable=false
93+
mv $(output)/$(models)/$@ $(models)/$@
94+
mv $(output)/src/main/java/com/adyen/service/JSON.java $(models)/$@
95+
mv $(output)/src/main/java/com/adyen/service/$@ src/main/java/com/adyen/service/$@
96+
97+
$(singleFileServices): target/spec $(openapi-generator-jar)
98+
cat <<< "$$(jq 'del(.paths[][].tags)' target/spec/json/$(spec).json)" > target/spec/json/$(spec).json
99+
rm -rf $(models)/$@ $(output)
100+
rm -rf src/main/java/com/adyen/service/$@ $(output)
101+
$(openapi-generator-cli) generate \
102+
-i target/spec/json/$(spec).json \
103+
-g $(generator) \
104+
-c templates/libraries/okhttp-gson/config.yaml \
105+
-o $(output) \
106+
--reserved-words-mappings configuration=configuration \
107+
--ignore-file-override ./.openapi-generator-ignore \
108+
--skip-validate-spec \
109+
--model-package $(subst /,.,com.adyen.model.$@) \
110+
--library $(library) \
111+
--additional-properties customApi=$@ \
112+
--api-package com.adyen.service \
113+
--api-name-suffix Api \
114+
--global-property modelDocs=false \
115+
--global-property modelTests=false \
116+
--inline-schema-name-mappings PaymentDonationRequest_paymentMethod=CheckoutPaymentMethod \
117+
--additional-properties=dateLibrary=java8 \
118+
--additional-properties=serializationLibrary=gson \
119+
--additional-properties=openApiNullable=false \
120+
--additional-properties=smallServiceName=$(smallServiceName)
121+
mv $(output)/$(models)/$@ $(models)/$@
122+
mv $(output)/src/main/java/com/adyen/JSON.java $(models)/$@
123+
mv $(output)/src/main/java/com/adyen/service/*Single.java src/main/java/com/adyen/service/$(smallServiceName).java
124+
55125

56126
# Checkout spec (and patch version)
57127
target/spec:

Diff for: README.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ The Library supports all APIs under the following services:
1010

1111
| API | Description | Service Name | Supported version |
1212
|----------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------|-------------------|
13-
| [BIN lookup API](https://docs.adyen.com/api-explorer/#/BinLookup/v52/overview) | The BIN Lookup API provides endpoints for retrieving information based on a given BIN. | BinLookup | **v52** |
14-
| [Checkout API](https://docs.adyen.com/api-explorer/#/CheckoutService/v69/overview) | Our latest integration for accepting online payments. | Checkout | **v69** |
13+
| [BIN lookup API](https://docs.adyen.com/api-explorer/BinLookup/54/overview) | The BIN Lookup API provides endpoints for retrieving information based on a given BIN. | BinLookup | **v54** |
14+
| [Capital API](https://docs.adyen.com/api-explorer/capital/3/overview) | Adyen Capital allows you to build an embedded financing offering for your users to serve their operational needs. | Capital | **v3** |
15+
| [Checkout API](https://docs.adyen.com/api-explorer/Checkout/70/overview) | Our latest integration for accepting online payments. | Checkout | **v70** |
1516
| [Configuration API](https://docs.adyen.com/api-explorer/#/balanceplatform/v2/overview) | The Configuration API enables you to create a platform where you can onboard your users as account holders and create balance accounts, cards, and business accounts. | balanceplatform package subclasses | **v2** |
1617
| [DataProtection API](https://docs.adyen.com/development-resources/data-protection-api) | Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email) | DataProtection | **v1** |
17-
| [Legal Entity Management API](https://docs.adyen.com/api-explorer/#/legalentity/v2/overview) | Manage legal entities that contain information required for verification. | legalentitymanagement package subclasses | **v2** |
18+
| [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/3/overview) | Manage legal entities that contain information required for verification. | legalentitymanagement package subclasses | **v3** |
1819
| [Local/Cloud-based Terminal API](https://docs.adyen.com/point-of-sale/terminal-api-reference) | Our point-of-sale integration. | TerminalLocalAPI or TerminalCloudAPI | - |
1920
| [Management API](https://docs.adyen.com/api-explorer/#/ManagementService/v1/overview) | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | management package subclasses | **v1** |
2021
| [Payments API](https://docs.adyen.com/api-explorer/#/Payment/v68/overview) | Our classic integration for online payments. | Payment | **v68** |
@@ -49,7 +50,7 @@ You can use Maven and add this dependency to your project's POM:
4950
<dependency>
5051
<groupId>com.adyen</groupId>
5152
<artifactId>adyen-java-api-library</artifactId>
52-
<version>19.0.0</version>
53+
<version>20.0.0</version>
5354
</dependency>
5455
```
5556

@@ -191,6 +192,8 @@ For a closer look at how our Java library works, you can clone one of our exampl
191192

192193
These include commented code, highlighting key features and concepts, and examples of API calls that can be made using the library.
193194

195+
## Feedback
196+
We value your input! Help us enhance our API Libraries and improve the integration experience by providing your feedback. Please take a moment to fill out [our feedback form](https://forms.gle/A4EERrR6CWgKWe5r9) to share your thoughts, suggestions or ideas.
194197

195198
## Contributing
196199

Diff for: checkstyle-suppressions.xml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<!DOCTYPE suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.1//EN" "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
2+
<suppressions>
3+
<suppress files="src/main/java/com.adyen/service/*" checks="[a-zA-Z0-9]*" />
4+
</suppressions>

Diff for: pom.xml

+10-9
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>19.0.0</version>
7+
<version>20.0.0</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,7 +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.9</swagger-core-version>
28+
<swagger-core-version>1.6.10</swagger-core-version>
2929
</properties>
3030
<scm>
3131
<connection>scm:git:[email protected]:Adyen/adyen-java-api-library.git</connection>
@@ -44,7 +44,7 @@
4444
<plugin>
4545
<groupId>org.apache.maven.plugins</groupId>
4646
<artifactId>maven-compiler-plugin</artifactId>
47-
<version>3.10.1</version>
47+
<version>3.11.0</version>
4848
<configuration>
4949
<source>1.8</source>
5050
<target>1.8</target>
@@ -75,7 +75,7 @@
7575
<plugin>
7676
<groupId>org.jacoco</groupId>
7777
<artifactId>jacoco-maven-plugin</artifactId>
78-
<version>0.8.8</version>
78+
<version>0.8.10</version>
7979
<executions>
8080
<execution>
8181
<id>default-prepare-agent</id>
@@ -117,7 +117,7 @@
117117
<plugin>
118118
<groupId>org.apache.maven.plugins</groupId>
119119
<artifactId>maven-gpg-plugin</artifactId>
120-
<version>3.0.1</version>
120+
<version>3.1.0</version>
121121
<executions>
122122
<execution>
123123
<id>sign-artifacts</id>
@@ -142,9 +142,10 @@
142142
<plugin>
143143
<groupId>org.apache.maven.plugins</groupId>
144144
<artifactId>maven-checkstyle-plugin</artifactId>
145-
<version>3.2.1</version>
145+
<version>3.2.2</version>
146146
<configuration>
147147
<configLocation>checkstyle.xml</configLocation>
148+
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
148149
<consoleOutput>true</consoleOutput>
149150
<failsOnError>true</failsOnError>
150151
</configuration>
@@ -207,7 +208,7 @@
207208
<dependency>
208209
<groupId>org.mockito</groupId>
209210
<artifactId>mockito-core</artifactId>
210-
<version>5.0.0</version>
211+
<version>5.3.1</version>
211212
<scope>test</scope>
212213
</dependency>
213214
<dependency>
@@ -219,13 +220,13 @@
219220
<dependency>
220221
<groupId>io.swagger.core.v3</groupId>
221222
<artifactId>swagger-annotations</artifactId>
222-
<version>2.2.8</version>
223+
<version>2.2.9</version>
223224
<scope>compile</scope>
224225
</dependency>
225226
<dependency>
226227
<groupId>jakarta.ws.rs</groupId>
227228
<artifactId>jakarta.ws.rs-api</artifactId>
228-
<version>2.1.6</version>
229+
<version>3.1.0</version>
229230
<scope>compile</scope>
230231
</dependency>
231232
<dependency>

Diff for: src/main/java/com/adyen/Client.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class Client {
4444
public static final String MARKETPAY_NOTIFICATION_API_VERSION = "v6";
4545
public static final String MARKETPAY_HOP_API_VERSION = "v6";
4646
public static final String LIB_NAME = "adyen-java-api-library";
47-
public static final String LIB_VERSION = "19.0.0";
47+
public static final String LIB_VERSION = "20.0.0";
4848
public static final String CHECKOUT_ENDPOINT_TEST = "https://checkout-test.adyen.com/checkout";
4949
public static final String CHECKOUT_ENDPOINT_LIVE_SUFFIX = "-checkout-live.adyenpayments.com/checkout";
5050
public static final String CHECKOUT_ENDPOINT_CERT_LIVE = "https://checkoutcert-live-%s.adyen.com/checkout";
@@ -70,7 +70,7 @@ public class Client {
7070
public static final String TRANSFER_VERSION = "v3";
7171
public static final String LEGAL_ENTITY_MANAGEMENT_ENDPOINT_TEST = "https://kyc-test.adyen.com/lem/";
7272
public static final String LEGAL_ENTITY_MANAGEMENT_ENDPOINT_LIVE = "https://kyc-test.adyen.com/lem/";
73-
public static final String LEGAL_ENTITY_MANAGEMENT_VERSION = "v2";
73+
public static final String LEGAL_ENTITY_MANAGEMENT_VERSION = "v3";
7474
public static final String MANAGEMENT_ENDPOINT_TEST = "https://management-test.adyen.com/";
7575
public static final String MANAGEMENT_ENDPOINT_LIVE = "https://management-live.adyen.com/";
7676
public static final String MANAGEMENT_VERSION = "v1";
@@ -216,6 +216,7 @@ public void setEnvironment(Environment environment, String liveEndpointUrlPrefix
216216
this.config.setEnvironment(environment);
217217
this.config.setMarketPayEndpoint(MARKETPAY_ENDPOINT_LIVE);
218218
if (liveEndpointUrlPrefix != null && !liveEndpointUrlPrefix.isEmpty()) {
219+
this.config.liveEndpointUrlPrefix = liveEndpointUrlPrefix;
219220
this.config.setEndpoint(ENDPOINT_PROTOCOL + liveEndpointUrlPrefix + ENDPOINT_LIVE_SUFFIX);
220221
this.config.setCheckoutEndpoint(ENDPOINT_PROTOCOL + liveEndpointUrlPrefix + CHECKOUT_ENDPOINT_LIVE_SUFFIX);
221222
} else {

Diff for: src/main/java/com/adyen/Service.java

+24
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
*/
2121
package com.adyen;
2222

23+
import com.adyen.enums.Environment;
2324
import com.google.gson.Gson;
2425
import com.google.gson.GsonBuilder;
2526

@@ -49,4 +50,27 @@ public void setApiKeyRequired(boolean apiKeyRequired) {
4950
isApiKeyRequired = apiKeyRequired;
5051
}
5152

53+
protected String createBaseURL(String url) {
54+
Config config = this.getClient().getConfig();
55+
if (config.getEnvironment() != Environment.LIVE) {
56+
return url;
57+
}
58+
59+
if (url.contains("pal-")) {
60+
if (config.getLiveEndpointUrlPrefix() == null) {
61+
throw new IllegalArgumentException("please provide a live url prefix in the client");
62+
}
63+
url = url.replaceFirst("https://pal-test.adyen.com/pal/servlet/",
64+
"https://" + config.getLiveEndpointUrlPrefix() + "-pal-live.adyenpayments.com/pal/servlet/");
65+
}
66+
67+
if (url.contains("checkout-")) {
68+
if (config.getLiveEndpointUrlPrefix() == null) {
69+
throw new IllegalArgumentException("please provide a live url prefix in the client");
70+
}
71+
url = url.replaceFirst("https://checkout-test.adyen.com/",
72+
"https://" + config.getLiveEndpointUrlPrefix() + "-checkout-live.adyenpayments.com/checkout/");
73+
}
74+
return url.replaceFirst("-test", "-live");
75+
}
5276
}

0 commit comments

Comments
 (0)