Skip to content

DEV-135811: Support digital wallets in the SDK#216

Open
tomas-amaro wants to merge 1 commit into
masterfrom
DEV-135811
Open

DEV-135811: Support digital wallets in the SDK#216
tomas-amaro wants to merge 1 commit into
masterfrom
DEV-135811

Conversation

@tomas-amaro

@tomas-amaro tomas-amaro commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a digital-wallets payment-details model to the Java SDK, enabling merchants (driver: lastminute.com) to submit Apple Pay / Google Pay / Samsung Pay / WeChat Pay / Amazon Pay / Alipay payments. Implements the digital_wallets_payment_details schema from the API reference.

Jira: DEV-135811

Changes

  • New model WalletPaymentDetails (com.riskified.models) implementing IPaymentDetails. Contains all 21 fields from the spec (payment_type, avs_result_code, credit_card_company, credit_card_country, credit_card_token, cardholder_name, authorization_id, mid, id, stored_payment_created_at, stored_payment_updated_at, installments, acquirer_bin, acquirer_region, authorization_type, expiry_month, expiry_year, initial_payment_amount, payment_frequency, billing_address_id, authentication_result).
  • Registered the subtype in JSONFormater.paymentDetailsSerializer() (discriminator digital_wallet) so a wallet detail can be serialized inside an order's paymentDetails list. Reuses the existing AuthenticationResult and AuthorizationType models.
  • Tests added to PaymentDetailsTest covering payment-type serialization, the net-new field keys, validation (happy path + rejections), and end-to-end polymorphic serialization.
  • Version bump 6.3.16.4.0 in pom.xml and README.md.

Design decisions

  • payment_type is a required, settable field (unlike other payment models which hardcode their type) since it varies across the six wallet types. It's a constructor argument and validated to be one of the six wallet values.
  • Reused the existing PaymentType enum — all six wallet values already existed.
  • initial_payment_amount, payment_frequency, billing_address_id are net-new to the codebase; optional numerics use boxed/nullable types so they only serialize when set.
  • Required fields (payment_type, authorization_id, avs_result_code) match the spec.
  • The method discriminator is a legacy SDK-internal field (not part of the API spec, which distinguishes purely by payment_type); registration is required by the polymorphic serializer, so digital_wallet was used for consistency with the other payment types.

Testing

  • PaymentDetailsTest — all 15 tests pass (8 pre-existing + 7 new wallet tests), including verification that a wallet inside an IPaymentDetails list serializes with "method":"digital_wallet" and the correct payment_type.

@tomas-amaro tomas-amaro marked this pull request as ready for review July 8, 2026 15:05
@tomas-amaro tomas-amaro requested a review from a team as a code owner July 8, 2026 15:05
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.

1 participant