Skip to content

Commit 5f6f38b

Browse files
authored
Merge pull request #1044 from Adyen/develop
Release 20.1.0
2 parents 8b7c040 + aab24c5 commit 5f6f38b

File tree

864 files changed

+46802
-4920
lines changed

Some content is hidden

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

864 files changed

+46802
-4920
lines changed

Diff for: Makefile

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

66
generator:=java
77
library:=okhttp-gson
8-
modelGen:=balanceplatform binlookup checkout legalentitymanagement management payment payout recurring transfers
8+
modelGen:=balancecontrol balanceplatform binlookup capital checkout dataprotection legalentitymanagement management payment payout posterminalmanagement recurring transfers storedvalue configurationwebhooks reportwebhooks transferwebhooks
99
models:=src/main/java/com/adyen/model
1010
output:=target/out
1111

@@ -40,8 +40,12 @@ marketpay/fund: spec=FundService-v6
4040
marketpay/configuration: spec=NotificationConfigurationService-v6
4141
marketpay/webhooks: spec=MarketPayNotificationService-v6
4242
hop: spec=HopService-v6
43+
# Balance Webhooks
44+
configurationwebhooks: spec=BalancePlatformConfigurationNotification-v1
45+
reportwebhooks: spec=BalancePlatformReportNotification-v1
46+
transferwebhooks: spec=BalancePlatformTransferNotification-v3
4347

44-
$(services): target/spec $(openapi-generator-jar)
48+
$(modelGen): target/spec $(openapi-generator-jar)
4549
rm -rf $(models)/$@ $(output)
4650
$(openapi-generator-cli) generate \
4751
-i target/spec/json/$(spec).json \
@@ -64,7 +68,7 @@ $(services): target/spec $(openapi-generator-jar)
6468
mv $(output)/$(models)/JSON.java $(models)/$@
6569

6670
# Full service + models automation
67-
bigServices:=balanceplatform checkout storedValue payout management legalentitymanagement transfers
71+
bigServices:=balanceplatform checkout payout management legalentitymanagement transfers
6872
singleFileServices:=balancecontrol binlookup dataprotection storedvalue posterminalmanagement recurring payment capital
6973

7074
services: $(bigServices) $(singleFileServices)
@@ -95,7 +99,8 @@ $(bigServices): target/spec $(openapi-generator-jar)
9599
mv $(output)/src/main/java/com/adyen/service/$@ src/main/java/com/adyen/service/$@
96100

97101
$(singleFileServices): target/spec $(openapi-generator-jar)
98-
cat <<< "$$(jq 'del(.paths[][].tags)' target/spec/json/$(spec).json)" > target/spec/json/$(spec).json
102+
jq -e 'del(.paths[][].tags)' target/spec/json/$(spec).json > target/spec/json/$(spec).tmp
103+
mv target/spec/json/$(spec).tmp target/spec/json/$(spec).json
99104
rm -rf $(models)/$@ $(output)
100105
rm -rf src/main/java/com/adyen/service/$@ $(output)
101106
$(openapi-generator-cli) generate \

Diff for: README.md

+47-15
Large diffs are not rendered by default.

Diff for: pom.xml

+6-6
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>20.0.0</version>
7+
<version>20.1.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.10</swagger-core-version>
28+
<swagger-core-version>1.6.11</swagger-core-version>
2929
</properties>
3030
<scm>
3131
<connection>scm:git:[email protected]:Adyen/adyen-java-api-library.git</connection>
@@ -88,7 +88,7 @@
8888
<plugin>
8989
<groupId>org.apache.maven.plugins</groupId>
9090
<artifactId>maven-source-plugin</artifactId>
91-
<version>3.2.1</version>
91+
<version>3.3.0</version>
9292
<executions>
9393
<execution>
9494
<id>attach-sources</id>
@@ -142,7 +142,7 @@
142142
<plugin>
143143
<groupId>org.apache.maven.plugins</groupId>
144144
<artifactId>maven-checkstyle-plugin</artifactId>
145-
<version>3.2.2</version>
145+
<version>3.3.0</version>
146146
<configuration>
147147
<configLocation>checkstyle.xml</configLocation>
148148
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
@@ -162,7 +162,7 @@
162162
<plugin>
163163
<groupId>org.apache.felix</groupId>
164164
<artifactId>maven-bundle-plugin</artifactId>
165-
<version>5.1.8</version>
165+
<version>5.1.9</version>
166166
<executions>
167167
<execution>
168168
<id>bundle-manifest</id>
@@ -220,7 +220,7 @@
220220
<dependency>
221221
<groupId>io.swagger.core.v3</groupId>
222222
<artifactId>swagger-annotations</artifactId>
223-
<version>2.2.9</version>
223+
<version>2.2.11</version>
224224
<scope>compile</scope>
225225
</dependency>
226226
<dependency>

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

+1-1
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 = "20.0.0";
47+
public static final String LIB_VERSION = "20.1.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";

