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-27T10:29:48Z",
"openapiCommitSha": "2f7d0e1961772ee974be4ed268282cf2ba8f6e03",
"automationCommitSha": "0c108bd8050cf480d2710b78b770afdfbdd89397",
"libraryCommitSha": "913f166177824e57c26c5f0543b46144219ca6af"
"libraryCommitSha": "8c443c21fa34998ecc2f8d53f4ff947ee0bac438"
}
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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaking change

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 @@ -203,6 +203,32 @@ public DonationPaymentMethod deserialize(JsonParser jp, DeserializationContext c
log.log(Level.FINER, "Input data does not match schema 'PayWithGoogleDonations'", e);
}

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

if (typeMatch) {
deserialized = tree.traverse(jp.getCodec()).readValueAs(SepaDirectDebitDonations.class);
// TODO: there is no validation against JSON schema constraints
// (min, max, enum, pattern...), this does not perform a strict JSON
// validation, which means the 'match' count may be higher than it should be.
match++;
log.log(Level.FINER, "Input data matches schema 'SepaDirectDebitDonations'");
}
}
} catch (Exception e) {
// deserialization failed, continue
log.log(Level.FINER, "Input data does not match schema 'SepaDirectDebitDonations'", e);
}

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

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

static {
schemas.put("ApplePayDonations", new GenericType<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 @@ public DonationPaymentMethod(PayWithGoogleDonations o) {
mappings.put("networkToken", CardDonations.class);
mappings.put("paywithgoogle", PayWithGoogleDonations.class);
mappings.put("scheme", CardDonations.class);
mappings.put("sepadirectdebit", SepaDirectDebitDonations.class);
mappings.put("ApplePayDonations", ApplePayDonations.class);
mappings.put("CardDonations", CardDonations.class);
mappings.put("GooglePayDonations", GooglePayDonations.class);
mappings.put("IdealDonations", IdealDonations.class);
mappings.put("PayWithGoogleDonations", PayWithGoogleDonations.class);
mappings.put("SepaDirectDebitDonations", SepaDirectDebitDonations.class);
mappings.put("DonationPaymentMethod", DonationPaymentMethod.class);
JSON.registerDiscriminator(DonationPaymentMethod.class, "type", mappings);
}
Expand All @@ -287,7 +321,7 @@ public Map<String, GenericType<?>> getSchemas() {
/**
* Set the instance that matches the oneOf child schema, check the instance parameter is valid
* against the oneOf child schemas: ApplePayDonations, CardDonations, GooglePayDonations,
* IdealDonations, PayWithGoogleDonations
* IdealDonations, PayWithGoogleDonations, SepaDirectDebitDonations
*
* <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 @@ public void setActualInstance(Object instance) {
return;
}

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

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

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

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

/**
* Create an instance of DonationPaymentMethod given an JSON string
*
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
Loading