From 0649e476f64b7736ed2bdca47edd168200fadc08 Mon Sep 17 00:00:00 2001 From: AdyenAutomationBot <38424300+AdyenAutomationBot@users.noreply.github.com> Date: Thu, 8 Oct 2026 14:22:54 +0000 Subject: [PATCH 1/2] [checkout] Automated update from Adyen/adyen-openapi@45520ee --- sdk-generation-log/checkout.json | 8 +- .../CheckoutForwardAccountUpdateResult.java | 255 ++++++++++ .../CheckoutForwardNetworkTokenResult.java | 191 ++++++++ .../CheckoutForwardRequestOptions.java | 97 ++-- .../checkout/CheckoutForwardResponse.java | 102 +++- .../model/checkout/CheckoutPaymentMethod.java | 94 +++- .../CheckoutSessionInstallmentOption.java | 36 +- .../CreateCheckoutSessionRequest.java | 77 +++ .../CreateCheckoutSessionResponse.java | 78 +++ .../model/checkout/KlarnaNetworkDetails.java | 65 +++ .../com/adyen/model/checkout/LineItem.java | 56 +++ .../com/adyen/model/checkout/OpiRequest.java | 232 +++++++++ .../com/adyen/model/checkout/OpiResponse.java | 222 +++++++++ .../PayByBankCADirectDebitDetails.java | 460 ++++++++++++++++++ .../adyen/model/checkout/PaymentDetails.java | 2 + .../checkout/PaymentDetailsResponse.java | 50 ++ .../adyen/model/checkout/PaymentRequest.java | 80 ++- .../adyen/model/checkout/PaymentResponse.java | 50 ++ .../checkout/StoredPaymentMethodRequest.java | 50 ++ .../checkout/StoredPaymentMethodResource.java | 50 ++ 20 files changed, 2150 insertions(+), 105 deletions(-) create mode 100644 src/main/java/com/adyen/model/checkout/CheckoutForwardAccountUpdateResult.java create mode 100644 src/main/java/com/adyen/model/checkout/CheckoutForwardNetworkTokenResult.java create mode 100644 src/main/java/com/adyen/model/checkout/OpiRequest.java create mode 100644 src/main/java/com/adyen/model/checkout/OpiResponse.java create mode 100644 src/main/java/com/adyen/model/checkout/PayByBankCADirectDebitDetails.java diff --git a/sdk-generation-log/checkout.json b/sdk-generation-log/checkout.json index 8a0ddeb25e..e0d86037b3 100644 --- a/sdk-generation-log/checkout.json +++ b/sdk-generation-log/checkout.json @@ -1,8 +1,8 @@ { "service": "checkout", "project": "java", - "generatedAt": "2026-08-21T14:02:21Z", - "openapiCommitSha": "bee086f2cd666ac7cb5b5ba2813a8b5dc943c2d2", - "automationCommitSha": "8d09e0f762f7b00c707748d84d0d002964410c0f", - "libraryCommitSha": "bca8a14bd8bfd031e109bbf12684150f37b17a2b" + "generatedAt": "2026-10-08T14:22:53Z", + "openapiCommitSha": "45520ee6246d7e3d8074c3c5c5e991e65c2c02d6", + "automationCommitSha": "82147244fd717b50362f88a20e4436e693d0aed6", + "libraryCommitSha": "00947dacaaee54f8ed6e4929cc04f243e32ad898" } diff --git a/src/main/java/com/adyen/model/checkout/CheckoutForwardAccountUpdateResult.java b/src/main/java/com/adyen/model/checkout/CheckoutForwardAccountUpdateResult.java new file mode 100644 index 0000000000..a75b07181e --- /dev/null +++ b/src/main/java/com/adyen/model/checkout/CheckoutForwardAccountUpdateResult.java @@ -0,0 +1,255 @@ +/* + * 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; + +/** CheckoutForwardAccountUpdateResult */ +@JsonPropertyOrder({CheckoutForwardAccountUpdateResult.JSON_PROPERTY_RESULT}) +public class CheckoutForwardAccountUpdateResult { + /** + * The result of the [Real Time Account + * Updater](https://docs.adyen.com/online-payments/account-updater/real-time-account-updater). + * Possible values: * NoChange * CardChanged * CardExpiryChanged * CloseAccount * + * ContactCardAccountHolder * Error + */ + public enum ResultEnum { + CARDCHANGED(String.valueOf("CardChanged")), + + CARDEXPIRYCHANGED(String.valueOf("CardExpiryChanged")), + + CLOSEACCOUNT(String.valueOf("CloseAccount")), + + CONTACTCARDACCOUNTHOLDER(String.valueOf("ContactCardAccountHolder")), + + ERROR(String.valueOf("Error")), + + NOCHANGE(String.valueOf("NoChange")); + + private static final Logger LOG = Logger.getLogger(ResultEnum.class.getName()); + + private String value; + + ResultEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ResultEnum fromValue(String value) { + for (ResultEnum b : ResultEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "ResultEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(ResultEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_RESULT = "result"; + private ResultEnum result; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResult = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CheckoutForwardAccountUpdateResult() {} + + /** + * The result of the [Real Time Account + * Updater](https://docs.adyen.com/online-payments/account-updater/real-time-account-updater). + * Possible values: * NoChange * CardChanged * CardExpiryChanged * CloseAccount * + * ContactCardAccountHolder * Error + * + * @param result The result of the [Real Time Account + * Updater](https://docs.adyen.com/online-payments/account-updater/real-time-account-updater). + * Possible values: * NoChange * CardChanged * CardExpiryChanged * CloseAccount * + * ContactCardAccountHolder * Error + * @return the current {@code CheckoutForwardAccountUpdateResult} instance, allowing for method + * chaining + */ + public CheckoutForwardAccountUpdateResult result(ResultEnum result) { + this.result = result; + isSetResult = true; // mark as set + return this; + } + + /** + * The result of the [Real Time Account + * Updater](https://docs.adyen.com/online-payments/account-updater/real-time-account-updater). + * Possible values: * NoChange * CardChanged * CardExpiryChanged * CloseAccount * + * ContactCardAccountHolder * Error + * + * @return result The result of the [Real Time Account + * Updater](https://docs.adyen.com/online-payments/account-updater/real-time-account-updater). + * Possible values: * NoChange * CardChanged * CardExpiryChanged * CloseAccount * + * ContactCardAccountHolder * Error + */ + @JsonProperty(JSON_PROPERTY_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ResultEnum getResult() { + return result; + } + + /** + * The result of the [Real Time Account + * Updater](https://docs.adyen.com/online-payments/account-updater/real-time-account-updater). + * Possible values: * NoChange * CardChanged * CardExpiryChanged * CloseAccount * + * ContactCardAccountHolder * Error + * + * @param result The result of the [Real Time Account + * Updater](https://docs.adyen.com/online-payments/account-updater/real-time-account-updater). + * Possible values: * NoChange * CardChanged * CardExpiryChanged * CloseAccount * + * ContactCardAccountHolder * Error + */ + @JsonProperty(JSON_PROPERTY_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResult(ResultEnum result) { + this.result = result; + isSetResult = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutForwardAccountUpdateResult 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 CheckoutForwardAccountUpdateResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CheckoutForwardAccountUpdateResult checkoutForwardAccountUpdateResult = + (CheckoutForwardAccountUpdateResult) o; + return Objects.equals(this.result, checkoutForwardAccountUpdateResult.result) + && Objects.equals(this.isSetResult, checkoutForwardAccountUpdateResult.isSetResult); + } + + @Override + public int hashCode() { + return Objects.hash(result, isSetResult); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CheckoutForwardAccountUpdateResult {\n"); + sb.append(" result: ").append(toIndentedString(result)).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 (isSetResult) { + addIfNull(nulls, JSON_PROPERTY_RESULT, this.result); + } + + 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 CheckoutForwardAccountUpdateResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of CheckoutForwardAccountUpdateResult + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CheckoutForwardAccountUpdateResult + */ + public static CheckoutForwardAccountUpdateResult fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CheckoutForwardAccountUpdateResult.class); + } + + /** + * Convert an instance of CheckoutForwardAccountUpdateResult 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/CheckoutForwardNetworkTokenResult.java b/src/main/java/com/adyen/model/checkout/CheckoutForwardNetworkTokenResult.java new file mode 100644 index 0000000000..f5228adc00 --- /dev/null +++ b/src/main/java/com/adyen/model/checkout/CheckoutForwardNetworkTokenResult.java @@ -0,0 +1,191 @@ +/* + * 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** CheckoutForwardNetworkTokenResult */ +@JsonPropertyOrder({CheckoutForwardNetworkTokenResult.JSON_PROPERTY_SWAPPED}) +public class CheckoutForwardNetworkTokenResult { + public static final String JSON_PROPERTY_SWAPPED = "swapped"; + private Boolean swapped; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSwapped = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CheckoutForwardNetworkTokenResult() {} + + /** + * Indicates whether a network token was used in the forwarded request. When `true`, the + * Primary Account Number (PAN) was successfully swapped for a network token. When + * `false`, the request fell back to the PAN. + * + * @param swapped Indicates whether a network token was used in the forwarded request. When + * `true`, the Primary Account Number (PAN) was successfully swapped for a network + * token. When `false`, the request fell back to the PAN. + * @return the current {@code CheckoutForwardNetworkTokenResult} instance, allowing for method + * chaining + */ + public CheckoutForwardNetworkTokenResult swapped(Boolean swapped) { + this.swapped = swapped; + isSetSwapped = true; // mark as set + return this; + } + + /** + * Indicates whether a network token was used in the forwarded request. When `true`, the + * Primary Account Number (PAN) was successfully swapped for a network token. When + * `false`, the request fell back to the PAN. + * + * @return swapped Indicates whether a network token was used in the forwarded request. When + * `true`, the Primary Account Number (PAN) was successfully swapped for a network + * token. When `false`, the request fell back to the PAN. + */ + @JsonProperty(JSON_PROPERTY_SWAPPED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSwapped() { + return swapped; + } + + /** + * Indicates whether a network token was used in the forwarded request. When `true`, the + * Primary Account Number (PAN) was successfully swapped for a network token. When + * `false`, the request fell back to the PAN. + * + * @param swapped Indicates whether a network token was used in the forwarded request. When + * `true`, the Primary Account Number (PAN) was successfully swapped for a network + * token. When `false`, the request fell back to the PAN. + */ + @JsonProperty(JSON_PROPERTY_SWAPPED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSwapped(Boolean swapped) { + this.swapped = swapped; + isSetSwapped = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutForwardNetworkTokenResult 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 CheckoutForwardNetworkTokenResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CheckoutForwardNetworkTokenResult checkoutForwardNetworkTokenResult = + (CheckoutForwardNetworkTokenResult) o; + return Objects.equals(this.swapped, checkoutForwardNetworkTokenResult.swapped) + && Objects.equals(this.isSetSwapped, checkoutForwardNetworkTokenResult.isSetSwapped); + } + + @Override + public int hashCode() { + return Objects.hash(swapped, isSetSwapped); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CheckoutForwardNetworkTokenResult {\n"); + sb.append(" swapped: ").append(toIndentedString(swapped)).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 (isSetSwapped) { + addIfNull(nulls, JSON_PROPERTY_SWAPPED, this.swapped); + } + + 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 CheckoutForwardNetworkTokenResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of CheckoutForwardNetworkTokenResult + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CheckoutForwardNetworkTokenResult + */ + public static CheckoutForwardNetworkTokenResult fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CheckoutForwardNetworkTokenResult.class); + } + + /** + * Convert an instance of CheckoutForwardNetworkTokenResult 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/CheckoutForwardRequestOptions.java b/src/main/java/com/adyen/model/checkout/CheckoutForwardRequestOptions.java index 516afe06fe..1789e620c1 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutForwardRequestOptions.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutForwardRequestOptions.java @@ -76,9 +76,9 @@ public class CheckoutForwardRequestOptions { public CheckoutForwardRequestOptions() {} /** - * Whether to check for a card account update (true) or not (false) + * Set to **true** to check if the account tied to the card has been updated. * - * @param accountUpdate Whether to check for a card account update (true) or not (false) + * @param accountUpdate Set to **true** to check if the account tied to the card has been updated. * @return the current {@code CheckoutForwardRequestOptions} instance, allowing for method * chaining */ @@ -89,9 +89,10 @@ public CheckoutForwardRequestOptions accountUpdate(Boolean accountUpdate) { } /** - * Whether to check for a card account update (true) or not (false) + * Set to **true** to check if the account tied to the card has been updated. * - * @return accountUpdate Whether to check for a card account update (true) or not (false) + * @return accountUpdate Set to **true** to check if the account tied to the card has been + * updated. */ @JsonProperty(JSON_PROPERTY_ACCOUNT_UPDATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -100,9 +101,9 @@ public Boolean getAccountUpdate() { } /** - * Whether to check for a card account update (true) or not (false) + * Set to **true** to check if the account tied to the card has been updated. * - * @param accountUpdate Whether to check for a card account update (true) or not (false) + * @param accountUpdate Set to **true** to check if the account tied to the card has been updated. */ @JsonProperty(JSON_PROPERTY_ACCOUNT_UPDATE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -196,11 +197,13 @@ public void setNetworkToken(CheckoutNetworkTokenOption networkToken) { } /** - * Set in tokenize:true case when forwarding PAN. Addresses to the possible location(s) of - * networkTxReference in the incoming 3rd party response + * Only include when `tokenize` is set to **true**.<br><br>A list of + * addresses to possible location(s) of the `networkTxReference` that will be returned + * in the third party response. * - * @param networkTxReferencePaths Set in tokenize:true case when forwarding PAN. Addresses to the - * possible location(s) of networkTxReference in the incoming 3rd party response + * @param networkTxReferencePaths Only include when `tokenize` is set to + * **true**.<br><br>A list of addresses to possible location(s) of the + * `networkTxReference` that will be returned in the third party response. * @return the current {@code CheckoutForwardRequestOptions} instance, allowing for method * chaining */ @@ -221,11 +224,13 @@ public CheckoutForwardRequestOptions addNetworkTxReferencePathsItem( } /** - * Set in tokenize:true case when forwarding PAN. Addresses to the possible location(s) of - * networkTxReference in the incoming 3rd party response + * Only include when `tokenize` is set to **true**.<br><br>A list of + * addresses to possible location(s) of the `networkTxReference` that will be returned + * in the third party response. * - * @return networkTxReferencePaths Set in tokenize:true case when forwarding PAN. Addresses to the - * possible location(s) of networkTxReference in the incoming 3rd party response + * @return networkTxReferencePaths Only include when `tokenize` is set to + * **true**.<br><br>A list of addresses to possible location(s) of the + * `networkTxReference` that will be returned in the third party response. */ @JsonProperty(JSON_PROPERTY_NETWORK_TX_REFERENCE_PATHS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -234,11 +239,13 @@ public List getNetworkTxReferencePaths() { } /** - * Set in tokenize:true case when forwarding PAN. Addresses to the possible location(s) of - * networkTxReference in the incoming 3rd party response + * Only include when `tokenize` is set to **true**.<br><br>A list of + * addresses to possible location(s) of the `networkTxReference` that will be returned + * in the third party response. * - * @param networkTxReferencePaths Set in tokenize:true case when forwarding PAN. Addresses to the - * possible location(s) of networkTxReference in the incoming 3rd party response + * @param networkTxReferencePaths Only include when `tokenize` is set to + * **true**.<br><br>A list of addresses to possible location(s) of the + * `networkTxReference` that will be returned in the third party response. */ @JsonProperty(JSON_PROPERTY_NETWORK_TX_REFERENCE_PATHS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -248,11 +255,11 @@ public void setNetworkTxReferencePaths(List networkTxReferencePaths) { } /** - * Set to **true**, the payment details are - * [tokenized](https://docs.adyen.com/online-payments/tokenization). + * Set to **true** to [tokenize](https://docs.adyen.com/online-payments/tokenization) the payment + * details. * - * @param tokenize Set to **true**, the payment details are - * [tokenized](https://docs.adyen.com/online-payments/tokenization). + * @param tokenize Set to **true** to + * [tokenize](https://docs.adyen.com/online-payments/tokenization) the payment details. * @return the current {@code CheckoutForwardRequestOptions} instance, allowing for method * chaining */ @@ -263,11 +270,11 @@ public CheckoutForwardRequestOptions tokenize(Boolean tokenize) { } /** - * Set to **true**, the payment details are - * [tokenized](https://docs.adyen.com/online-payments/tokenization). + * Set to **true** to [tokenize](https://docs.adyen.com/online-payments/tokenization) the payment + * details. * - * @return tokenize Set to **true**, the payment details are - * [tokenized](https://docs.adyen.com/online-payments/tokenization). + * @return tokenize Set to **true** to + * [tokenize](https://docs.adyen.com/online-payments/tokenization) the payment details. */ @JsonProperty(JSON_PROPERTY_TOKENIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -276,11 +283,11 @@ public Boolean getTokenize() { } /** - * Set to **true**, the payment details are - * [tokenized](https://docs.adyen.com/online-payments/tokenization). + * Set to **true** to [tokenize](https://docs.adyen.com/online-payments/tokenization) the payment + * details. * - * @param tokenize Set to **true**, the payment details are - * [tokenized](https://docs.adyen.com/online-payments/tokenization). + * @param tokenize Set to **true** to + * [tokenize](https://docs.adyen.com/online-payments/tokenization) the payment details. */ @JsonProperty(JSON_PROPERTY_TOKENIZE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -290,11 +297,13 @@ public void setTokenize(Boolean tokenize) { } /** - * Set in tokenize:true case when forwarding PAN. Addresses to the possible location(s) of - * transactionLinkId in the incoming 3rd party response + * Only include when `tokenize` is set to **true**.<br><br>A list of + * addresses to possible location(s) of the `transactionLinkId` that will be returned in + * the third party response. * - * @param transactionLinkIdPaths Set in tokenize:true case when forwarding PAN. Addresses to the - * possible location(s) of transactionLinkId in the incoming 3rd party response + * @param transactionLinkIdPaths Only include when `tokenize` is set to + * **true**.<br><br>A list of addresses to possible location(s) of the + * `transactionLinkId` that will be returned in the third party response. * @return the current {@code CheckoutForwardRequestOptions} instance, allowing for method * chaining */ @@ -314,11 +323,13 @@ public CheckoutForwardRequestOptions addTransactionLinkIdPathsItem( } /** - * Set in tokenize:true case when forwarding PAN. Addresses to the possible location(s) of - * transactionLinkId in the incoming 3rd party response + * Only include when `tokenize` is set to **true**.<br><br>A list of + * addresses to possible location(s) of the `transactionLinkId` that will be returned in + * the third party response. * - * @return transactionLinkIdPaths Set in tokenize:true case when forwarding PAN. Addresses to the - * possible location(s) of transactionLinkId in the incoming 3rd party response + * @return transactionLinkIdPaths Only include when `tokenize` is set to + * **true**.<br><br>A list of addresses to possible location(s) of the + * `transactionLinkId` that will be returned in the third party response. */ @JsonProperty(JSON_PROPERTY_TRANSACTION_LINK_ID_PATHS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -327,11 +338,13 @@ public List getTransactionLinkIdPaths() { } /** - * Set in tokenize:true case when forwarding PAN. Addresses to the possible location(s) of - * transactionLinkId in the incoming 3rd party response + * Only include when `tokenize` is set to **true**.<br><br>A list of + * addresses to possible location(s) of the `transactionLinkId` that will be returned in + * the third party response. * - * @param transactionLinkIdPaths Set in tokenize:true case when forwarding PAN. Addresses to the - * possible location(s) of transactionLinkId in the incoming 3rd party response + * @param transactionLinkIdPaths Only include when `tokenize` is set to + * **true**.<br><br>A list of addresses to possible location(s) of the + * `transactionLinkId` that will be returned in the third party response. */ @JsonProperty(JSON_PROPERTY_TRANSACTION_LINK_ID_PATHS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/adyen/model/checkout/CheckoutForwardResponse.java b/src/main/java/com/adyen/model/checkout/CheckoutForwardResponse.java index d5cc91ada5..badcc51705 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutForwardResponse.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutForwardResponse.java @@ -21,18 +21,32 @@ /** CheckoutForwardResponse */ @JsonPropertyOrder({ + CheckoutForwardResponse.JSON_PROPERTY_ACCOUNT_UPDATE, CheckoutForwardResponse.JSON_PROPERTY_MERCHANT_REFERENCE, + CheckoutForwardResponse.JSON_PROPERTY_NETWORK_TOKEN, CheckoutForwardResponse.JSON_PROPERTY_PSP_REFERENCE, CheckoutForwardResponse.JSON_PROPERTY_RESPONSE, CheckoutForwardResponse.JSON_PROPERTY_STORED_PAYMENT_METHOD_ID }) public class CheckoutForwardResponse { + public static final String JSON_PROPERTY_ACCOUNT_UPDATE = "accountUpdate"; + private CheckoutForwardAccountUpdateResult accountUpdate; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountUpdate = false; + public static final String JSON_PROPERTY_MERCHANT_REFERENCE = "merchantReference"; private String merchantReference; /** Mark when the attribute has been explicitly set. */ private boolean isSetMerchantReference = false; + public static final String JSON_PROPERTY_NETWORK_TOKEN = "networkToken"; + private CheckoutForwardNetworkTokenResult networkToken; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkToken = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; @@ -59,6 +73,41 @@ public class CheckoutForwardResponse { public CheckoutForwardResponse() {} + /** + * accountUpdate + * + * @param accountUpdate + * @return the current {@code CheckoutForwardResponse} instance, allowing for method chaining + */ + public CheckoutForwardResponse accountUpdate(CheckoutForwardAccountUpdateResult accountUpdate) { + this.accountUpdate = accountUpdate; + isSetAccountUpdate = true; // mark as set + return this; + } + + /** + * Get accountUpdate + * + * @return accountUpdate + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_UPDATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CheckoutForwardAccountUpdateResult getAccountUpdate() { + return accountUpdate; + } + + /** + * accountUpdate + * + * @param accountUpdate + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_UPDATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountUpdate(CheckoutForwardAccountUpdateResult accountUpdate) { + this.accountUpdate = accountUpdate; + isSetAccountUpdate = true; // mark as set + } + /** * Merchant defined payment reference. * @@ -94,6 +143,41 @@ public void setMerchantReference(String merchantReference) { isSetMerchantReference = true; // mark as set } + /** + * networkToken + * + * @param networkToken + * @return the current {@code CheckoutForwardResponse} instance, allowing for method chaining + */ + public CheckoutForwardResponse networkToken(CheckoutForwardNetworkTokenResult networkToken) { + this.networkToken = networkToken; + isSetNetworkToken = true; // mark as set + return this; + } + + /** + * Get networkToken + * + * @return networkToken + */ + @JsonProperty(JSON_PROPERTY_NETWORK_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CheckoutForwardNetworkTokenResult getNetworkToken() { + return networkToken; + } + + /** + * networkToken + * + * @param networkToken + */ + @JsonProperty(JSON_PROPERTY_NETWORK_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNetworkToken(CheckoutForwardNetworkTokenResult networkToken) { + this.networkToken = networkToken; + isSetNetworkToken = true; // mark as set + } + /** * Adyen's 16-character reference associated with the transaction/request. This value is * globally unique. Use this reference when you communicate with us about this request. @@ -238,9 +322,13 @@ public boolean equals(Object o) { return false; } CheckoutForwardResponse checkoutForwardResponse = (CheckoutForwardResponse) o; - return Objects.equals(this.merchantReference, checkoutForwardResponse.merchantReference) + return Objects.equals(this.accountUpdate, checkoutForwardResponse.accountUpdate) + && Objects.equals(this.isSetAccountUpdate, checkoutForwardResponse.isSetAccountUpdate) + && Objects.equals(this.merchantReference, checkoutForwardResponse.merchantReference) && Objects.equals( this.isSetMerchantReference, checkoutForwardResponse.isSetMerchantReference) + && Objects.equals(this.networkToken, checkoutForwardResponse.networkToken) + && Objects.equals(this.isSetNetworkToken, checkoutForwardResponse.isSetNetworkToken) && Objects.equals(this.pspReference, checkoutForwardResponse.pspReference) && Objects.equals(this.isSetPspReference, checkoutForwardResponse.isSetPspReference) && Objects.equals(this.response, checkoutForwardResponse.response) @@ -253,8 +341,12 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( + accountUpdate, + isSetAccountUpdate, merchantReference, isSetMerchantReference, + networkToken, + isSetNetworkToken, pspReference, isSetPspReference, response, @@ -267,7 +359,9 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CheckoutForwardResponse {\n"); + sb.append(" accountUpdate: ").append(toIndentedString(accountUpdate)).append("\n"); sb.append(" merchantReference: ").append(toIndentedString(merchantReference)).append("\n"); + sb.append(" networkToken: ").append(toIndentedString(networkToken)).append("\n"); sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); sb.append(" response: ").append(toIndentedString(response)).append("\n"); sb.append(" storedPaymentMethodId: ") @@ -297,9 +391,15 @@ public Map getExplicitNulls() { Map nulls = new HashMap<>(); + if (isSetAccountUpdate) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_UPDATE, this.accountUpdate); + } if (isSetMerchantReference) { addIfNull(nulls, JSON_PROPERTY_MERCHANT_REFERENCE, this.merchantReference); } + if (isSetNetworkToken) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_TOKEN, this.networkToken); + } if (isSetPspReference) { addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); } diff --git a/src/main/java/com/adyen/model/checkout/CheckoutPaymentMethod.java b/src/main/java/com/adyen/model/checkout/CheckoutPaymentMethod.java index 93f9ee297d..b9b28f4528 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutPaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutPaymentMethod.java @@ -987,6 +987,33 @@ public CheckoutPaymentMethod deserialize(JsonParser jp, DeserializationContext c Level.FINER, "Input data does not match schema 'PayByBankAISDirectDebitDetails'", e); } + // deserialize PayByBankCADirectDebitDetails + 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(PayByBankCADirectDebitDetails.TypeEnum.values()) + .anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText())); + } + + if (typeMatch) { + deserialized = + tree.traverse(jp.getCodec()).readValueAs(PayByBankCADirectDebitDetails.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 'PayByBankCADirectDebitDetails'"); + } + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'PayByBankCADirectDebitDetails'", e); + } + // deserialize PayByBankDetails try { boolean attemptParsing = true; @@ -1840,6 +1867,11 @@ public CheckoutPaymentMethod(PayByBankAISDirectDebitDetails o) { setActualInstance(o); } + public CheckoutPaymentMethod(PayByBankCADirectDebitDetails o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + public CheckoutPaymentMethod(PayByBankDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); @@ -2004,6 +2036,8 @@ public CheckoutPaymentMethod(ZipDetails o) { schemas.put("OpenInvoiceDetails", new GenericType() {}); schemas.put( "PayByBankAISDirectDebitDetails", new GenericType() {}); + schemas.put( + "PayByBankCADirectDebitDetails", new GenericType() {}); schemas.put("PayByBankDetails", new GenericType() {}); schemas.put("PayPalDetails", new GenericType() {}); schemas.put("PayPayDetails", new GenericType() {}); @@ -2214,6 +2248,7 @@ public CheckoutPaymentMethod(ZipDetails o) { mappings.put("oxxo", StoredPaymentMethodDetails.class); mappings.put("paybybank", PayByBankDetails.class); mappings.put("paybybank_AIS_DD", PayByBankAISDirectDebitDetails.class); + mappings.put("paybybank_ca", PayByBankCADirectDebitDetails.class); mappings.put("paybybank_pix", PixPayByBankDetails.class); mappings.put("paymaya_wallet", StoredPaymentMethodDetails.class); mappings.put("payme", PaymentDetails.class); @@ -2240,6 +2275,7 @@ public CheckoutPaymentMethod(ZipDetails o) { mappings.put("riverty_account", RivertyDetails.class); mappings.put("riverty_installments", RivertyDetails.class); mappings.put("samsungpay", SamsungPayDetails.class); + mappings.put("satispay", PaymentDetails.class); mappings.put("scalapay", PaymentDetails.class); mappings.put("scalapay_3x", PaymentDetails.class); mappings.put("scalapay_4x", PaymentDetails.class); @@ -2308,6 +2344,7 @@ public CheckoutPaymentMethod(ZipDetails o) { mappings.put("MolPayDetails", MolPayDetails.class); mappings.put("OpenInvoiceDetails", OpenInvoiceDetails.class); mappings.put("PayByBankAISDirectDebitDetails", PayByBankAISDirectDebitDetails.class); + mappings.put("PayByBankCADirectDebitDetails", PayByBankCADirectDebitDetails.class); mappings.put("PayByBankDetails", PayByBankDetails.class); mappings.put("PayPalDetails", PayPalDetails.class); mappings.put("PayPayDetails", PayPayDetails.class); @@ -2351,12 +2388,13 @@ public Map> getSchemas() { * EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, ExternalTokenDetails, * FastlaneDetails, GenericIssuerPaymentMethodDetails, GooglePayDetails, IdealDetails, * KlarnaDetails, KlarnaNetworkDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, - * MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, PayByBankDetails, - * PayPalDetails, PayPayDetails, PayToDetails, PayUUpiDetails, PayWithGoogleDetails, - * PaymentDetails, PixDetails, PixPayByBankDetails, PseDetails, RakutenPayDetails, RatepayDetails, - * RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, - * TwintDetails, UpiCollectDetails, UpiIntentDetails, UpiQrDetails, VippsDetails, - * VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails + * MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, + * PayByBankCADirectDebitDetails, PayByBankDetails, PayPalDetails, PayPayDetails, PayToDetails, + * PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, PixDetails, PixPayByBankDetails, + * PseDetails, RakutenPayDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, + * SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, + * UpiIntentDetails, UpiQrDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, + * WeChatPayMiniProgramDetails, ZipDetails * *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a * composed schema (allOf, anyOf, oneOf). @@ -2538,6 +2576,11 @@ public void setActualInstance(Object instance) { return; } + if (JSON.isInstanceOf(PayByBankCADirectDebitDetails.class, instance, new HashSet<>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(PayByBankDetails.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; @@ -2664,7 +2707,7 @@ public void setActualInstance(Object instance) { } throw new RuntimeException( - "Invalid instance type. Must be AchDetails, AffirmDetails, AfterpayDetails, AlmaDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, AuPayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DBaraiDetails, DirectDebitAuDetails, DokuDetails, DragonpayDetails, EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, ExternalTokenDetails, FastlaneDetails, GenericIssuerPaymentMethodDetails, GooglePayDetails, IdealDetails, KlarnaDetails, KlarnaNetworkDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, PayByBankDetails, PayPalDetails, PayPayDetails, PayToDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, PixDetails, PixPayByBankDetails, PseDetails, RakutenPayDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, UpiIntentDetails, UpiQrDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails"); + "Invalid instance type. Must be AchDetails, AffirmDetails, AfterpayDetails, AlmaDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, AuPayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DBaraiDetails, DirectDebitAuDetails, DokuDetails, DragonpayDetails, EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, ExternalTokenDetails, FastlaneDetails, GenericIssuerPaymentMethodDetails, GooglePayDetails, IdealDetails, KlarnaDetails, KlarnaNetworkDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, PayByBankCADirectDebitDetails, PayByBankDetails, PayPalDetails, PayPayDetails, PayToDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, PixDetails, PixPayByBankDetails, PseDetails, RakutenPayDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, UpiIntentDetails, UpiQrDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails"); } /** @@ -2676,11 +2719,12 @@ public void setActualInstance(Object instance) { * ExternalTokenDetails, FastlaneDetails, GenericIssuerPaymentMethodDetails, GooglePayDetails, * IdealDetails, KlarnaDetails, KlarnaNetworkDetails, MasterpassDetails, MbwayDetails, * MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, - * PayByBankDetails, PayPalDetails, PayPayDetails, PayToDetails, PayUUpiDetails, - * PayWithGoogleDetails, PaymentDetails, PixDetails, PixPayByBankDetails, PseDetails, - * RakutenPayDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, - * StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, UpiIntentDetails, UpiQrDetails, - * VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails + * PayByBankCADirectDebitDetails, PayByBankDetails, PayPalDetails, PayPayDetails, PayToDetails, + * PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, PixDetails, PixPayByBankDetails, + * PseDetails, RakutenPayDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, + * SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, + * UpiIntentDetails, UpiQrDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, + * WeChatPayMiniProgramDetails, ZipDetails * * @return The actual instance (AchDetails, AffirmDetails, AfterpayDetails, AlmaDetails, * AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, AuPayDetails, @@ -2689,13 +2733,13 @@ public void setActualInstance(Object instance) { * EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, ExternalTokenDetails, * FastlaneDetails, GenericIssuerPaymentMethodDetails, GooglePayDetails, IdealDetails, * KlarnaDetails, KlarnaNetworkDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, - * MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, PayByBankDetails, - * PayPalDetails, PayPayDetails, PayToDetails, PayUUpiDetails, PayWithGoogleDetails, - * PaymentDetails, PixDetails, PixPayByBankDetails, PseDetails, RakutenPayDetails, - * RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, - * StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, UpiIntentDetails, - * UpiQrDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, - * WeChatPayMiniProgramDetails, ZipDetails) + * MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, + * PayByBankCADirectDebitDetails, PayByBankDetails, PayPalDetails, PayPayDetails, + * PayToDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, PixDetails, + * PixPayByBankDetails, PseDetails, RakutenPayDetails, RatepayDetails, RivertyDetails, + * SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, + * UpiCollectDetails, UpiIntentDetails, UpiQrDetails, VippsDetails, VisaCheckoutDetails, + * WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails) */ @Override public Object getActualInstance() { @@ -3089,6 +3133,18 @@ public PayByBankAISDirectDebitDetails getPayByBankAISDirectDebitDetails() return (PayByBankAISDirectDebitDetails) super.getActualInstance(); } + /** + * Get the actual instance of `PayByBankCADirectDebitDetails`. If the actual instance is not + * `PayByBankCADirectDebitDetails`, the ClassCastException will be thrown. + * + * @return The actual instance of `PayByBankCADirectDebitDetails` + * @throws ClassCastException if the instance is not `PayByBankCADirectDebitDetails` + */ + public PayByBankCADirectDebitDetails getPayByBankCADirectDebitDetails() + throws ClassCastException { + return (PayByBankCADirectDebitDetails) super.getActualInstance(); + } + /** * Get the actual instance of `PayByBankDetails`. If the actual instance is not * `PayByBankDetails`, the ClassCastException will be thrown. diff --git a/src/main/java/com/adyen/model/checkout/CheckoutSessionInstallmentOption.java b/src/main/java/com/adyen/model/checkout/CheckoutSessionInstallmentOption.java index 3be1577587..0fa89b849b 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutSessionInstallmentOption.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutSessionInstallmentOption.java @@ -117,14 +117,10 @@ public CheckoutSessionInstallmentOption() {} /** * Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * - * **regular** * **revolving** * **bonus** * **with_interest** * **buynow_paylater** * - * **nointerest_bonus** * **interest_bonus** * **refund_prctg** * **nointeres_refund_prctg** * - * **interes_refund_prctg** + * **regular** * **revolving** * **bonus** * * @param plans Defines the type of installment plan. If not set, defaults to **regular**. - * Possible values: * **regular** * **revolving** * **bonus** * **with_interest** * - * **buynow_paylater** * **nointerest_bonus** * **interest_bonus** * **refund_prctg** * - * **nointeres_refund_prctg** * **interes_refund_prctg** + * Possible values: * **regular** * **revolving** * **bonus** * @return the current {@code CheckoutSessionInstallmentOption} instance, allowing for method * chaining */ @@ -144,14 +140,10 @@ public CheckoutSessionInstallmentOption addPlansItem(PlansEnum plansItem) { /** * Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * - * **regular** * **revolving** * **bonus** * **with_interest** * **buynow_paylater** * - * **nointerest_bonus** * **interest_bonus** * **refund_prctg** * **nointeres_refund_prctg** * - * **interes_refund_prctg** + * **regular** * **revolving** * **bonus** * * @return plans Defines the type of installment plan. If not set, defaults to **regular**. - * Possible values: * **regular** * **revolving** * **bonus** * **with_interest** * - * **buynow_paylater** * **nointerest_bonus** * **interest_bonus** * **refund_prctg** * - * **nointeres_refund_prctg** * **interes_refund_prctg** + * Possible values: * **regular** * **revolving** * **bonus** */ @JsonProperty(JSON_PROPERTY_PLANS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -161,14 +153,10 @@ public List getPlans() { /** * Defines the type of installment plan. If not set, defaults to **regular**. Possible values: * - * **regular** * **revolving** * **bonus** * **with_interest** * **buynow_paylater** * - * **nointerest_bonus** * **interest_bonus** * **refund_prctg** * **nointeres_refund_prctg** * - * **interes_refund_prctg** + * **regular** * **revolving** * **bonus** * * @param plans Defines the type of installment plan. If not set, defaults to **regular**. - * Possible values: * **regular** * **revolving** * **bonus** * **with_interest** * - * **buynow_paylater** * **nointerest_bonus** * **interest_bonus** * **refund_prctg** * - * **nointeres_refund_prctg** * **interes_refund_prctg** + * Possible values: * **regular** * **revolving** * **bonus** */ @JsonProperty(JSON_PROPERTY_PLANS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -215,10 +203,10 @@ public void setPreselectedValue(Integer preselectedValue) { /** * An array of the number of installments that the shopper can choose from. For example, - * **[2,3,5]**. This cannot be specified simultaneously with `maxValue`. + * **[2,3,5]**. * * @param values An array of the number of installments that the shopper can choose from. For - * example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`. + * example, **[2,3,5]**. * @return the current {@code CheckoutSessionInstallmentOption} instance, allowing for method * chaining */ @@ -238,10 +226,10 @@ public CheckoutSessionInstallmentOption addValuesItem(Integer valuesItem) { /** * An array of the number of installments that the shopper can choose from. For example, - * **[2,3,5]**. This cannot be specified simultaneously with `maxValue`. + * **[2,3,5]**. * * @return values An array of the number of installments that the shopper can choose from. For - * example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`. + * example, **[2,3,5]**. */ @JsonProperty(JSON_PROPERTY_VALUES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -251,10 +239,10 @@ public List getValues() { /** * An array of the number of installments that the shopper can choose from. For example, - * **[2,3,5]**. This cannot be specified simultaneously with `maxValue`. + * **[2,3,5]**. * * @param values An array of the number of installments that the shopper can choose from. For - * example, **[2,3,5]**. This cannot be specified simultaneously with `maxValue`. + * example, **[2,3,5]**. */ @JsonProperty(JSON_PROPERTY_VALUES) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java index ef16be34ff..0c040fba1c 100644 --- a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java @@ -62,6 +62,7 @@ CreateCheckoutSessionRequest.JSON_PROPERTY_METADATA, CreateCheckoutSessionRequest.JSON_PROPERTY_MODE, CreateCheckoutSessionRequest.JSON_PROPERTY_MPI_DATA, + CreateCheckoutSessionRequest.JSON_PROPERTY_PAYABLE, CreateCheckoutSessionRequest.JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, CreateCheckoutSessionRequest.JSON_PROPERTY_RECURRING_EXPIRY, CreateCheckoutSessionRequest.JSON_PROPERTY_RECURRING_FREQUENCY, @@ -374,6 +375,12 @@ public static ModeEnum fromValue(String value) { /** Mark when the attribute has been explicitly set. */ private boolean isSetMpiData = false; + public static final String JSON_PROPERTY_PAYABLE = "payable"; + private Boolean payable; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayable = false; + public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic"; private PlatformChargebackLogic platformChargebackLogic; @@ -2166,6 +2173,68 @@ public void setMpiData(ThreeDSecureData mpiData) { isSetMpiData = true; // mark as set } + /** + * Indicates if the session is payable. If the payment amount is final, set this to **true** to + * indicate that the session is payable, so that the shopper can proceed to submit the payment. + * When you set this to **true**, you can no longer update the session. If you set this to + * **false**, you must make another request to update the session and set this to **true** before + * the shopper can submit the payment. If not specified, this defaults to **true**. + * + * @param payable Indicates if the session is payable. If the payment amount is final, set this to + * **true** to indicate that the session is payable, so that the shopper can proceed to submit + * the payment. When you set this to **true**, you can no longer update the session. If you + * set this to **false**, you must make another request to update the session and set this to + * **true** before the shopper can submit the payment. If not specified, this defaults to + * **true**. + * @return the current {@code CreateCheckoutSessionRequest} instance, allowing for method chaining + */ + public CreateCheckoutSessionRequest payable(Boolean payable) { + this.payable = payable; + isSetPayable = true; // mark as set + return this; + } + + /** + * Indicates if the session is payable. If the payment amount is final, set this to **true** to + * indicate that the session is payable, so that the shopper can proceed to submit the payment. + * When you set this to **true**, you can no longer update the session. If you set this to + * **false**, you must make another request to update the session and set this to **true** before + * the shopper can submit the payment. If not specified, this defaults to **true**. + * + * @return payable Indicates if the session is payable. If the payment amount is final, set this + * to **true** to indicate that the session is payable, so that the shopper can proceed to + * submit the payment. When you set this to **true**, you can no longer update the session. If + * you set this to **false**, you must make another request to update the session and set this + * to **true** before the shopper can submit the payment. If not specified, this defaults to + * **true**. + */ + @JsonProperty(JSON_PROPERTY_PAYABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPayable() { + return payable; + } + + /** + * Indicates if the session is payable. If the payment amount is final, set this to **true** to + * indicate that the session is payable, so that the shopper can proceed to submit the payment. + * When you set this to **true**, you can no longer update the session. If you set this to + * **false**, you must make another request to update the session and set this to **true** before + * the shopper can submit the payment. If not specified, this defaults to **true**. + * + * @param payable Indicates if the session is payable. If the payment amount is final, set this to + * **true** to indicate that the session is payable, so that the shopper can proceed to submit + * the payment. When you set this to **true**, you can no longer update the session. If you + * set this to **false**, you must make another request to update the session and set this to + * **true** before the shopper can submit the payment. If not specified, this defaults to + * **true**. + */ + @JsonProperty(JSON_PROPERTY_PAYABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPayable(Boolean payable) { + this.payable = payable; + isSetPayable = true; // mark as set + } + /** * platformChargebackLogic * @@ -3916,6 +3985,8 @@ public boolean equals(Object o) { && Objects.equals(this.isSetMode, createCheckoutSessionRequest.isSetMode) && Objects.equals(this.mpiData, createCheckoutSessionRequest.mpiData) && Objects.equals(this.isSetMpiData, createCheckoutSessionRequest.isSetMpiData) + && Objects.equals(this.payable, createCheckoutSessionRequest.payable) + && Objects.equals(this.isSetPayable, createCheckoutSessionRequest.isSetPayable) && Objects.equals( this.platformChargebackLogic, createCheckoutSessionRequest.platformChargebackLogic) && Objects.equals( @@ -4095,6 +4166,8 @@ public int hashCode() { isSetMode, mpiData, isSetMpiData, + payable, + isSetPayable, platformChargebackLogic, isSetPlatformChargebackLogic, recurringExpiry, @@ -4202,6 +4275,7 @@ public String toString() { sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); sb.append(" mpiData: ").append(toIndentedString(mpiData)).append("\n"); + sb.append(" payable: ").append(toIndentedString(payable)).append("\n"); sb.append(" platformChargebackLogic: ") .append(toIndentedString(platformChargebackLogic)) .append("\n"); @@ -4379,6 +4453,9 @@ public Map getExplicitNulls() { if (isSetMpiData) { addIfNull(nulls, JSON_PROPERTY_MPI_DATA, this.mpiData); } + if (isSetPayable) { + addIfNull(nulls, JSON_PROPERTY_PAYABLE, this.payable); + } if (isSetPlatformChargebackLogic) { addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); } diff --git a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java index f92b615525..155990d364 100644 --- a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java +++ b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java @@ -62,6 +62,7 @@ CreateCheckoutSessionResponse.JSON_PROPERTY_METADATA, CreateCheckoutSessionResponse.JSON_PROPERTY_MODE, CreateCheckoutSessionResponse.JSON_PROPERTY_MPI_DATA, + CreateCheckoutSessionResponse.JSON_PROPERTY_PAYABLE, CreateCheckoutSessionResponse.JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, CreateCheckoutSessionResponse.JSON_PROPERTY_RECURRING_EXPIRY, CreateCheckoutSessionResponse.JSON_PROPERTY_RECURRING_FREQUENCY, @@ -381,6 +382,12 @@ public static ModeEnum fromValue(String value) { /** Mark when the attribute has been explicitly set. */ private boolean isSetMpiData = false; + public static final String JSON_PROPERTY_PAYABLE = "payable"; + private Boolean payable; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayable = false; + public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic"; private PlatformChargebackLogic platformChargebackLogic; @@ -2228,6 +2235,69 @@ public void setMpiData(ThreeDSecureData mpiData) { isSetMpiData = true; // mark as set } + /** + * Indicates if the session is payable. If the payment amount is final, set this to **true** to + * indicate that the session is payable, so that the shopper can proceed to submit the payment. + * When you set this to **true**, you can no longer update the session. If you set this to + * **false**, you must make another request to update the session and set this to **true** before + * the shopper can submit the payment. If not specified, this defaults to **true**. + * + * @param payable Indicates if the session is payable. If the payment amount is final, set this to + * **true** to indicate that the session is payable, so that the shopper can proceed to submit + * the payment. When you set this to **true**, you can no longer update the session. If you + * set this to **false**, you must make another request to update the session and set this to + * **true** before the shopper can submit the payment. If not specified, this defaults to + * **true**. + * @return the current {@code CreateCheckoutSessionResponse} instance, allowing for method + * chaining + */ + public CreateCheckoutSessionResponse payable(Boolean payable) { + this.payable = payable; + isSetPayable = true; // mark as set + return this; + } + + /** + * Indicates if the session is payable. If the payment amount is final, set this to **true** to + * indicate that the session is payable, so that the shopper can proceed to submit the payment. + * When you set this to **true**, you can no longer update the session. If you set this to + * **false**, you must make another request to update the session and set this to **true** before + * the shopper can submit the payment. If not specified, this defaults to **true**. + * + * @return payable Indicates if the session is payable. If the payment amount is final, set this + * to **true** to indicate that the session is payable, so that the shopper can proceed to + * submit the payment. When you set this to **true**, you can no longer update the session. If + * you set this to **false**, you must make another request to update the session and set this + * to **true** before the shopper can submit the payment. If not specified, this defaults to + * **true**. + */ + @JsonProperty(JSON_PROPERTY_PAYABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPayable() { + return payable; + } + + /** + * Indicates if the session is payable. If the payment amount is final, set this to **true** to + * indicate that the session is payable, so that the shopper can proceed to submit the payment. + * When you set this to **true**, you can no longer update the session. If you set this to + * **false**, you must make another request to update the session and set this to **true** before + * the shopper can submit the payment. If not specified, this defaults to **true**. + * + * @param payable Indicates if the session is payable. If the payment amount is final, set this to + * **true** to indicate that the session is payable, so that the shopper can proceed to submit + * the payment. When you set this to **true**, you can no longer update the session. If you + * set this to **false**, you must make another request to update the session and set this to + * **true** before the shopper can submit the payment. If not specified, this defaults to + * **true**. + */ + @JsonProperty(JSON_PROPERTY_PAYABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPayable(Boolean payable) { + this.payable = payable; + isSetPayable = true; // mark as set + } + /** * platformChargebackLogic * @@ -4034,6 +4104,8 @@ public boolean equals(Object o) { && Objects.equals(this.isSetMode, createCheckoutSessionResponse.isSetMode) && Objects.equals(this.mpiData, createCheckoutSessionResponse.mpiData) && Objects.equals(this.isSetMpiData, createCheckoutSessionResponse.isSetMpiData) + && Objects.equals(this.payable, createCheckoutSessionResponse.payable) + && Objects.equals(this.isSetPayable, createCheckoutSessionResponse.isSetPayable) && Objects.equals( this.platformChargebackLogic, createCheckoutSessionResponse.platformChargebackLogic) && Objects.equals( @@ -4215,6 +4287,8 @@ public int hashCode() { isSetMode, mpiData, isSetMpiData, + payable, + isSetPayable, platformChargebackLogic, isSetPlatformChargebackLogic, recurringExpiry, @@ -4325,6 +4399,7 @@ public String toString() { sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); sb.append(" mpiData: ").append(toIndentedString(mpiData)).append("\n"); + sb.append(" payable: ").append(toIndentedString(payable)).append("\n"); sb.append(" platformChargebackLogic: ") .append(toIndentedString(platformChargebackLogic)) .append("\n"); @@ -4504,6 +4579,9 @@ public Map getExplicitNulls() { if (isSetMpiData) { addIfNull(nulls, JSON_PROPERTY_MPI_DATA, this.mpiData); } + if (isSetPayable) { + addIfNull(nulls, JSON_PROPERTY_PAYABLE, this.payable); + } if (isSetPlatformChargebackLogic) { addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); } diff --git a/src/main/java/com/adyen/model/checkout/KlarnaNetworkDetails.java b/src/main/java/com/adyen/model/checkout/KlarnaNetworkDetails.java index ae88bf1344..dcc60631d7 100644 --- a/src/main/java/com/adyen/model/checkout/KlarnaNetworkDetails.java +++ b/src/main/java/com/adyen/model/checkout/KlarnaNetworkDetails.java @@ -27,6 +27,7 @@ @JsonPropertyOrder({ KlarnaNetworkDetails.JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, KlarnaNetworkDetails.JSON_PROPERTY_KLARNA_NETWORK_DATA, + KlarnaNetworkDetails.JSON_PROPERTY_KLARNA_NETWORK_PAYMENT_ACCOUNT_ID, KlarnaNetworkDetails.JSON_PROPERTY_KLARNA_NETWORK_SESSION_TOKEN, KlarnaNetworkDetails.JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, KlarnaNetworkDetails.JSON_PROPERTY_SDK_DATA, @@ -46,6 +47,13 @@ public class KlarnaNetworkDetails { /** Mark when the attribute has been explicitly set. */ private boolean isSetKlarnaNetworkData = false; + public static final String JSON_PROPERTY_KLARNA_NETWORK_PAYMENT_ACCOUNT_ID = + "klarnaNetworkPaymentAccountId"; + private String klarnaNetworkPaymentAccountId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetKlarnaNetworkPaymentAccountId = false; + public static final String JSON_PROPERTY_KLARNA_NETWORK_SESSION_TOKEN = "klarnaNetworkSessionToken"; private String klarnaNetworkSessionToken; @@ -201,6 +209,47 @@ public void setKlarnaNetworkData(String klarnaNetworkData) { isSetKlarnaNetworkData = true; // mark as set } + /** + * The Klarna Network Payment Account identifier to use for the transaction. Required when + * `klarnaNetworkSessionToken` is provided. + * + * @param klarnaNetworkPaymentAccountId The Klarna Network Payment Account identifier to use for + * the transaction. Required when `klarnaNetworkSessionToken` is provided. + * @return the current {@code KlarnaNetworkDetails} instance, allowing for method chaining + */ + public KlarnaNetworkDetails klarnaNetworkPaymentAccountId(String klarnaNetworkPaymentAccountId) { + this.klarnaNetworkPaymentAccountId = klarnaNetworkPaymentAccountId; + isSetKlarnaNetworkPaymentAccountId = true; // mark as set + return this; + } + + /** + * The Klarna Network Payment Account identifier to use for the transaction. Required when + * `klarnaNetworkSessionToken` is provided. + * + * @return klarnaNetworkPaymentAccountId The Klarna Network Payment Account identifier to use for + * the transaction. Required when `klarnaNetworkSessionToken` is provided. + */ + @JsonProperty(JSON_PROPERTY_KLARNA_NETWORK_PAYMENT_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKlarnaNetworkPaymentAccountId() { + return klarnaNetworkPaymentAccountId; + } + + /** + * The Klarna Network Payment Account identifier to use for the transaction. Required when + * `klarnaNetworkSessionToken` is provided. + * + * @param klarnaNetworkPaymentAccountId The Klarna Network Payment Account identifier to use for + * the transaction. Required when `klarnaNetworkSessionToken` is provided. + */ + @JsonProperty(JSON_PROPERTY_KLARNA_NETWORK_PAYMENT_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKlarnaNetworkPaymentAccountId(String klarnaNetworkPaymentAccountId) { + this.klarnaNetworkPaymentAccountId = klarnaNetworkPaymentAccountId; + isSetKlarnaNetworkPaymentAccountId = true; // mark as set + } + /** * The token obtained from the Klarna SDK during an Express Checkout flow. * @@ -432,6 +481,11 @@ public boolean equals(Object o) { && Objects.equals(this.isSetCheckoutAttemptId, klarnaNetworkDetails.isSetCheckoutAttemptId) && Objects.equals(this.klarnaNetworkData, klarnaNetworkDetails.klarnaNetworkData) && Objects.equals(this.isSetKlarnaNetworkData, klarnaNetworkDetails.isSetKlarnaNetworkData) + && Objects.equals( + this.klarnaNetworkPaymentAccountId, klarnaNetworkDetails.klarnaNetworkPaymentAccountId) + && Objects.equals( + this.isSetKlarnaNetworkPaymentAccountId, + klarnaNetworkDetails.isSetKlarnaNetworkPaymentAccountId) && Objects.equals( this.klarnaNetworkSessionToken, klarnaNetworkDetails.klarnaNetworkSessionToken) && Objects.equals( @@ -457,6 +511,8 @@ public int hashCode() { isSetCheckoutAttemptId, klarnaNetworkData, isSetKlarnaNetworkData, + klarnaNetworkPaymentAccountId, + isSetKlarnaNetworkPaymentAccountId, klarnaNetworkSessionToken, isSetKlarnaNetworkSessionToken, recurringDetailReference, @@ -475,6 +531,9 @@ public String toString() { sb.append("class KlarnaNetworkDetails {\n"); sb.append(" checkoutAttemptId: ").append(toIndentedString(checkoutAttemptId)).append("\n"); sb.append(" klarnaNetworkData: ").append(toIndentedString(klarnaNetworkData)).append("\n"); + sb.append(" klarnaNetworkPaymentAccountId: ") + .append(toIndentedString(klarnaNetworkPaymentAccountId)) + .append("\n"); sb.append(" klarnaNetworkSessionToken: ") .append(toIndentedString(klarnaNetworkSessionToken)) .append("\n"); @@ -516,6 +575,12 @@ public Map getExplicitNulls() { if (isSetKlarnaNetworkData) { addIfNull(nulls, JSON_PROPERTY_KLARNA_NETWORK_DATA, this.klarnaNetworkData); } + if (isSetKlarnaNetworkPaymentAccountId) { + addIfNull( + nulls, + JSON_PROPERTY_KLARNA_NETWORK_PAYMENT_ACCOUNT_ID, + this.klarnaNetworkPaymentAccountId); + } if (isSetKlarnaNetworkSessionToken) { addIfNull(nulls, JSON_PROPERTY_KLARNA_NETWORK_SESSION_TOKEN, this.klarnaNetworkSessionToken); } diff --git a/src/main/java/com/adyen/model/checkout/LineItem.java b/src/main/java/com/adyen/model/checkout/LineItem.java index f9ba85b3a5..dae6412151 100644 --- a/src/main/java/com/adyen/model/checkout/LineItem.java +++ b/src/main/java/com/adyen/model/checkout/LineItem.java @@ -37,6 +37,7 @@ LineItem.JSON_PROPERTY_RETURN_SHIPPING_COMPANY, LineItem.JSON_PROPERTY_RETURN_TRACKING_NUMBER, LineItem.JSON_PROPERTY_RETURN_TRACKING_URI, + LineItem.JSON_PROPERTY_RISK_CATEGORY, LineItem.JSON_PROPERTY_SHIPPING_COMPANY, LineItem.JSON_PROPERTY_SHIPPING_METHOD, LineItem.JSON_PROPERTY_SIZE, @@ -144,6 +145,12 @@ public class LineItem { /** Mark when the attribute has been explicitly set. */ private boolean isSetReturnTrackingUri = false; + public static final String JSON_PROPERTY_RISK_CATEGORY = "riskCategory"; + private String riskCategory; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskCategory = false; + public static final String JSON_PROPERTY_SHIPPING_COMPANY = "shippingCompany"; private String shippingCompany; @@ -781,6 +788,47 @@ public void setReturnTrackingUri(String returnTrackingUri) { isSetReturnTrackingUri = true; // mark as set } + /** + * An optional, free-text category for the item to be used in the risk evaluation. When provided, + * Protect uses this value to evaluate custom risk rules. + * + * @param riskCategory An optional, free-text category for the item to be used in the risk + * evaluation. When provided, Protect uses this value to evaluate custom risk rules. + * @return the current {@code LineItem} instance, allowing for method chaining + */ + public LineItem riskCategory(String riskCategory) { + this.riskCategory = riskCategory; + isSetRiskCategory = true; // mark as set + return this; + } + + /** + * An optional, free-text category for the item to be used in the risk evaluation. When provided, + * Protect uses this value to evaluate custom risk rules. + * + * @return riskCategory An optional, free-text category for the item to be used in the risk + * evaluation. When provided, Protect uses this value to evaluate custom risk rules. + */ + @JsonProperty(JSON_PROPERTY_RISK_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRiskCategory() { + return riskCategory; + } + + /** + * An optional, free-text category for the item to be used in the risk evaluation. When provided, + * Protect uses this value to evaluate custom risk rules. + * + * @param riskCategory An optional, free-text category for the item to be used in the risk + * evaluation. When provided, Protect uses this value to evaluate custom risk rules. + */ + @JsonProperty(JSON_PROPERTY_RISK_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRiskCategory(String riskCategory) { + this.riskCategory = riskCategory; + isSetRiskCategory = true; // mark as set + } + /** * Shipping company handling the delivery of the item. * @@ -1176,6 +1224,8 @@ public boolean equals(Object o) { && Objects.equals(this.isSetReturnTrackingNumber, lineItem.isSetReturnTrackingNumber) && Objects.equals(this.returnTrackingUri, lineItem.returnTrackingUri) && Objects.equals(this.isSetReturnTrackingUri, lineItem.isSetReturnTrackingUri) + && Objects.equals(this.riskCategory, lineItem.riskCategory) + && Objects.equals(this.isSetRiskCategory, lineItem.isSetRiskCategory) && Objects.equals(this.shippingCompany, lineItem.shippingCompany) && Objects.equals(this.isSetShippingCompany, lineItem.isSetShippingCompany) && Objects.equals(this.shippingMethod, lineItem.shippingMethod) @@ -1231,6 +1281,8 @@ public int hashCode() { isSetReturnTrackingNumber, returnTrackingUri, isSetReturnTrackingUri, + riskCategory, + isSetRiskCategory, shippingCompany, isSetShippingCompany, shippingMethod, @@ -1277,6 +1329,7 @@ public String toString() { .append(toIndentedString(returnTrackingNumber)) .append("\n"); sb.append(" returnTrackingUri: ").append(toIndentedString(returnTrackingUri)).append("\n"); + sb.append(" riskCategory: ").append(toIndentedString(riskCategory)).append("\n"); sb.append(" shippingCompany: ").append(toIndentedString(shippingCompany)).append("\n"); sb.append(" shippingMethod: ").append(toIndentedString(shippingMethod)).append("\n"); sb.append(" size: ").append(toIndentedString(size)).append("\n"); @@ -1358,6 +1411,9 @@ public Map getExplicitNulls() { if (isSetReturnTrackingUri) { addIfNull(nulls, JSON_PROPERTY_RETURN_TRACKING_URI, this.returnTrackingUri); } + if (isSetRiskCategory) { + addIfNull(nulls, JSON_PROPERTY_RISK_CATEGORY, this.riskCategory); + } if (isSetShippingCompany) { addIfNull(nulls, JSON_PROPERTY_SHIPPING_COMPANY, this.shippingCompany); } diff --git a/src/main/java/com/adyen/model/checkout/OpiRequest.java b/src/main/java/com/adyen/model/checkout/OpiRequest.java new file mode 100644 index 0000000000..a7405867ed --- /dev/null +++ b/src/main/java/com/adyen/model/checkout/OpiRequest.java @@ -0,0 +1,232 @@ +/* + * 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** OpiRequest */ +@JsonPropertyOrder({ + OpiRequest.JSON_PROPERTY_INCLUDE_ISSUER_ID, + OpiRequest.JSON_PROPERTY_INCLUDE_TRANS_TOKEN +}) +public class OpiRequest { + public static final String JSON_PROPERTY_INCLUDE_ISSUER_ID = "includeIssuerId"; + private Boolean includeIssuerId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIncludeIssuerId = false; + + public static final String JSON_PROPERTY_INCLUDE_TRANS_TOKEN = "includeTransToken"; + private Boolean includeTransToken; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIncludeTransToken = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public OpiRequest() {} + + /** + * When set to true, includes the OPI issuer ID in the response. + * + * @param includeIssuerId When set to true, includes the OPI issuer ID in the response. + * @return the current {@code OpiRequest} instance, allowing for method chaining + */ + public OpiRequest includeIssuerId(Boolean includeIssuerId) { + this.includeIssuerId = includeIssuerId; + isSetIncludeIssuerId = true; // mark as set + return this; + } + + /** + * When set to true, includes the OPI issuer ID in the response. + * + * @return includeIssuerId When set to true, includes the OPI issuer ID in the response. + */ + @JsonProperty(JSON_PROPERTY_INCLUDE_ISSUER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeIssuerId() { + return includeIssuerId; + } + + /** + * When set to true, includes the OPI issuer ID in the response. + * + * @param includeIssuerId When set to true, includes the OPI issuer ID in the response. + */ + @JsonProperty(JSON_PROPERTY_INCLUDE_ISSUER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeIssuerId(Boolean includeIssuerId) { + this.includeIssuerId = includeIssuerId; + isSetIncludeIssuerId = true; // mark as set + } + + /** + * When set to true, includes an OPI transaction token in the response when the payment creates a + * stored payment method. + * + * @param includeTransToken When set to true, includes an OPI transaction token in the response + * when the payment creates a stored payment method. + * @return the current {@code OpiRequest} instance, allowing for method chaining + */ + public OpiRequest includeTransToken(Boolean includeTransToken) { + this.includeTransToken = includeTransToken; + isSetIncludeTransToken = true; // mark as set + return this; + } + + /** + * When set to true, includes an OPI transaction token in the response when the payment creates a + * stored payment method. + * + * @return includeTransToken When set to true, includes an OPI transaction token in the response + * when the payment creates a stored payment method. + */ + @JsonProperty(JSON_PROPERTY_INCLUDE_TRANS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeTransToken() { + return includeTransToken; + } + + /** + * When set to true, includes an OPI transaction token in the response when the payment creates a + * stored payment method. + * + * @param includeTransToken When set to true, includes an OPI transaction token in the response + * when the payment creates a stored payment method. + */ + @JsonProperty(JSON_PROPERTY_INCLUDE_TRANS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeTransToken(Boolean includeTransToken) { + this.includeTransToken = includeTransToken; + isSetIncludeTransToken = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public OpiRequest 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 OpiRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OpiRequest opiRequest = (OpiRequest) o; + return Objects.equals(this.includeIssuerId, opiRequest.includeIssuerId) + && Objects.equals(this.isSetIncludeIssuerId, opiRequest.isSetIncludeIssuerId) + && Objects.equals(this.includeTransToken, opiRequest.includeTransToken) + && Objects.equals(this.isSetIncludeTransToken, opiRequest.isSetIncludeTransToken); + } + + @Override + public int hashCode() { + return Objects.hash( + includeIssuerId, isSetIncludeIssuerId, includeTransToken, isSetIncludeTransToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OpiRequest {\n"); + sb.append(" includeIssuerId: ").append(toIndentedString(includeIssuerId)).append("\n"); + sb.append(" includeTransToken: ").append(toIndentedString(includeTransToken)).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 (isSetIncludeIssuerId) { + addIfNull(nulls, JSON_PROPERTY_INCLUDE_ISSUER_ID, this.includeIssuerId); + } + if (isSetIncludeTransToken) { + addIfNull(nulls, JSON_PROPERTY_INCLUDE_TRANS_TOKEN, this.includeTransToken); + } + + 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 OpiRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of OpiRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to OpiRequest + */ + public static OpiRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, OpiRequest.class); + } + + /** + * Convert an instance of OpiRequest 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/OpiResponse.java b/src/main/java/com/adyen/model/checkout/OpiResponse.java new file mode 100644 index 0000000000..4c66b92fca --- /dev/null +++ b/src/main/java/com/adyen/model/checkout/OpiResponse.java @@ -0,0 +1,222 @@ +/* + * 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.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** OpiResponse */ +@JsonPropertyOrder({OpiResponse.JSON_PROPERTY_ISSUER_ID, OpiResponse.JSON_PROPERTY_TRANS_TOKEN}) +public class OpiResponse { + public static final String JSON_PROPERTY_ISSUER_ID = "issuerId"; + private String issuerId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuerId = false; + + public static final String JSON_PROPERTY_TRANS_TOKEN = "transToken"; + private String transToken; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransToken = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public OpiResponse() {} + + /** + * The OPI issuer id. + * + * @param issuerId The OPI issuer id. + * @return the current {@code OpiResponse} instance, allowing for method chaining + */ + public OpiResponse issuerId(String issuerId) { + this.issuerId = issuerId; + isSetIssuerId = true; // mark as set + return this; + } + + /** + * The OPI issuer id. + * + * @return issuerId The OPI issuer id. + */ + @JsonProperty(JSON_PROPERTY_ISSUER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIssuerId() { + return issuerId; + } + + /** + * The OPI issuer id. + * + * @param issuerId The OPI issuer id. + */ + @JsonProperty(JSON_PROPERTY_ISSUER_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIssuerId(String issuerId) { + this.issuerId = issuerId; + isSetIssuerId = true; // mark as set + } + + /** + * The OPI transaction token. + * + * @param transToken The OPI transaction token. + * @return the current {@code OpiResponse} instance, allowing for method chaining + */ + public OpiResponse transToken(String transToken) { + this.transToken = transToken; + isSetTransToken = true; // mark as set + return this; + } + + /** + * The OPI transaction token. + * + * @return transToken The OPI transaction token. + */ + @JsonProperty(JSON_PROPERTY_TRANS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTransToken() { + return transToken; + } + + /** + * The OPI transaction token. + * + * @param transToken The OPI transaction token. + */ + @JsonProperty(JSON_PROPERTY_TRANS_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTransToken(String transToken) { + this.transToken = transToken; + isSetTransToken = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public OpiResponse 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 OpiResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OpiResponse opiResponse = (OpiResponse) o; + return Objects.equals(this.issuerId, opiResponse.issuerId) + && Objects.equals(this.isSetIssuerId, opiResponse.isSetIssuerId) + && Objects.equals(this.transToken, opiResponse.transToken) + && Objects.equals(this.isSetTransToken, opiResponse.isSetTransToken); + } + + @Override + public int hashCode() { + return Objects.hash(issuerId, isSetIssuerId, transToken, isSetTransToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OpiResponse {\n"); + sb.append(" issuerId: ").append(toIndentedString(issuerId)).append("\n"); + sb.append(" transToken: ").append(toIndentedString(transToken)).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 (isSetIssuerId) { + addIfNull(nulls, JSON_PROPERTY_ISSUER_ID, this.issuerId); + } + if (isSetTransToken) { + addIfNull(nulls, JSON_PROPERTY_TRANS_TOKEN, this.transToken); + } + + 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 OpiResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OpiResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to OpiResponse + */ + public static OpiResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, OpiResponse.class); + } + + /** + * Convert an instance of OpiResponse 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/PayByBankCADirectDebitDetails.java b/src/main/java/com/adyen/model/checkout/PayByBankCADirectDebitDetails.java new file mode 100644 index 0000000000..1b62d0d8c3 --- /dev/null +++ b/src/main/java/com/adyen/model/checkout/PayByBankCADirectDebitDetails.java @@ -0,0 +1,460 @@ +/* + * 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; + +/** PayByBankCADirectDebitDetails */ +@JsonPropertyOrder({ + PayByBankCADirectDebitDetails.JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, + PayByBankCADirectDebitDetails.JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, + PayByBankCADirectDebitDetails.JSON_PROPERTY_SDK_DATA, + PayByBankCADirectDebitDetails.JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, + PayByBankCADirectDebitDetails.JSON_PROPERTY_TYPE +}) +public class PayByBankCADirectDebitDetails { + 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; + + /** The type of payment method */ + public enum TypeEnum { + PAYBYBANK_CA(String.valueOf("paybybank_ca")); + + 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 PayByBankCADirectDebitDetails() {} + + /** + * The checkout attempt identifier. + * + * @param checkoutAttemptId The checkout attempt identifier. + * @return the current {@code PayByBankCADirectDebitDetails} instance, allowing for method + * chaining + */ + public PayByBankCADirectDebitDetails 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 PayByBankCADirectDebitDetails} instance, allowing for method + * chaining + * @deprecated since Adyen Checkout API v49 Use `storedPaymentMethodId` instead. + */ + @Deprecated + public PayByBankCADirectDebitDetails 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 PayByBankCADirectDebitDetails} instance, allowing for method + * chaining + */ + public PayByBankCADirectDebitDetails 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 PayByBankCADirectDebitDetails} instance, allowing for method + * chaining + */ + public PayByBankCADirectDebitDetails 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 + } + + /** + * The type of payment method + * + * @param type The type of payment method + * @return the current {@code PayByBankCADirectDebitDetails} instance, allowing for method + * chaining + */ + public PayByBankCADirectDebitDetails type(TypeEnum type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * The type of payment method + * + * @return type The type of payment method + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TypeEnum getType() { + return type; + } + + /** + * The type of payment method + * + * @param type The type of payment method + */ + @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 PayByBankCADirectDebitDetails 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 PayByBankCADirectDebitDetails object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PayByBankCADirectDebitDetails payByBankCADirectDebitDetails = (PayByBankCADirectDebitDetails) o; + return Objects.equals(this.checkoutAttemptId, payByBankCADirectDebitDetails.checkoutAttemptId) + && Objects.equals( + this.isSetCheckoutAttemptId, payByBankCADirectDebitDetails.isSetCheckoutAttemptId) + && Objects.equals( + this.recurringDetailReference, payByBankCADirectDebitDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, + payByBankCADirectDebitDetails.isSetRecurringDetailReference) + && Objects.equals(this.sdkData, payByBankCADirectDebitDetails.sdkData) + && Objects.equals(this.isSetSdkData, payByBankCADirectDebitDetails.isSetSdkData) + && Objects.equals( + this.storedPaymentMethodId, payByBankCADirectDebitDetails.storedPaymentMethodId) + && Objects.equals( + this.isSetStoredPaymentMethodId, + payByBankCADirectDebitDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, payByBankCADirectDebitDetails.type) + && Objects.equals(this.isSetType, payByBankCADirectDebitDetails.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 PayByBankCADirectDebitDetails {\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 PayByBankCADirectDebitDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of PayByBankCADirectDebitDetails + * @throws JsonProcessingException if the JSON string is invalid with respect to + * PayByBankCADirectDebitDetails + */ + public static PayByBankCADirectDebitDetails fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PayByBankCADirectDebitDetails.class); + } + + /** + * Convert an instance of PayByBankCADirectDebitDetails 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/PaymentDetails.java b/src/main/java/com/adyen/model/checkout/PaymentDetails.java index 232115ab2d..d7424799af 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentDetails.java +++ b/src/main/java/com/adyen/model/checkout/PaymentDetails.java @@ -118,6 +118,8 @@ public enum TypeEnum { PAYPO(String.valueOf("paypo")), + SATISPAY(String.valueOf("satispay")), + SCALAPAY(String.valueOf("scalapay")), SCALAPAY_3X(String.valueOf("scalapay_3x")), diff --git a/src/main/java/com/adyen/model/checkout/PaymentDetailsResponse.java b/src/main/java/com/adyen/model/checkout/PaymentDetailsResponse.java index 4e9de5bb64..e830d1f92a 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentDetailsResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentDetailsResponse.java @@ -33,6 +33,7 @@ PaymentDetailsResponse.JSON_PROPERTY_DONATION_TOKEN, PaymentDetailsResponse.JSON_PROPERTY_FRAUD_RESULT, PaymentDetailsResponse.JSON_PROPERTY_MERCHANT_REFERENCE, + PaymentDetailsResponse.JSON_PROPERTY_OPI, PaymentDetailsResponse.JSON_PROPERTY_ORDER, PaymentDetailsResponse.JSON_PROPERTY_PAYMENT_METHOD, PaymentDetailsResponse.JSON_PROPERTY_PAYMENT_VALIDATIONS, @@ -82,6 +83,12 @@ public class PaymentDetailsResponse { /** Mark when the attribute has been explicitly set. */ private boolean isSetMerchantReference = false; + public static final String JSON_PROPERTY_OPI = "opi"; + private OpiResponse opi; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpi = false; + public static final String JSON_PROPERTY_ORDER = "order"; private CheckoutOrderResponse order; @@ -476,6 +483,41 @@ public void setMerchantReference(String merchantReference) { isSetMerchantReference = true; // mark as set } + /** + * opi + * + * @param opi + * @return the current {@code PaymentDetailsResponse} instance, allowing for method chaining + */ + public PaymentDetailsResponse opi(OpiResponse opi) { + this.opi = opi; + isSetOpi = true; // mark as set + return this; + } + + /** + * Get opi + * + * @return opi + */ + @JsonProperty(JSON_PROPERTY_OPI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OpiResponse getOpi() { + return opi; + } + + /** + * opi + * + * @param opi + */ + @JsonProperty(JSON_PROPERTY_OPI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOpi(OpiResponse opi) { + this.opi = opi; + isSetOpi = true; // mark as set + } + /** * order * @@ -1111,6 +1153,8 @@ public boolean equals(Object o) { && Objects.equals(this.merchantReference, paymentDetailsResponse.merchantReference) && Objects.equals( this.isSetMerchantReference, paymentDetailsResponse.isSetMerchantReference) + && Objects.equals(this.opi, paymentDetailsResponse.opi) + && Objects.equals(this.isSetOpi, paymentDetailsResponse.isSetOpi) && Objects.equals(this.order, paymentDetailsResponse.order) && Objects.equals(this.isSetOrder, paymentDetailsResponse.isSetOrder) && Objects.equals(this.paymentMethod, paymentDetailsResponse.paymentMethod) @@ -1154,6 +1198,8 @@ public int hashCode() { isSetFraudResult, merchantReference, isSetMerchantReference, + opi, + isSetOpi, order, isSetOrder, paymentMethod, @@ -1188,6 +1234,7 @@ public String toString() { sb.append(" donationToken: ").append(toIndentedString(donationToken)).append("\n"); sb.append(" fraudResult: ").append(toIndentedString(fraudResult)).append("\n"); sb.append(" merchantReference: ").append(toIndentedString(merchantReference)).append("\n"); + sb.append(" opi: ").append(toIndentedString(opi)).append("\n"); sb.append(" order: ").append(toIndentedString(order)).append("\n"); sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); sb.append(" paymentValidations: ").append(toIndentedString(paymentValidations)).append("\n"); @@ -1243,6 +1290,9 @@ public Map getExplicitNulls() { if (isSetMerchantReference) { addIfNull(nulls, JSON_PROPERTY_MERCHANT_REFERENCE, this.merchantReference); } + if (isSetOpi) { + addIfNull(nulls, JSON_PROPERTY_OPI, this.opi); + } if (isSetOrder) { addIfNull(nulls, JSON_PROPERTY_ORDER, this.order); } diff --git a/src/main/java/com/adyen/model/checkout/PaymentRequest.java b/src/main/java/com/adyen/model/checkout/PaymentRequest.java index 0d59de3a5c..82b1b71352 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentRequest.java @@ -69,6 +69,7 @@ PaymentRequest.JSON_PROPERTY_MERCHANT_RISK_INDICATOR, PaymentRequest.JSON_PROPERTY_METADATA, PaymentRequest.JSON_PROPERTY_MPI_DATA, + PaymentRequest.JSON_PROPERTY_OPI, PaymentRequest.JSON_PROPERTY_ORDER, PaymentRequest.JSON_PROPERTY_ORDER_REFERENCE, PaymentRequest.JSON_PROPERTY_ORIGIN, @@ -477,6 +478,12 @@ public static IndustryUsageEnum fromValue(String value) { /** Mark when the attribute has been explicitly set. */ private boolean isSetMpiData = false; + public static final String JSON_PROPERTY_OPI = "opi"; + private OpiRequest opi; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpi = false; + public static final String JSON_PROPERTY_ORDER = "order"; private EncryptedOrderData order; @@ -2265,7 +2272,7 @@ public void setMerchantAccount(String merchantAccount) { /** * You can use this reference to link multiple transactions to one another (for example, to track - * order authorization rate).For each billing cycle, this reference should be unique. After the + * order authorization rate). For each billing cycle, this reference should be unique. After the * first authorized payment attempt, do not reuse the reference. If you use this parameter, * include it in all of the payment requests that you make. We strongly recommend that you: * * Always include this parameter, so that you can benefit from linking payment requests to one @@ -2277,7 +2284,7 @@ public void setMerchantAccount(String merchantAccount) { * [`retry.skipRetry`](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-additionalData-AdditionalDataRetry-retry-skipRetry) * * @param merchantOrderReference You can use this reference to link multiple transactions to one - * another (for example, to track order authorization rate).For each billing cycle, this + * another (for example, to track order authorization rate). For each billing cycle, this * reference should be unique. After the first authorized payment attempt, do not reuse the * reference. If you use this parameter, include it in all of the payment requests that you * make. We strongly recommend that you: * Always include this parameter, so that you can @@ -2297,7 +2304,7 @@ public PaymentRequest merchantOrderReference(String merchantOrderReference) { /** * You can use this reference to link multiple transactions to one another (for example, to track - * order authorization rate).For each billing cycle, this reference should be unique. After the + * order authorization rate). For each billing cycle, this reference should be unique. After the * first authorized payment attempt, do not reuse the reference. If you use this parameter, * include it in all of the payment requests that you make. We strongly recommend that you: * * Always include this parameter, so that you can benefit from linking payment requests to one @@ -2309,7 +2316,7 @@ public PaymentRequest merchantOrderReference(String merchantOrderReference) { * [`retry.skipRetry`](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-additionalData-AdditionalDataRetry-retry-skipRetry) * * @return merchantOrderReference You can use this reference to link multiple transactions to one - * another (for example, to track order authorization rate).For each billing cycle, this + * another (for example, to track order authorization rate). For each billing cycle, this * reference should be unique. After the first authorized payment attempt, do not reuse the * reference. If you use this parameter, include it in all of the payment requests that you * make. We strongly recommend that you: * Always include this parameter, so that you can @@ -2328,7 +2335,7 @@ public String getMerchantOrderReference() { /** * You can use this reference to link multiple transactions to one another (for example, to track - * order authorization rate).For each billing cycle, this reference should be unique. After the + * order authorization rate). For each billing cycle, this reference should be unique. After the * first authorized payment attempt, do not reuse the reference. If you use this parameter, * include it in all of the payment requests that you make. We strongly recommend that you: * * Always include this parameter, so that you can benefit from linking payment requests to one @@ -2340,7 +2347,7 @@ public String getMerchantOrderReference() { * [`retry.skipRetry`](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions#request-additionalData-AdditionalDataRetry-retry-skipRetry) * * @param merchantOrderReference You can use this reference to link multiple transactions to one - * another (for example, to track order authorization rate).For each billing cycle, this + * another (for example, to track order authorization rate). For each billing cycle, this * reference should be unique. After the first authorized payment attempt, do not reuse the * reference. If you use this parameter, include it in all of the payment requests that you * make. We strongly recommend that you: * Always include this parameter, so that you can @@ -2489,6 +2496,41 @@ public void setMpiData(ThreeDSecureData mpiData) { isSetMpiData = true; // mark as set } + /** + * opi + * + * @param opi + * @return the current {@code PaymentRequest} instance, allowing for method chaining + */ + public PaymentRequest opi(OpiRequest opi) { + this.opi = opi; + isSetOpi = true; // mark as set + return this; + } + + /** + * Get opi + * + * @return opi + */ + @JsonProperty(JSON_PROPERTY_OPI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OpiRequest getOpi() { + return opi; + } + + /** + * opi + * + * @param opi + */ + @JsonProperty(JSON_PROPERTY_OPI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOpi(OpiRequest opi) { + this.opi = opi; + isSetOpi = true; // mark as set + } + /** * order * @@ -2965,12 +3007,12 @@ public void setRedirectToIssuerMethod(String redirectToIssuerMethod) { /** * The reference to uniquely identify a payment. This reference is used in all communication with * you about the payment status. To provide multiple references for one transaction, separate the - * reference values with the hyphen (`-`) character.We strongly recommend that you use a - * unique value for each transaction. Maximum length: 80 characters. + * reference values with the hyphen (`-`) character. We strongly recommend that you use + * a unique value for each transaction. Maximum length: 80 characters. * * @param reference The reference to uniquely identify a payment. This reference is used in all * communication with you about the payment status. To provide multiple references for one - * transaction, separate the reference values with the hyphen (`-`) character.We + * transaction, separate the reference values with the hyphen (`-`) character. We * strongly recommend that you use a unique value for each transaction. Maximum length: 80 * characters. * @return the current {@code PaymentRequest} instance, allowing for method chaining @@ -2984,12 +3026,12 @@ public PaymentRequest reference(String reference) { /** * The reference to uniquely identify a payment. This reference is used in all communication with * you about the payment status. To provide multiple references for one transaction, separate the - * reference values with the hyphen (`-`) character.We strongly recommend that you use a - * unique value for each transaction. Maximum length: 80 characters. + * reference values with the hyphen (`-`) character. We strongly recommend that you use + * a unique value for each transaction. Maximum length: 80 characters. * * @return reference The reference to uniquely identify a payment. This reference is used in all * communication with you about the payment status. To provide multiple references for one - * transaction, separate the reference values with the hyphen (`-`) character.We + * transaction, separate the reference values with the hyphen (`-`) character. We * strongly recommend that you use a unique value for each transaction. Maximum length: 80 * characters. */ @@ -3002,12 +3044,12 @@ public String getReference() { /** * The reference to uniquely identify a payment. This reference is used in all communication with * you about the payment status. To provide multiple references for one transaction, separate the - * reference values with the hyphen (`-`) character.We strongly recommend that you use a - * unique value for each transaction. Maximum length: 80 characters. + * reference values with the hyphen (`-`) character. We strongly recommend that you use + * a unique value for each transaction. Maximum length: 80 characters. * * @param reference The reference to uniquely identify a payment. This reference is used in all * communication with you about the payment status. To provide multiple references for one - * transaction, separate the reference values with the hyphen (`-`) character.We + * transaction, separate the reference values with the hyphen (`-`) character. We * strongly recommend that you use a unique value for each transaction. Maximum length: 80 * characters. */ @@ -4354,6 +4396,8 @@ public boolean equals(Object o) { && Objects.equals(this.isSetMetadata, paymentRequest.isSetMetadata) && Objects.equals(this.mpiData, paymentRequest.mpiData) && Objects.equals(this.isSetMpiData, paymentRequest.isSetMpiData) + && Objects.equals(this.opi, paymentRequest.opi) + && Objects.equals(this.isSetOpi, paymentRequest.isSetOpi) && Objects.equals(this.order, paymentRequest.order) && Objects.equals(this.isSetOrder, paymentRequest.isSetOrder) && Objects.equals(this.orderReference, paymentRequest.orderReference) @@ -4515,6 +4559,8 @@ public int hashCode() { isSetMetadata, mpiData, isSetMpiData, + opi, + isSetOpi, order, isSetOrder, orderReference, @@ -4636,6 +4682,7 @@ public String toString() { .append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); sb.append(" mpiData: ").append(toIndentedString(mpiData)).append("\n"); + sb.append(" opi: ").append(toIndentedString(opi)).append("\n"); sb.append(" order: ").append(toIndentedString(order)).append("\n"); sb.append(" orderReference: ").append(toIndentedString(orderReference)).append("\n"); sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); @@ -4830,6 +4877,9 @@ public Map getExplicitNulls() { if (isSetMpiData) { addIfNull(nulls, JSON_PROPERTY_MPI_DATA, this.mpiData); } + if (isSetOpi) { + addIfNull(nulls, JSON_PROPERTY_OPI, this.opi); + } if (isSetOrder) { addIfNull(nulls, JSON_PROPERTY_ORDER, this.order); } diff --git a/src/main/java/com/adyen/model/checkout/PaymentResponse.java b/src/main/java/com/adyen/model/checkout/PaymentResponse.java index a8a00ed150..525013189d 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentResponse.java @@ -33,6 +33,7 @@ PaymentResponse.JSON_PROPERTY_DONATION_TOKEN, PaymentResponse.JSON_PROPERTY_FRAUD_RESULT, PaymentResponse.JSON_PROPERTY_MERCHANT_REFERENCE, + PaymentResponse.JSON_PROPERTY_OPI, PaymentResponse.JSON_PROPERTY_ORDER, PaymentResponse.JSON_PROPERTY_PAYMENT_METHOD, PaymentResponse.JSON_PROPERTY_PAYMENT_VALIDATIONS, @@ -81,6 +82,12 @@ public class PaymentResponse { /** Mark when the attribute has been explicitly set. */ private boolean isSetMerchantReference = false; + public static final String JSON_PROPERTY_OPI = "opi"; + private OpiResponse opi; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpi = false; + public static final String JSON_PROPERTY_ORDER = "order"; private CheckoutOrderResponse order; @@ -490,6 +497,41 @@ public void setMerchantReference(String merchantReference) { isSetMerchantReference = true; // mark as set } + /** + * opi + * + * @param opi + * @return the current {@code PaymentResponse} instance, allowing for method chaining + */ + public PaymentResponse opi(OpiResponse opi) { + this.opi = opi; + isSetOpi = true; // mark as set + return this; + } + + /** + * Get opi + * + * @return opi + */ + @JsonProperty(JSON_PROPERTY_OPI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OpiResponse getOpi() { + return opi; + } + + /** + * opi + * + * @param opi + */ + @JsonProperty(JSON_PROPERTY_OPI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOpi(OpiResponse opi) { + this.opi = opi; + isSetOpi = true; // mark as set + } + /** * order * @@ -1098,6 +1140,8 @@ public boolean equals(Object o) { && Objects.equals(this.isSetFraudResult, paymentResponse.isSetFraudResult) && Objects.equals(this.merchantReference, paymentResponse.merchantReference) && Objects.equals(this.isSetMerchantReference, paymentResponse.isSetMerchantReference) + && Objects.equals(this.opi, paymentResponse.opi) + && Objects.equals(this.isSetOpi, paymentResponse.isSetOpi) && Objects.equals(this.order, paymentResponse.order) && Objects.equals(this.isSetOrder, paymentResponse.isSetOrder) && Objects.equals(this.paymentMethod, paymentResponse.paymentMethod) @@ -1135,6 +1179,8 @@ public int hashCode() { isSetFraudResult, merchantReference, isSetMerchantReference, + opi, + isSetOpi, order, isSetOrder, paymentMethod, @@ -1167,6 +1213,7 @@ public String toString() { sb.append(" donationToken: ").append(toIndentedString(donationToken)).append("\n"); sb.append(" fraudResult: ").append(toIndentedString(fraudResult)).append("\n"); sb.append(" merchantReference: ").append(toIndentedString(merchantReference)).append("\n"); + sb.append(" opi: ").append(toIndentedString(opi)).append("\n"); sb.append(" order: ").append(toIndentedString(order)).append("\n"); sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); sb.append(" paymentValidations: ").append(toIndentedString(paymentValidations)).append("\n"); @@ -1221,6 +1268,9 @@ public Map getExplicitNulls() { if (isSetMerchantReference) { addIfNull(nulls, JSON_PROPERTY_MERCHANT_REFERENCE, this.merchantReference); } + if (isSetOpi) { + addIfNull(nulls, JSON_PROPERTY_OPI, this.opi); + } if (isSetOrder) { addIfNull(nulls, JSON_PROPERTY_ORDER, this.order); } diff --git a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodRequest.java b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodRequest.java index 6855c8a980..4e68188d70 100644 --- a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodRequest.java +++ b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodRequest.java @@ -26,6 +26,7 @@ /** StoredPaymentMethodRequest */ @JsonPropertyOrder({ StoredPaymentMethodRequest.JSON_PROPERTY_MERCHANT_ACCOUNT, + StoredPaymentMethodRequest.JSON_PROPERTY_OPI, StoredPaymentMethodRequest.JSON_PROPERTY_PAYMENT_METHOD, StoredPaymentMethodRequest.JSON_PROPERTY_RECURRING_PROCESSING_MODEL, StoredPaymentMethodRequest.JSON_PROPERTY_SHOPPER_EMAIL, @@ -39,6 +40,12 @@ public class StoredPaymentMethodRequest { /** Mark when the attribute has been explicitly set. */ private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_OPI = "opi"; + private OpiRequest opi; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpi = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private PaymentMethodToStore paymentMethod; @@ -169,6 +176,41 @@ public void setMerchantAccount(String merchantAccount) { isSetMerchantAccount = true; // mark as set } + /** + * opi + * + * @param opi + * @return the current {@code StoredPaymentMethodRequest} instance, allowing for method chaining + */ + public StoredPaymentMethodRequest opi(OpiRequest opi) { + this.opi = opi; + isSetOpi = true; // mark as set + return this; + } + + /** + * Get opi + * + * @return opi + */ + @JsonProperty(JSON_PROPERTY_OPI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OpiRequest getOpi() { + return opi; + } + + /** + * opi + * + * @param opi + */ + @JsonProperty(JSON_PROPERTY_OPI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOpi(OpiRequest opi) { + this.opi = opi; + isSetOpi = true; // mark as set + } + /** * paymentMethod * @@ -435,6 +477,8 @@ public boolean equals(Object o) { return Objects.equals(this.merchantAccount, storedPaymentMethodRequest.merchantAccount) && Objects.equals( this.isSetMerchantAccount, storedPaymentMethodRequest.isSetMerchantAccount) + && Objects.equals(this.opi, storedPaymentMethodRequest.opi) + && Objects.equals(this.isSetOpi, storedPaymentMethodRequest.isSetOpi) && Objects.equals(this.paymentMethod, storedPaymentMethodRequest.paymentMethod) && Objects.equals(this.isSetPaymentMethod, storedPaymentMethodRequest.isSetPaymentMethod) && Objects.equals( @@ -456,6 +500,8 @@ public int hashCode() { return Objects.hash( merchantAccount, isSetMerchantAccount, + opi, + isSetOpi, paymentMethod, isSetPaymentMethod, recurringProcessingModel, @@ -473,6 +519,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class StoredPaymentMethodRequest {\n"); sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); + sb.append(" opi: ").append(toIndentedString(opi)).append("\n"); sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); sb.append(" recurringProcessingModel: ") .append(toIndentedString(recurringProcessingModel)) @@ -507,6 +554,9 @@ public Map getExplicitNulls() { if (isSetMerchantAccount) { addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); } + if (isSetOpi) { + addIfNull(nulls, JSON_PROPERTY_OPI, this.opi); + } if (isSetPaymentMethod) { addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); } diff --git a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodResource.java b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodResource.java index 3636ebf182..18ae3bd93c 100644 --- a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodResource.java +++ b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodResource.java @@ -43,6 +43,7 @@ StoredPaymentMethodResource.JSON_PROPERTY_MANDATE, StoredPaymentMethodResource.JSON_PROPERTY_NAME, StoredPaymentMethodResource.JSON_PROPERTY_NETWORK_TX_REFERENCE, + StoredPaymentMethodResource.JSON_PROPERTY_OPI, StoredPaymentMethodResource.JSON_PROPERTY_OWNER_NAME, StoredPaymentMethodResource.JSON_PROPERTY_SHOPPER_EMAIL, StoredPaymentMethodResource.JSON_PROPERTY_SHOPPER_REFERENCE, @@ -164,6 +165,12 @@ public class StoredPaymentMethodResource { /** Mark when the attribute has been explicitly set. */ private boolean isSetNetworkTxReference = false; + public static final String JSON_PROPERTY_OPI = "opi"; + private OpiResponse opi; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpi = false; + public static final String JSON_PROPERTY_OWNER_NAME = "ownerName"; private String ownerName; @@ -907,6 +914,41 @@ public void setNetworkTxReference(String networkTxReference) { isSetNetworkTxReference = true; // mark as set } + /** + * opi + * + * @param opi + * @return the current {@code StoredPaymentMethodResource} instance, allowing for method chaining + */ + public StoredPaymentMethodResource opi(OpiResponse opi) { + this.opi = opi; + isSetOpi = true; // mark as set + return this; + } + + /** + * Get opi + * + * @return opi + */ + @JsonProperty(JSON_PROPERTY_OPI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OpiResponse getOpi() { + return opi; + } + + /** + * opi + * + * @param opi + */ + @JsonProperty(JSON_PROPERTY_OPI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOpi(OpiResponse opi) { + this.opi = opi; + isSetOpi = true; // mark as set + } + /** * The name of the bank account holder. * @@ -1228,6 +1270,8 @@ public boolean equals(Object o) { && Objects.equals(this.networkTxReference, storedPaymentMethodResource.networkTxReference) && Objects.equals( this.isSetNetworkTxReference, storedPaymentMethodResource.isSetNetworkTxReference) + && Objects.equals(this.opi, storedPaymentMethodResource.opi) + && Objects.equals(this.isSetOpi, storedPaymentMethodResource.isSetOpi) && Objects.equals(this.ownerName, storedPaymentMethodResource.ownerName) && Objects.equals(this.isSetOwnerName, storedPaymentMethodResource.isSetOwnerName) && Objects.equals(this.shopperEmail, storedPaymentMethodResource.shopperEmail) @@ -1286,6 +1330,8 @@ public int hashCode() { isSetName, networkTxReference, isSetNetworkTxReference, + opi, + isSetOpi, ownerName, isSetOwnerName, shopperEmail, @@ -1325,6 +1371,7 @@ public String toString() { sb.append(" mandate: ").append(toIndentedString(mandate)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" networkTxReference: ").append(toIndentedString(networkTxReference)).append("\n"); + sb.append(" opi: ").append(toIndentedString(opi)).append("\n"); sb.append(" ownerName: ").append(toIndentedString(ownerName)).append("\n"); sb.append(" shopperEmail: ").append(toIndentedString(shopperEmail)).append("\n"); sb.append(" shopperReference: ").append(toIndentedString(shopperReference)).append("\n"); @@ -1413,6 +1460,9 @@ public Map getExplicitNulls() { if (isSetNetworkTxReference) { addIfNull(nulls, JSON_PROPERTY_NETWORK_TX_REFERENCE, this.networkTxReference); } + if (isSetOpi) { + addIfNull(nulls, JSON_PROPERTY_OPI, this.opi); + } if (isSetOwnerName) { addIfNull(nulls, JSON_PROPERTY_OWNER_NAME, this.ownerName); } From 959125f02de047c3ed40724b90905201fc91fbd9 Mon Sep 17 00:00:00 2001 From: poojah Date: Mon, 12 Oct 2026 16:07:29 +0200 Subject: [PATCH 2/2] Unit test for checkout PR - 2073 --- src/test/java/com/adyen/CheckoutTest.java | 146 ++++++++++++++++++ .../checkout/createSessionsResponse.json | 1 + .../mocks/checkout/forwardResponse.json | 8 +- 3 files changed, 154 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/adyen/CheckoutTest.java b/src/test/java/com/adyen/CheckoutTest.java index 60c2e62120..e7c3601fcc 100644 --- a/src/test/java/com/adyen/CheckoutTest.java +++ b/src/test/java/com/adyen/CheckoutTest.java @@ -294,6 +294,7 @@ public void testCreateSessionsSuccessCall() throws Exception { assertEquals( CreateCheckoutSessionResponse.StorePaymentMethodModeEnum.ASKFORCONSENT, createCheckoutSessionResponse.getStorePaymentMethodMode()); + assertEquals(Boolean.TRUE, createCheckoutSessionResponse.getPayable()); } @Test @@ -973,6 +974,12 @@ public void testForwardToken() throws Exception { assertNotNull(response.getResponse()); assertEquals(200, (int) response.getResponse().getStatus()); assertTrue(response.getResponse().getBody().contains("PAYMENT_METHOD_ID")); + assertNotNull(response.getAccountUpdate()); + assertEquals( + CheckoutForwardAccountUpdateResult.ResultEnum.CARDCHANGED, + response.getAccountUpdate().getResult()); + assertNotNull(response.getNetworkToken()); + assertEquals(Boolean.TRUE, response.getNetworkToken().getSwapped()); } @Test @@ -1156,4 +1163,143 @@ public void testPaypalUpdateOrderRequestSerialization() throws Exception { assertEquals("Express Shipping", parsed.getDeliveryMethods().get(0).getDescription()); assertEquals(true, parsed.getDeliveryMethods().get(0).getSelected()); } + + @Test + public void testPayByBankCADirectDebitDetails() throws Exception { + CheckoutPaymentMethod paymentMethod = + new CheckoutPaymentMethod( + new PayByBankCADirectDebitDetails() + .type(PayByBankCADirectDebitDetails.TypeEnum.PAYBYBANK_CA) + .checkoutAttemptId("1") + .storedPaymentMethodId("M5N7TQ4TG5PFWR50")); + + CheckoutPaymentMethod parsed = CheckoutPaymentMethod.fromJson(paymentMethod.toJson()); + + assertEquals( + PayByBankCADirectDebitDetails.TypeEnum.PAYBYBANK_CA, + parsed.getPayByBankCADirectDebitDetails().getType()); + assertEquals("1", parsed.getPayByBankCADirectDebitDetails().getCheckoutAttemptId()); + assertEquals( + "M5N7TQ4TG5PFWR50", parsed.getPayByBankCADirectDebitDetails().getStoredPaymentMethodId()); + } + + @Test + public void testPayByBankCADeserialization() throws Exception { + CheckoutPaymentMethod parsed = + CheckoutPaymentMethod.fromJson( + "{\n" + + " \"type\": \"paybybank_ca\",\n" + + " \"checkoutAttemptId\": \"1\",\n" + + " \"storedPaymentMethodId\": \"M5N7TQ4TG5PFWR50\"\n" + + " }"); + + assertEquals( + PayByBankCADirectDebitDetails.TypeEnum.PAYBYBANK_CA, + parsed.getPayByBankCADirectDebitDetails().getType()); + assertEquals("1", parsed.getPayByBankCADirectDebitDetails().getCheckoutAttemptId()); + assertEquals( + "M5N7TQ4TG5PFWR50", parsed.getPayByBankCADirectDebitDetails().getStoredPaymentMethodId()); + } + + @Test + public void testOpiRequestResponseSerialization() throws Exception { + PaymentRequest paymentRequest = + new PaymentRequest() + .merchantAccount("YOUR_MERCHANT_ACCOUNT") + .reference("YOUR_REFERENCE") + .amount(new Amount().currency("EUR").value(1000L)) + .opi(new OpiRequest().includeIssuerId(true).includeTransToken(true)); + + String json = paymentRequest.toJson(); + assertTrue(json.contains("opi")); + + PaymentRequest parsed = PaymentRequest.fromJson(json); + assertEquals(Boolean.TRUE, parsed.getOpi().getIncludeIssuerId()); + assertEquals(Boolean.TRUE, parsed.getOpi().getIncludeTransToken()); + + OpiResponse opiResponse = new OpiResponse().issuerId("ISSUER_ID").transToken("TRANS_TOKEN"); + OpiResponse parsedOpiResponse = OpiResponse.fromJson(opiResponse.toJson()); + assertEquals("ISSUER_ID", parsedOpiResponse.getIssuerId()); + assertEquals("TRANS_TOKEN", parsedOpiResponse.getTransToken()); + + StoredPaymentMethodRequest storedPaymentMethodRequest = + new StoredPaymentMethodRequest().opi(new OpiRequest().includeTransToken(true)); + assertEquals( + Boolean.TRUE, + StoredPaymentMethodRequest.fromJson(storedPaymentMethodRequest.toJson()) + .getOpi() + .getIncludeTransToken()); + } + + @Test + public void testPaymentResponseWithOpi() throws Exception { + String mockResponse = + "{\"resultCode\":\"Authorised\",\"pspReference\":\"8815658961765250\"," + + "\"opi\":{\"issuerId\":\"ISSUER_ID\",\"transToken\":\"TRANS_TOKEN\"}}"; + Client client = createMockClientFromResponse(mockResponse); + + PaymentRequest paymentRequest = + new PaymentRequest() + .merchantAccount("YOUR_MERCHANT_ACCOUNT") + .reference("YOUR_REFERENCE") + .amount(new Amount().currency("EUR").value(1000L)) + .opi(new OpiRequest().includeIssuerId(true)); + + PaymentsApi checkout = new PaymentsApi(client); + PaymentResponse paymentResponse = checkout.payments(paymentRequest); + + assertEquals(PaymentResponse.ResultCodeEnum.AUTHORISED, paymentResponse.getResultCode()); + assertEquals("ISSUER_ID", paymentResponse.getOpi().getIssuerId()); + assertEquals("TRANS_TOKEN", paymentResponse.getOpi().getTransToken()); + } + + @Test + public void testCreateSessionWithPayable() throws Exception { + CreateCheckoutSessionRequest sessionRequest = + new CreateCheckoutSessionRequest() + .merchantAccount("YOUR_MERCHANT_ACCOUNT") + .amount(new Amount().currency("EUR").value(1000L)) + .reference("YOUR_PAYMENT_REFERENCE") + .payable(true); + + String json = sessionRequest.toJson(); + assertTrue(json.contains("payable")); + + CreateCheckoutSessionRequest parsed = CreateCheckoutSessionRequest.fromJson(json); + assertEquals(Boolean.TRUE, parsed.getPayable()); + } + + @Test + public void testKlarnaNetworkDetailsKlarnaNetworkPaymentAccountId() throws Exception { + KlarnaNetworkDetails klarnaNetworkDetails = + new KlarnaNetworkDetails() + .type(KlarnaNetworkDetails.TypeEnum.KLARNA_NETWORK) + .klarnaNetworkSessionToken("SESSION_TOKEN") + .klarnaNetworkPaymentAccountId("KLARNA_NETWORK_PAYMENT_ACCOUNT_ID"); + + KlarnaNetworkDetails parsed = KlarnaNetworkDetails.fromJson(klarnaNetworkDetails.toJson()); + + assertEquals("SESSION_TOKEN", parsed.getKlarnaNetworkSessionToken()); + assertEquals("KLARNA_NETWORK_PAYMENT_ACCOUNT_ID", parsed.getKlarnaNetworkPaymentAccountId()); + } + + @Test + public void testLineItemRiskCategory() throws Exception { + LineItem lineItem = + new LineItem().quantity(1L).amountIncludingTax(1000L).riskCategory("electronics"); + + LineItem parsed = LineItem.fromJson(lineItem.toJson()); + + assertEquals(1L, parsed.getQuantity().longValue()); + assertEquals("electronics", parsed.getRiskCategory()); + } + + @Test + public void testSatispayPaymentDetailsType() throws Exception { + assertEquals(PaymentDetails.TypeEnum.SATISPAY, PaymentDetails.TypeEnum.fromValue("satispay")); + + PaymentDetails paymentDetails = new PaymentDetails().type(PaymentDetails.TypeEnum.SATISPAY); + PaymentDetails parsed = PaymentDetails.fromJson(paymentDetails.toJson()); + assertEquals(PaymentDetails.TypeEnum.SATISPAY, parsed.getType()); + } } diff --git a/src/test/resources/mocks/checkout/createSessionsResponse.json b/src/test/resources/mocks/checkout/createSessionsResponse.json index 6271e18f8f..21ca71e566 100644 --- a/src/test/resources/mocks/checkout/createSessionsResponse.json +++ b/src/test/resources/mocks/checkout/createSessionsResponse.json @@ -12,5 +12,6 @@ "returnUrl": "https://your-company.com/checkout?shopperOrder=12xy..", "sessionData": "Ab02b4c0!BFHSPFBQTEwM0NBNTM3RfCf5", "mode": "embedded", + "payable": true, "storePaymentMethodMode": "askForConsent" } \ No newline at end of file diff --git a/src/test/resources/mocks/checkout/forwardResponse.json b/src/test/resources/mocks/checkout/forwardResponse.json index bf4adf6dcb..806c072d99 100644 --- a/src/test/resources/mocks/checkout/forwardResponse.json +++ b/src/test/resources/mocks/checkout/forwardResponse.json @@ -1,4 +1,10 @@ { + "accountUpdate": { + "result": "CardChanged" + }, + "networkToken": { + "swapped": true + }, "pspReference": "8815658961765250", "response": { "body": "{\"data\": {\"tokenizeCreditCard\": {\"paymentMethod\": {\"id\": \"PAYMENT_METHOD_ID\"}}}}", @@ -8,4 +14,4 @@ "status": 200 }, "storedPaymentMethodId": "PAYMENT_METHOD_ID" -} \ No newline at end of file +}