Diff for: src/main/java/com/adyen/constants/ApiConstants.java

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ interface RequestProperty {
110110
String CONTENT_TYPE = "Content-Type";
111111
String API_KEY = "x-api-key";
112112
String APPLICATION_JSON_TYPE = "application/json";
113+
String REQUESTED_VERIFICATION_CODE_HEADER = "x-requested-verification-code";
113114
}
114115

115116
interface ThreeDS2Property {

Diff for: src/main/java/com/adyen/httpclient/AdyenHttpClient.java

+12-2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
import static com.adyen.constants.ApiConstants.RequestProperty.APPLICATION_JSON_TYPE;
6969
import static com.adyen.constants.ApiConstants.RequestProperty.CONTENT_TYPE;
7070
import static com.adyen.constants.ApiConstants.RequestProperty.IDEMPOTENCY_KEY;
71+
import static com.adyen.constants.ApiConstants.RequestProperty.REQUESTED_VERIFICATION_CODE_HEADER;
7172
import static com.adyen.constants.ApiConstants.RequestProperty.USER_AGENT;
7273

7374
public class AdyenHttpClient implements ClientInterface {
@@ -151,8 +152,17 @@ private void setHeaders(Config config, RequestOptions requestOptions, HttpUriReq
151152
httpUriRequest.addHeader(ADYEN_LIBRARY_NAME, Client.LIB_NAME);
152153
httpUriRequest.addHeader(ADYEN_LIBRARY_VERSION, Client.LIB_VERSION);
153154

154-
if (requestOptions != null && requestOptions.getIdempotencyKey() != null) {
155-
httpUriRequest.addHeader(IDEMPOTENCY_KEY, requestOptions.getIdempotencyKey());
155+
if (requestOptions != null) {
156+
if (requestOptions.getIdempotencyKey() != null) {
157+
httpUriRequest.addHeader(IDEMPOTENCY_KEY, requestOptions.getIdempotencyKey());
158+
}
159+
if (requestOptions.getRequestedVerificationCodeHeader() != null) {
160+
httpUriRequest.addHeader(REQUESTED_VERIFICATION_CODE_HEADER, requestOptions.getRequestedVerificationCodeHeader());
161+
}
162+
163+
if (requestOptions.getAdditionalServiceHeaders() != null) {
164+
requestOptions.getAdditionalServiceHeaders().forEach(httpUriRequest::addHeader);
165+
}
156166
}
157167
}
158168

Diff for: src/main/java/com/adyen/model/RequestOptions.java

+19
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
package com.adyen.model;
22

3+
import java.util.HashMap;
4+
35
public class RequestOptions {
46

57
private String idempotencyKey;
8+
private String requestedVerificationCodeHeader;
9+
private HashMap<String, String> additionalServiceHeaders;
610

711
public String getIdempotencyKey() {
812
return idempotencyKey;
@@ -12,5 +16,20 @@ public void setIdempotencyKey(String idempotencyKey) {
1216
this.idempotencyKey = idempotencyKey;
1317
}
1418

19+
public String getRequestedVerificationCodeHeader() {
20+
return requestedVerificationCodeHeader;
21+
}
22+
23+
public void setRequestedVerificationCodeHeader(String requestedVerificationCodeHeader) {
24+
this.requestedVerificationCodeHeader = requestedVerificationCodeHeader;
25+
}
26+
27+
public HashMap<String, String> getAdditionalServiceHeaders() {
28+
return additionalServiceHeaders;
29+
}
30+
31+
public void setAdditionalServiceHeaders(HashMap<String, String> additionalServiceHeaders) {
32+
this.additionalServiceHeaders = additionalServiceHeaders;
33+
}
1534

1635
}

Diff for: src/main/java/com/adyen/model/balancecontrol/AbstractOpenApiSchema.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* The Balance Control API lets you transfer funds between merchant accounts that belong to the same legal entity and are under the same company account. ## Authentication To connect to the Balance Control API, you must authenticate your requests with an [API key or basic auth username and password](https://docs.adyen.com/development-resources/api-authentication). To learn how you can generate these, see [API credentials](https://docs.adyen.com/development-resources/api-credentials).Here is an example of authenticating a request with an API key: ``` curl -H \"X-API-Key: Your_API_key\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate API credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning The Balance Control API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BalanceControl/v1/balanceTransfer ```
44
*
55
* The version of the OpenAPI document: 1
6-
* Contact: [email protected]
6+
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
99
* https://openapi-generator.tech

Diff for: src/main/java/com/adyen/model/balancecontrol/Amount.java

+9-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* The Balance Control API lets you transfer funds between merchant accounts that belong to the same legal entity and are under the same company account. ## Authentication To connect to the Balance Control API, you must authenticate your requests with an [API key or basic auth username and password](https://docs.adyen.com/development-resources/api-authentication). To learn how you can generate these, see [API credentials](https://docs.adyen.com/development-resources/api-credentials).Here is an example of authenticating a request with an API key: ``` curl -H \"X-API-Key: Your_API_key\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate API credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning The Balance Control API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BalanceControl/v1/balanceTransfer ```
44
*
55
* The version of the OpenAPI document: 1
6-
* Contact: [email protected]
6+
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
99
* https://openapi-generator.tech
@@ -41,6 +41,8 @@
4141
import java.util.Map;
4242
import java.util.Map.Entry;
4343
import java.util.Set;
44+
import java.util.logging.Level;
45+
import java.util.logging.Logger;
4446

4547
import com.adyen.model.balancecontrol.JSON;
4648

@@ -159,6 +161,10 @@ private String toIndentedString(Object o) {
159161
openapiRequiredFields.add("currency");
160162
openapiRequiredFields.add("value");
161163
}
164+
/**
165+
* logger for Deserialization Errors
166+
*/
167+
private static final Logger log = Logger.getLogger(Amount.class.getName());
162168

163169
/**
164170
* Validates the JSON Object and throws an exception if issues found
@@ -179,7 +185,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException {
179185
// check to see if the JSON string contains additional fields
180186
for (Entry<String, JsonElement> entry : entries) {
181187
if (!Amount.openapiFields.contains(entry.getKey())) {
182-
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Amount` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
188+
log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Amount` properties.", entry.getKey()));
183189
}
184190
}
185191

@@ -191,7 +197,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException {
191197
}
192198
// validate the optional field currency
193199
if (jsonObj.get("currency") != null && !jsonObj.get("currency").isJsonPrimitive()) {
194-
throw new IllegalArgumentException(String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString()));
200+
log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString()));
195201
}
196202
}
197203

Diff for: src/main/java/com/adyen/model/balancecontrol/BalanceTransferRequest.java

+12-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* The Balance Control API lets you transfer funds between merchant accounts that belong to the same legal entity and are under the same company account. ## Authentication To connect to the Balance Control API, you must authenticate your requests with an [API key or basic auth username and password](https://docs.adyen.com/development-resources/api-authentication). To learn how you can generate these, see [API credentials](https://docs.adyen.com/development-resources/api-credentials).Here is an example of authenticating a request with an API key: ``` curl -H \"X-API-Key: Your_API_key\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate API credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning The Balance Control API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/BalanceControl/v1/balanceTransfer ```
44
*
55
* The version of the OpenAPI document: 1
6-
* Contact: [email protected]
6+
*
77
*
88
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
99
* https://openapi-generator.tech
@@ -42,6 +42,8 @@
4242
import java.util.Map;
4343
import java.util.Map.Entry;
4444
import java.util.Set;
45+
import java.util.logging.Level;
46+
import java.util.logging.Logger;
4547

4648
import com.adyen.model.balancecontrol.JSON;
4749

@@ -333,6 +335,10 @@ private String toIndentedString(Object o) {
333335
openapiRequiredFields.add("toMerchant");
334336
openapiRequiredFields.add("type");
335337
}
338+
/**
339+
* logger for Deserialization Errors
340+
*/
341+
private static final Logger log = Logger.getLogger(BalanceTransferRequest.class.getName());
336342

337343
/**
338344
* Validates the JSON Object and throws an exception if issues found
@@ -353,7 +359,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException {
353359
// check to see if the JSON string contains additional fields
354360
for (Entry<String, JsonElement> entry : entries) {
355361
if (!BalanceTransferRequest.openapiFields.contains(entry.getKey())) {
356-
throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BalanceTransferRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
362+
log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BalanceTransferRequest` properties.", entry.getKey()));
357363
}
358364
}
359365

@@ -369,19 +375,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException {
369375
}
370376
// validate the optional field description
371377
if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) {
372-
throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString()));
378+
log.log(Level.WARNING, String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString()));
373379
}
374380
// validate the optional field fromMerchant
375381
if (jsonObj.get("fromMerchant") != null && !jsonObj.get("fromMerchant").isJsonPrimitive()) {
376-
throw new IllegalArgumentException(String.format("Expected the field `fromMerchant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fromMerchant").toString()));
382+
log.log(Level.WARNING, String.format("Expected the field `fromMerchant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fromMerchant").toString()));
377383
}
378384
// validate the optional field reference
379385
if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) {
380-
throw new IllegalArgumentException(String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString()));
386+
log.log(Level.WARNING, String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString()));
381387
}
382388
// validate the optional field toMerchant
383389
if (jsonObj.get("toMerchant") != null && !jsonObj.get("toMerchant").isJsonPrimitive()) {
384-
throw new IllegalArgumentException(String.format("Expected the field `toMerchant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("toMerchant").toString()));
390+
log.log(Level.WARNING, String.format("Expected the field `toMerchant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("toMerchant").toString()));
385391
}
386392
// ensure the field type can be parsed to an enum value
387393
if (jsonObj.get("type") != null) {

0 commit comments

Comments
 (0)