Skip to content

Add missing enum values for afterpaytouch_US and DEFFERED_DEBIT - #2057

Open
piyush15102003 wants to merge 1 commit into
Adyen:mainfrom
piyush15102003:fix/missing-enum-values-1953-1878
Open

Add missing enum values for afterpaytouch_US and DEFFERED_DEBIT#2057
piyush15102003 wants to merge 1 commit into
Adyen:mainfrom
piyush15102003:fix/missing-enum-values-1953-1878

Conversation

@piyush15102003

Copy link
Copy Markdown

Fixes #1953, fixes #1878.

Both issues have the same root cause: the live API can return values that are missing from the generated enums. Because of that, the values get deserialized as null and the actual API value is lost.

The missing values are:

  • Checkout /paymentMethods can return afterpaytouch_US for Afterpay/Cash App Afterpay in the US. This is missing from the CheckoutPaymentMethod discriminator mapping and AfterpayDetails.TypeEnum.
  • POS terminals can return additionalData.fundingSource = DEFFERED_DEBIT, which is missing from CardDetails.FundingSourceEnum.

As discussed in #1514, unknown enum values are handled by returning null with a warning instead of throwing an exception. So these values don't cause a failure, but we still lose useful data when they are returned by the API.

This change adds the missing values so they are correctly deserialized.

Changes

  • Added afterpaytouch_US to the CheckoutPaymentMethod discriminator mapping.
  • Added AFTERPAYTOUCH_US to AfterpayDetails.TypeEnum.
  • Added DEFFERED_DEBIT to CardDetails.FundingSourceEnum.
  • Added tests for fromValue() resolution and polymorphic deserialization of a CheckoutPaymentMethod payload.

The casing is kept exactly as returned by the API (afterpaytouch_US and DEFFERED_DEBIT). This follows the decision in #1514 to keep enum matching case-sensitive, as defined by OpenAPI.

Verification

  • mvn -Dtest=com.adyen.serializer.ModelTest test -Dcheckstyle.skip=true — 19 tests, 0 failures.
  • mvn test -Dcheckstyle.skip=true -DskipITs — 634 tests, 0 failures, 0 errors, 4 skips.
  • mvn checkstyle:check — no new violations.

The Checkout API can return payment method type afterpaytouch_US
(Afterpay/Cash App Afterpay in the US) and additionalData.fundingSource
DEFFERED_DEBIT from POS terminals, but neither value was present in the
corresponding generated enums, causing deserialization/mapping issues.

- CheckoutPaymentMethod: add afterpaytouch_US to the discriminator mapping
- AfterpayDetails.TypeEnum: add AFTERPAYTOUCH_US
- CardDetails.FundingSourceEnum: add DEFFERED_DEBIT

Fixes Adyen#1953
Fixes Adyen#1878
@piyush15102003
piyush15102003 requested a review from a team as a code owner August 31, 2026 11:37

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request adds support for the afterpaytouch_US payment method type in AfterpayDetails and CheckoutPaymentMethod, and introduces the DEFFERED_DEBIT funding source to CardDetails. Corresponding unit tests have been added to verify these changes. There are no review comments, so no additional feedback is provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Missing afterpaytouch_US enum value for payment method type FundingSourceEnum missing DEFFERED_DEBIT value returned by POS terminals

1 participant