Skip to content

Commit

Permalink
Merge pull request #1119 from Adyen/automation/release
Browse files Browse the repository at this point in the history
Release v21.3.0
  • Loading branch information
AdyenAutomationBot authored Aug 28, 2023
2 parents c4e7e00 + 78ffff0 commit ba706cf
Show file tree
Hide file tree
Showing 39 changed files with 7,221 additions and 95 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ openapi-generator-cli:=java -jar $(openapi-generator-jar)

generator:=java
library:=jersey3
modelGen:=balancecontrol balanceplatform binlookup checkout dataprotection legalentitymanagement management payment payout posterminalmanagement recurring transfers storedvalue configurationwebhooks reportwebhooks transferwebhooks
modelGen:=acswebhooks balancecontrol balanceplatform binlookup checkout dataprotection legalentitymanagement management payment payout posterminalmanagement recurring transfers storedvalue configurationwebhooks reportwebhooks transferwebhooks managementwebhooks
models:=src/main/java/com/adyen/model
output:=target/out

Expand Down Expand Up @@ -39,9 +39,12 @@ marketpay/configuration: spec=NotificationConfigurationService-v6
marketpay/webhooks: spec=MarketPayNotificationService-v6
hop: spec=HopService-v6
# Balance Webhooks
acswebhooks: spec=BalancePlatformAcsNotification-v1
configurationwebhooks: spec=BalancePlatformConfigurationNotification-v1
reportwebhooks: spec=BalancePlatformReportNotification-v1
transferwebhooks: spec=BalancePlatformTransferNotification-v3
# Management Webhooks
managementwebhooks: spec=ManagementNotificationService-v1

