diff --git a/sdk-generation-log/checkout.json b/sdk-generation-log/checkout.json index 7698d7972..ff3d82fbf 100644 --- a/sdk-generation-log/checkout.json +++ b/sdk-generation-log/checkout.json @@ -1,8 +1,8 @@ { "service": "checkout", "project": "java", - "generatedAt": "2026-07-22T11:25:22Z", - "openapiCommitSha": "c6f0131e5551226fd523852ff6f5ad1df6c72ee2", + "generatedAt": "2026-07-27T10:29:48Z", + "openapiCommitSha": "2f7d0e1961772ee974be4ed268282cf2ba8f6e03", "automationCommitSha": "0c108bd8050cf480d2710b78b770afdfbdd89397", - "libraryCommitSha": "913f166177824e57c26c5f0543b46144219ca6af" + "libraryCommitSha": "8c443c21fa34998ecc2f8d53f4ff947ee0bac438" } diff --git a/src/main/java/com/adyen/model/checkout/CheckoutPaymentMethod.java b/src/main/java/com/adyen/model/checkout/CheckoutPaymentMethod.java index a391ab24b..93f9ee297 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutPaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutPaymentMethod.java @@ -2146,7 +2146,7 @@ public CheckoutPaymentMethod(ZipDetails o) { mappings.put("gcash", StoredPaymentMethodDetails.class); mappings.put("giftcard", CardDetails.class); mappings.put("googlepay", GooglePayDetails.class); - mappings.put("gopay_wallet", PaymentDetails.class); + mappings.put("gopay_wallet", StoredPaymentMethodDetails.class); mappings.put("grabpay_ID", StoredPaymentMethodDetails.class); mappings.put("grabpay_MY", StoredPaymentMethodDetails.class); mappings.put("grabpay_PH", StoredPaymentMethodDetails.class); diff --git a/src/main/java/com/adyen/model/checkout/DonationPaymentMethod.java b/src/main/java/com/adyen/model/checkout/DonationPaymentMethod.java index df1c19b50..fa7ff9544 100644 --- a/src/main/java/com/adyen/model/checkout/DonationPaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/DonationPaymentMethod.java @@ -203,6 +203,32 @@ public DonationPaymentMethod deserialize(JsonParser jp, DeserializationContext c log.log(Level.FINER, "Input data does not match schema 'PayWithGoogleDonations'", e); } + // deserialize SepaDirectDebitDonations + try { + boolean attemptParsing = true; + if (attemptParsing) { + // Checks if the unique type of the oneOf json matches any of the object TypeEnum values + boolean typeMatch = false; + if (tree.findValue("type") != null) { + typeMatch = + Arrays.stream(SepaDirectDebitDonations.TypeEnum.values()) + .anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText())); + } + + if (typeMatch) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(SepaDirectDebitDonations.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'SepaDirectDebitDonations'"); + } + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'SepaDirectDebitDonations'", e); + } + if (match == 1) { DonationPaymentMethod ret = new DonationPaymentMethod(); ret.setActualInstance(deserialized); @@ -254,12 +280,18 @@ public DonationPaymentMethod(PayWithGoogleDonations o) { setActualInstance(o); } + public DonationPaymentMethod(SepaDirectDebitDonations o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + static { schemas.put("ApplePayDonations", new GenericType() {}); schemas.put("CardDonations", new GenericType() {}); schemas.put("GooglePayDonations", new GenericType() {}); schemas.put("IdealDonations", new GenericType() {}); schemas.put("PayWithGoogleDonations", new GenericType() {}); + schemas.put("SepaDirectDebitDonations", new GenericType() {}); JSON.registerDescendants(DonationPaymentMethod.class, Collections.unmodifiableMap(schemas)); // Initialize and register the discriminator mappings. Map> mappings = new HashMap<>(); @@ -270,11 +302,13 @@ public DonationPaymentMethod(PayWithGoogleDonations o) { mappings.put("networkToken", CardDonations.class); mappings.put("paywithgoogle", PayWithGoogleDonations.class); mappings.put("scheme", CardDonations.class); + mappings.put("sepadirectdebit", SepaDirectDebitDonations.class); mappings.put("ApplePayDonations", ApplePayDonations.class); mappings.put("CardDonations", CardDonations.class); mappings.put("GooglePayDonations", GooglePayDonations.class); mappings.put("IdealDonations", IdealDonations.class); mappings.put("PayWithGoogleDonations", PayWithGoogleDonations.class); + mappings.put("SepaDirectDebitDonations", SepaDirectDebitDonations.class); mappings.put("DonationPaymentMethod", DonationPaymentMethod.class); JSON.registerDiscriminator(DonationPaymentMethod.class, "type", mappings); } @@ -287,7 +321,7 @@ public Map> getSchemas() { /** * Set the instance that matches the oneOf child schema, check the instance parameter is valid * against the oneOf child schemas: ApplePayDonations, CardDonations, GooglePayDonations, - * IdealDonations, PayWithGoogleDonations + * IdealDonations, PayWithGoogleDonations, SepaDirectDebitDonations * *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a * composed schema (allOf, anyOf, oneOf). @@ -319,16 +353,21 @@ public void setActualInstance(Object instance) { return; } + if (JSON.isInstanceOf(SepaDirectDebitDonations.class, instance, new HashSet<>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( - "Invalid instance type. Must be ApplePayDonations, CardDonations, GooglePayDonations, IdealDonations, PayWithGoogleDonations"); + "Invalid instance type. Must be ApplePayDonations, CardDonations, GooglePayDonations, IdealDonations, PayWithGoogleDonations, SepaDirectDebitDonations"); } /** * Get the actual instance, which can be the following: ApplePayDonations, CardDonations, - * GooglePayDonations, IdealDonations, PayWithGoogleDonations + * GooglePayDonations, IdealDonations, PayWithGoogleDonations, SepaDirectDebitDonations * * @return The actual instance (ApplePayDonations, CardDonations, GooglePayDonations, - * IdealDonations, PayWithGoogleDonations) + * IdealDonations, PayWithGoogleDonations, SepaDirectDebitDonations) */ @Override public Object getActualInstance() { @@ -390,6 +429,17 @@ public PayWithGoogleDonations getPayWithGoogleDonations() throws ClassCastExcept return (PayWithGoogleDonations) super.getActualInstance(); } + /** + * Get the actual instance of `SepaDirectDebitDonations`. If the actual instance is not + * `SepaDirectDebitDonations`, the ClassCastException will be thrown. + * + * @return The actual instance of `SepaDirectDebitDonations` + * @throws ClassCastException if the instance is not `SepaDirectDebitDonations` + */ + public SepaDirectDebitDonations getSepaDirectDebitDonations() throws ClassCastException { + return (SepaDirectDebitDonations) super.getActualInstance(); + } + /** * Create an instance of DonationPaymentMethod given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentDetails.java b/src/main/java/com/adyen/model/checkout/PaymentDetails.java index 6ade94348..232115ab2 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentDetails.java +++ b/src/main/java/com/adyen/model/checkout/PaymentDetails.java @@ -156,8 +156,6 @@ public enum TypeEnum { OMANNET(String.valueOf("omannet")), - GOPAY_WALLET(String.valueOf("gopay_wallet")), - KCP_NAVERPAY(String.valueOf("kcp_naverpay")), FAWRY(String.valueOf("fawry")), diff --git a/src/main/java/com/adyen/model/checkout/SepaDirectDebitDonations.java b/src/main/java/com/adyen/model/checkout/SepaDirectDebitDonations.java new file mode 100644 index 000000000..86f34597a --- /dev/null +++ b/src/main/java/com/adyen/model/checkout/SepaDirectDebitDonations.java @@ -0,0 +1,454 @@ +/* + * Adyen Checkout API + * + * The version of the OpenAPI document: 72 + * + * + * 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.checkout; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.Arrays; +import java.util.logging.Logger; + +/** SepaDirectDebitDonations */ +@JsonPropertyOrder({ + SepaDirectDebitDonations.JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, + SepaDirectDebitDonations.JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, + SepaDirectDebitDonations.JSON_PROPERTY_SDK_DATA, + SepaDirectDebitDonations.JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, + SepaDirectDebitDonations.JSON_PROPERTY_TYPE +}) +public class SepaDirectDebitDonations { + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; + private String checkoutAttemptId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; + /* deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. */ + @Deprecated private String recurringDetailReference; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; + private String sdkData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; + private String storedPaymentMethodId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + + /** **sepadirectdebit** */ + public enum TypeEnum { + SEPADIRECTDEBIT(String.valueOf("sepadirectdebit")); + + private static final Logger LOG = Logger.getLogger(TypeEnum.class.getName()); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "TypeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(TypeEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public SepaDirectDebitDonations() {} + + /** + * The checkout attempt identifier. + * + * @param checkoutAttemptId The checkout attempt identifier. + * @return the current {@code SepaDirectDebitDonations} instance, allowing for method chaining + */ + public SepaDirectDebitDonations checkoutAttemptId(String checkoutAttemptId) { + this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set + return this; + } + + /** + * The checkout attempt identifier. + * + * @return checkoutAttemptId The checkout attempt identifier. + */ + @JsonProperty(JSON_PROPERTY_CHECKOUT_ATTEMPT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCheckoutAttemptId() { + return checkoutAttemptId; + } + + /** + * The checkout attempt identifier. + * + * @param checkoutAttemptId The checkout attempt identifier. + */ + @JsonProperty(JSON_PROPERTY_CHECKOUT_ATTEMPT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCheckoutAttemptId(String checkoutAttemptId) { + this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set + } + + /** + * This is the `recurringDetailReference` returned in the response when you created the + * token. + * + * @param recurringDetailReference This is the `recurringDetailReference` returned in + * the response when you created the token. + * @return the current {@code SepaDirectDebitDonations} instance, allowing for method chaining + * @deprecated since Adyen Checkout API v49 Use `storedPaymentMethodId` instead. + */ + @Deprecated + public SepaDirectDebitDonations recurringDetailReference(String recurringDetailReference) { + this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set + return this; + } + + /** + * This is the `recurringDetailReference` returned in the response when you created the + * token. + * + * @return recurringDetailReference This is the `recurringDetailReference` returned in + * the response when you created the token. + * @deprecated since Adyen Checkout API v49 Use `storedPaymentMethodId` instead. + */ + @Deprecated + @JsonProperty(JSON_PROPERTY_RECURRING_DETAIL_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRecurringDetailReference() { + return recurringDetailReference; + } + + /** + * This is the `recurringDetailReference` returned in the response when you created the + * token. + * + * @param recurringDetailReference This is the `recurringDetailReference` returned in + * the response when you created the token. + * @deprecated since Adyen Checkout API v49 Use `storedPaymentMethodId` instead. + */ + @Deprecated + @JsonProperty(JSON_PROPERTY_RECURRING_DETAIL_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRecurringDetailReference(String recurringDetailReference) { + this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set + } + + /** + * Base64-encoded JSON object containing SDK related parameters required by the SDK + * + * @param sdkData Base64-encoded JSON object containing SDK related parameters required by the SDK + * @return the current {@code SepaDirectDebitDonations} instance, allowing for method chaining + */ + public SepaDirectDebitDonations sdkData(String sdkData) { + this.sdkData = sdkData; + isSetSdkData = true; // mark as set + return this; + } + + /** + * Base64-encoded JSON object containing SDK related parameters required by the SDK + * + * @return sdkData Base64-encoded JSON object containing SDK related parameters required by the + * SDK + */ + @JsonProperty(JSON_PROPERTY_SDK_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSdkData() { + return sdkData; + } + + /** + * Base64-encoded JSON object containing SDK related parameters required by the SDK + * + * @param sdkData Base64-encoded JSON object containing SDK related parameters required by the SDK + */ + @JsonProperty(JSON_PROPERTY_SDK_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSdkData(String sdkData) { + this.sdkData = sdkData; + isSetSdkData = true; // mark as set + } + + /** + * This is the `recurringDetailReference` returned in the response when you created the + * token. + * + * @param storedPaymentMethodId This is the `recurringDetailReference` returned in the + * response when you created the token. + * @return the current {@code SepaDirectDebitDonations} instance, allowing for method chaining + */ + public SepaDirectDebitDonations storedPaymentMethodId(String storedPaymentMethodId) { + this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + return this; + } + + /** + * This is the `recurringDetailReference` returned in the response when you created the + * token. + * + * @return storedPaymentMethodId This is the `recurringDetailReference` returned in the + * response when you created the token. + */ + @JsonProperty(JSON_PROPERTY_STORED_PAYMENT_METHOD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStoredPaymentMethodId() { + return storedPaymentMethodId; + } + + /** + * This is the `recurringDetailReference` returned in the response when you created the + * token. + * + * @param storedPaymentMethodId This is the `recurringDetailReference` returned in the + * response when you created the token. + */ + @JsonProperty(JSON_PROPERTY_STORED_PAYMENT_METHOD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredPaymentMethodId(String storedPaymentMethodId) { + this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + } + + /** + * **sepadirectdebit** + * + * @param type **sepadirectdebit** + * @return the current {@code SepaDirectDebitDonations} instance, allowing for method chaining + */ + public SepaDirectDebitDonations type(TypeEnum type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * **sepadirectdebit** + * + * @return type **sepadirectdebit** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TypeEnum getType() { + return type; + } + + /** + * **sepadirectdebit** + * + * @param type **sepadirectdebit** + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SepaDirectDebitDonations includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this SepaDirectDebitDonations object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SepaDirectDebitDonations sepaDirectDebitDonations = (SepaDirectDebitDonations) o; + return Objects.equals(this.checkoutAttemptId, sepaDirectDebitDonations.checkoutAttemptId) + && Objects.equals( + this.isSetCheckoutAttemptId, sepaDirectDebitDonations.isSetCheckoutAttemptId) + && Objects.equals( + this.recurringDetailReference, sepaDirectDebitDonations.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, + sepaDirectDebitDonations.isSetRecurringDetailReference) + && Objects.equals(this.sdkData, sepaDirectDebitDonations.sdkData) + && Objects.equals(this.isSetSdkData, sepaDirectDebitDonations.isSetSdkData) + && Objects.equals( + this.storedPaymentMethodId, sepaDirectDebitDonations.storedPaymentMethodId) + && Objects.equals( + this.isSetStoredPaymentMethodId, sepaDirectDebitDonations.isSetStoredPaymentMethodId) + && Objects.equals(this.type, sepaDirectDebitDonations.type) + && Objects.equals(this.isSetType, sepaDirectDebitDonations.isSetType); + } + + @Override + public int hashCode() { + return Objects.hash( + checkoutAttemptId, + isSetCheckoutAttemptId, + recurringDetailReference, + isSetRecurringDetailReference, + sdkData, + isSetSdkData, + storedPaymentMethodId, + isSetStoredPaymentMethodId, + type, + isSetType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SepaDirectDebitDonations {\n"); + sb.append(" checkoutAttemptId: ").append(toIndentedString(checkoutAttemptId)).append("\n"); + sb.append(" recurringDetailReference: ") + .append(toIndentedString(recurringDetailReference)) + .append("\n"); + sb.append(" sdkData: ").append(toIndentedString(sdkData)).append("\n"); + sb.append(" storedPaymentMethodId: ") + .append(toIndentedString(storedPaymentMethodId)) + .append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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 "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of SepaDirectDebitDonations given an JSON string + * + * @param jsonString JSON string + * @return An instance of SepaDirectDebitDonations + * @throws JsonProcessingException if the JSON string is invalid with respect to + * SepaDirectDebitDonations + */ + public static SepaDirectDebitDonations fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, SepaDirectDebitDonations.class); + } + + /** + * Convert an instance of SepaDirectDebitDonations to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java index ba1c3c5af..5a62f6d41 100644 --- a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java +++ b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java @@ -117,7 +117,9 @@ public enum TypeEnum { TRUEMONEY(String.valueOf("truemoney")), - PAYSAFECARD(String.valueOf("paysafecard")); + PAYSAFECARD(String.valueOf("paysafecard")), + + GOPAY_WALLET(String.valueOf("gopay_wallet")); private static final Logger LOG = Logger.getLogger(TypeEnum.class.getName());