Skip to content

Add TAPI utility helpers for PredefinedContent and SaleToAcquirerData#1913

Open
gcatanese wants to merge 1 commit intomainfrom
add-tapi-util
Open

Add TAPI utility helpers for PredefinedContent and SaleToAcquirerData#1913
gcatanese wants to merge 1 commit intomainfrom
add-tapi-util

Conversation

@gcatanese
Copy link
Copy Markdown
Contributor

@gcatanese gcatanese commented Apr 14, 2026

Summary

Introduces hand-written utility helpers in com.adyen.util.tapi to work with fields from the auto-generated TAPI models that require additional parsing logic:

  • PredefinedContent.ReferenceID string with URL query string format
  • SaleData.SaleToAcquirerData string with either JSON or key-value pairs

New classes

PredefinedContentHelper
Parses the PredefinedContent.ReferenceID URL query string into typed accessors: getEvent(), getTransactionId(), getTimeStamp(), and get(key).

SaleToAcquirerData
A Jackson-based POJO representing the decoded acquirer data. Supports both formats described in the Adyen docs:

  • Base64-encoded JSON (fromBase64)
  • Form-encoded key-value pairs (fromKeyValuePairs)

SaleDataHelper
Wraps a tapi.SaleData instance and exposes getSaleToAcquirerData(), auto-detecting the format of the underlying string.

Notes

  • All helpers live outside com.adyen.model.tapi which is auto-generated from the OpenAPI spec
  • No dependency on the legacy com.adyen.model.terminal package
  • Uses java.util.Base64 and Jackson throughout, consistent with the rest of the TAPI stack

@gcatanese gcatanese requested review from a team as code owners April 14, 2026 11:54
Copy link
Copy Markdown
Contributor

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

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 introduces several helper classes—PredefinedContentHelper, SaleDataHelper, and SaleToAcquirerData—to handle the parsing of terminal API data, including URL query-like strings and SaleToAcquirerData in both Base64-encoded JSON and form-encoded formats. The review feedback highlights an opportunity to improve efficiency by avoiding redundant Base64 decoding in SaleDataHelper and suggests explicitly defining the UTF-8 charset when converting bytes to strings in SaleToAcquirerData for better environment consistency.

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