$(modelGen): target/spec $(openapi-generator-jar)
rm -rf $(models)/$@ $(output)
Expand Down
61 changes: 36 additions & 25 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.adyen</groupId>
<artifactId>adyen-java-api-library</artifactId>
<packaging>jar</packaging>
<version>21.2.0</version>
<version>21.3.0</version>
<name>Adyen Java API Library</name>
<description>Adyen API Client Library for Java</description>
<url>https://github.com/adyen/adyen-java-api-library</url>
Expand Down Expand Up @@ -218,7 +218,7 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.4.0</version>
<version>5.5.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
12 changes: 1 addition & 11 deletions src/main/java/com/adyen/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@
public class Client {
private ClientInterface httpClient;
private Config config;
public static final String ENDPOINT_CERT_LIVE = "https://palcert-live.adyen.com";
public static final String LIB_NAME = "adyen-java-api-library";
public static final String LIB_VERSION = "21.2.0";
public static final String CHECKOUT_ENDPOINT_CERT_LIVE = "https://checkoutcert-live-%s.adyen.com/checkout";
public static final String LIB_VERSION = "21.3.0";
public static final String TERMINAL_API_ENDPOINT_TEST = "https://terminal-api-test.adyen.com";
public static final String TERMINAL_API_ENDPOINT_LIVE = "https://terminal-api-live.adyen.com";

Expand Down Expand Up @@ -65,14 +63,6 @@ public Client(KeyStore trustStore, KeyStore clientKeyStore, String clientKeyStor
this.config.setClientKeyStorePassword(clientKeyStorePassword);
this.config.setClientKeyStore(clientKeyStore);
this.config.setTrustKeyStore(trustStore);
this.config.setEndpoint(ENDPOINT_CERT_LIVE);

if (region != null) {
this.config.setCheckoutEndpoint(String.format(CHECKOUT_ENDPOINT_CERT_LIVE, region.name().toLowerCase()));
} else {
// default to EU if not provided
this.config.setCheckoutEndpoint(String.format(CHECKOUT_ENDPOINT_CERT_LIVE, Region.EU.name().toLowerCase()));
}
}

public Client(String username, String password, Environment environment, String liveEndpointUrlPrefix, String applicationName) {
Expand Down
33 changes: 0 additions & 33 deletions src/main/java/com/adyen/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
public class Config {
protected String username;
protected String password;
protected String merchantAccount;
protected Environment environment;
protected String endpoint;

/**
* Application name: used as HTTP client User-Agent
Expand All @@ -47,9 +45,6 @@ public class Config {
protected int connectionTimeoutMillis;
protected int readTimeoutMillis;

//Checkout Specific
protected String checkoutEndpoint;

//Terminal API Specific
protected String terminalApiCloudEndpoint;
protected String terminalApiLocalEndpoint;
Expand Down Expand Up @@ -81,14 +76,6 @@ public void setPassword(String password) {
this.password = password;
}

public String getMerchantAccount() {
return merchantAccount;
}

public void setMerchantAccount(String merchantAccount) {
this.merchantAccount = merchantAccount;
}

public Environment getEnvironment() {
return environment;
}
Expand All @@ -97,14 +84,6 @@ public void setEnvironment(Environment environment) {
this.environment = environment;
}

public String getEndpoint() {
return endpoint;
}

public void setEndpoint(String endpoint) {
this.endpoint = endpoint;
}

public String getApplicationName() {
return applicationName;
}
Expand All @@ -121,18 +100,6 @@ public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}

public String getCheckoutEndpoint() {
if (checkoutEndpoint == null || checkoutEndpoint.isEmpty()) {
String message = "Please provide your unique live url prefix on the setEnvironment() call on the Client or provide checkoutEndpoint in your config object.";
throw new IllegalArgumentException(message);
}
return checkoutEndpoint;
}

public void setCheckoutEndpoint(String checkoutEndpoint) {
this.checkoutEndpoint = checkoutEndpoint;
}

public String getTerminalApiCloudEndpoint() {
return terminalApiCloudEndpoint;
}
Expand Down
147 changes: 147 additions & 0 deletions src/main/java/com/adyen/model/acswebhooks/AbstractOpenApiSchema.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
/*
* Authentication webhooks
*
* The version of the OpenAPI document: 1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


package com.adyen.model.acswebhooks;

import java.util.Objects;
import java.lang.reflect.Type;
import java.util.Map;
import jakarta.ws.rs.core.GenericType;

import com.fasterxml.jackson.annotation.JsonValue;

/**
* Abstract class for oneOf,anyOf schemas defined in OpenAPI spec
*/

public abstract class AbstractOpenApiSchema {

// store the actual instance of the schema/object
private Object instance;

// is nullable
private Boolean isNullable;

// schema type (e.g. oneOf, anyOf)
private final String schemaType;

public AbstractOpenApiSchema(String schemaType, Boolean isNullable) {
this.schemaType = schemaType;
this.isNullable = isNullable;
}

/**
* Get the list of oneOf/anyOf composed schemas allowed to be stored in this object
*
* @return an instance of the actual schema/object
*/
public abstract Map<String, GenericType> getSchemas();

/**
* Get the actual instance
*
* @return an instance of the actual schema/object
*/
@JsonValue
public Object getActualInstance() {return instance;}

/**
* Set the actual instance
*
* @param instance the actual instance of the schema/object
*/
public void setActualInstance(Object instance) {this.instance = instance;}

/**
* Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well
*
* @return an instance of the actual schema/object
*/
public Object getActualInstanceRecursively() {
return getActualInstanceRecursively(this);
}

private Object getActualInstanceRecursively(AbstractOpenApiSchema object) {
if (object.getActualInstance() == null) {
return null;
} else if (object.getActualInstance() instanceof AbstractOpenApiSchema) {
return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance());
} else {
return object.getActualInstance();
}
}

/**
* Get the schema type (e.g. anyOf, oneOf)
*
* @return the schema type
*/
public String getSchemaType() {
return schemaType;
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ").append(getClass()).append(" {\n");
sb.append(" instance: ").append(toIndentedString(instance)).append("\n");
sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n");
sb.append(" schemaType: ").append(toIndentedString(schemaType)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}

public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AbstractOpenApiSchema a = (AbstractOpenApiSchema) o;
return Objects.equals(this.instance, a.instance) &&
Objects.equals(this.isNullable, a.isNullable) &&
Objects.equals(this.schemaType, a.schemaType);
}

@Override
public int hashCode() {
return Objects.hash(instance, isNullable, schemaType);
}

/**
* Is nullable
*
* @return true if it's nullable
*/
public Boolean isNullable() {
if (Boolean.TRUE.equals(isNullable)) {
return Boolean.TRUE;
} else {
return Boolean.FALSE;
}
}



}
Loading

0 comments on commit ba706cf

Please sign in to comment.