Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sdk-generation-log/checkout.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"service": "checkout",
"project": "java",
"generatedAt": "2026-07-22T11:25:22Z",
"openapiCommitSha": "c6f0131e5551226fd523852ff6f5ad1df6c72ee2",
"generatedAt": "2026-07-31T12:01:49Z",
"openapiCommitSha": "425d65d12163ebd4fe6fa6d2f859075817c81cba",
"automationCommitSha": "0c108bd8050cf480d2710b78b770afdfbdd89397",
"libraryCommitSha": "913f166177824e57c26c5f0543b46144219ca6af"
"libraryCommitSha": "ef0f827bf1e2d31bdc55f7cc4860ffef20601f42"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2146,7 +2146,7 @@ public CheckoutPaymentMethod(ZipDetails o) {
mappings.put("gcash", StoredPaymentMethodDetails.class);
mappings.put("giftcard", CardDetails.class);
mappings.put("googlepay", GooglePayDetails.class);
mappings.put("gopay_wallet", PaymentDetails.class);
mappings.put("gopay_wallet", StoredPaymentMethodDetails.class);
Comment thread
poojah-adyen marked this conversation as resolved.
mappings.put("grabpay_ID", StoredPaymentMethodDetails.class);
mappings.put("grabpay_MY", StoredPaymentMethodDetails.class);
mappings.put("grabpay_PH", StoredPaymentMethodDetails.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
/** DonationCampaignsRequest */
@JsonPropertyOrder({
DonationCampaignsRequest.JSON_PROPERTY_CURRENCY,
DonationCampaignsRequest.JSON_PROPERTY_LABEL,
DonationCampaignsRequest.JSON_PROPERTY_LOCALE,
DonationCampaignsRequest.JSON_PROPERTY_MERCHANT_ACCOUNT,
DonationCampaignsRequest.JSON_PROPERTY_STORE
Expand All @@ -33,6 +34,12 @@ public class DonationCampaignsRequest {
/** Mark when the attribute has been explicitly set. */
private boolean isSetCurrency = false;

public static final String JSON_PROPERTY_LABEL = "label";
private String label;

/** Mark when the attribute has been explicitly set. */
private boolean isSetLabel = false;

public static final String JSON_PROPERTY_LOCALE = "locale";
private String locale;

Expand Down Expand Up @@ -100,6 +107,41 @@ public void setCurrency(String currency) {
isSetCurrency = true; // mark as set
}

/**
* The label that is assigned to the donation campaign.
*
* @param label The label that is assigned to the donation campaign.
* @return the current {@code DonationCampaignsRequest} instance, allowing for method chaining
*/
public DonationCampaignsRequest label(String label) {
this.label = label;
isSetLabel = true; // mark as set
return this;
}

/**
* The label that is assigned to the donation campaign.
*
* @return label The label that is assigned to the donation campaign.
*/
@JsonProperty(JSON_PROPERTY_LABEL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getLabel() {
return label;
}

/**
* The label that is assigned to the donation campaign.
*
* @param label The label that is assigned to the donation campaign.
*/
@JsonProperty(JSON_PROPERTY_LABEL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setLabel(String label) {
this.label = label;
isSetLabel = true; // mark as set
}

/**
* Locale on the shopper interaction device.
*
Expand Down Expand Up @@ -276,6 +318,8 @@ public boolean equals(Object o) {
DonationCampaignsRequest donationCampaignsRequest = (DonationCampaignsRequest) o;
return Objects.equals(this.currency, donationCampaignsRequest.currency)
&& Objects.equals(this.isSetCurrency, donationCampaignsRequest.isSetCurrency)
&& Objects.equals(this.label, donationCampaignsRequest.label)
&& Objects.equals(this.isSetLabel, donationCampaignsRequest.isSetLabel)
&& Objects.equals(this.locale, donationCampaignsRequest.locale)
&& Objects.equals(this.isSetLocale, donationCampaignsRequest.isSetLocale)
&& Objects.equals(this.merchantAccount, donationCampaignsRequest.merchantAccount)
Expand All @@ -289,6 +333,8 @@ public int hashCode() {
return Objects.hash(
currency,
isSetCurrency,
label,
isSetLabel,
locale,
isSetLocale,
merchantAccount,
Expand All @@ -302,6 +348,7 @@ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DonationCampaignsRequest {\n");
sb.append(" currency: ").append(toIndentedString(currency)).append("\n");
sb.append(" label: ").append(toIndentedString(label)).append("\n");
sb.append(" locale: ").append(toIndentedString(locale)).append("\n");
sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n");
sb.append(" store: ").append(toIndentedString(store)).append("\n");
Expand Down Expand Up @@ -332,6 +379,9 @@ public Map<String, Object> getExplicitNulls() {
if (isSetCurrency) {
addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency);
}
if (isSetLabel) {
addIfNull(nulls, JSON_PROPERTY_LABEL, this.label);
}
if (isSetLocale) {
addIfNull(nulls, JSON_PROPERTY_LOCALE, this.locale);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,32 @@
log.log(Level.FINER, "Input data does not match schema 'PayWithGoogleDonations'", e);
}

// deserialize SepaDirectDebitDonations
try {
boolean attemptParsing = true;
if (attemptParsing) {
// Checks if the unique type of the oneOf json matches any of the object TypeEnum values
boolean typeMatch = false;
if (tree.findValue("type") != null) {
typeMatch =
Arrays.stream(SepaDirectDebitDonations.TypeEnum.values())
.anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText()));

Check warning on line 215 in src/main/java/com/adyen/model/checkout/DonationPaymentMethod.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the parentheses around the "t" parameter

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-java-api-library&issues=AZ-O2WBe4hBPh09VhQTd&open=AZ-O2WBe4hBPh09VhQTd&pullRequest=2015
}

if (typeMatch) {
deserialized = tree.traverse(jp.getCodec()).readValueAs(SepaDirectDebitDonations.class);
// TODO: there is no validation against JSON schema constraints

Check warning on line 220 in src/main/java/com/adyen/model/checkout/DonationPaymentMethod.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Complete the task associated to this TODO comment.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-java-api-library&issues=AZ-O2WBe4hBPh09VhQTe&open=AZ-O2WBe4hBPh09VhQTe&pullRequest=2015
// (min, max, enum, pattern...), this does not perform a strict JSON
// validation, which means the 'match' count may be higher than it should be.
match++;
log.log(Level.FINER, "Input data matches schema 'SepaDirectDebitDonations'");
}
}
} catch (Exception e) {
// deserialization failed, continue
log.log(Level.FINER, "Input data does not match schema 'SepaDirectDebitDonations'", e);
}

if (match == 1) {
DonationPaymentMethod ret = new DonationPaymentMethod();
ret.setActualInstance(deserialized);
Expand Down Expand Up @@ -254,12 +280,18 @@
setActualInstance(o);
}

public DonationPaymentMethod(SepaDirectDebitDonations o) {
super("oneOf", Boolean.FALSE);
setActualInstance(o);
}

static {
schemas.put("ApplePayDonations", new GenericType<ApplePayDonations>() {});
schemas.put("CardDonations", new GenericType<CardDonations>() {});
schemas.put("GooglePayDonations", new GenericType<GooglePayDonations>() {});
schemas.put("IdealDonations", new GenericType<IdealDonations>() {});
schemas.put("PayWithGoogleDonations", new GenericType<PayWithGoogleDonations>() {});
schemas.put("SepaDirectDebitDonations", new GenericType<SepaDirectDebitDonations>() {});
JSON.registerDescendants(DonationPaymentMethod.class, Collections.unmodifiableMap(schemas));
// Initialize and register the discriminator mappings.
Map<String, Class<?>> mappings = new HashMap<>();
Expand All @@ -270,11 +302,13 @@
mappings.put("networkToken", CardDonations.class);
mappings.put("paywithgoogle", PayWithGoogleDonations.class);
mappings.put("scheme", CardDonations.class);
mappings.put("sepadirectdebit", SepaDirectDebitDonations.class);
mappings.put("ApplePayDonations", ApplePayDonations.class);
mappings.put("CardDonations", CardDonations.class);
mappings.put("GooglePayDonations", GooglePayDonations.class);
mappings.put("IdealDonations", IdealDonations.class);
mappings.put("PayWithGoogleDonations", PayWithGoogleDonations.class);
mappings.put("SepaDirectDebitDonations", SepaDirectDebitDonations.class);
mappings.put("DonationPaymentMethod", DonationPaymentMethod.class);
JSON.registerDiscriminator(DonationPaymentMethod.class, "type", mappings);
}
Expand All @@ -287,7 +321,7 @@
/**
* Set the instance that matches the oneOf child schema, check the instance parameter is valid
* against the oneOf child schemas: ApplePayDonations, CardDonations, GooglePayDonations,
* IdealDonations, PayWithGoogleDonations
* IdealDonations, PayWithGoogleDonations, SepaDirectDebitDonations
*
* <p>It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a
* composed schema (allOf, anyOf, oneOf).
Expand Down Expand Up @@ -319,16 +353,21 @@
return;
}

if (JSON.isInstanceOf(SepaDirectDebitDonations.class, instance, new HashSet<>())) {
super.setActualInstance(instance);
return;
}

throw new RuntimeException(
"Invalid instance type. Must be ApplePayDonations, CardDonations, GooglePayDonations, IdealDonations, PayWithGoogleDonations");
"Invalid instance type. Must be ApplePayDonations, CardDonations, GooglePayDonations, IdealDonations, PayWithGoogleDonations, SepaDirectDebitDonations");
}

/**
* Get the actual instance, which can be the following: ApplePayDonations, CardDonations,
* GooglePayDonations, IdealDonations, PayWithGoogleDonations
* GooglePayDonations, IdealDonations, PayWithGoogleDonations, SepaDirectDebitDonations
*
* @return The actual instance (ApplePayDonations, CardDonations, GooglePayDonations,
* IdealDonations, PayWithGoogleDonations)
* IdealDonations, PayWithGoogleDonations, SepaDirectDebitDonations)
*/
@Override
public Object getActualInstance() {
Expand Down Expand Up @@ -390,6 +429,17 @@
return (PayWithGoogleDonations) super.getActualInstance();
}

/**
* Get the actual instance of `SepaDirectDebitDonations`. If the actual instance is not
* `SepaDirectDebitDonations`, the ClassCastException will be thrown.
*
* @return The actual instance of `SepaDirectDebitDonations`
* @throws ClassCastException if the instance is not `SepaDirectDebitDonations`
*/
public SepaDirectDebitDonations getSepaDirectDebitDonations() throws ClassCastException {
return (SepaDirectDebitDonations) super.getActualInstance();
}

/**
* Create an instance of DonationPaymentMethod given an JSON string
*
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/adyen/model/checkout/PaymentDetails.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ public enum TypeEnum {

OMANNET(String.valueOf("omannet")),

GOPAY_WALLET(String.valueOf("gopay_wallet")),

KCP_NAVERPAY(String.valueOf("kcp_naverpay")),

FAWRY(String.valueOf("fawry")),
Expand Down
Loading