Skip to content

Improve java sdk consistency#5

Merged
koen-serry merged 7 commits intotwikey:masterfrom
chaixdev:improve-java-sdk-consistency
Jan 19, 2026
Merged

Improve java sdk consistency#5
koen-serry merged 7 commits intotwikey:masterfrom
chaixdev:improve-java-sdk-consistency

Conversation

@chaixdev
Copy link
Copy Markdown

  • Centralized Error Handling: Added apiError(HttpResponse<?>) in TwikeyClient to handle both ApiError and apierror headers. This fixed an inconsistency between gateways.
  • Robust Null/Blank Handling: Created RequestUtils.putIfNotNull with centralized logic to filter out both null and isBlank() strings. This standardized behavior across all request classes and mitigates a potential bug where blank values were not considered.
  • Refactored PaylinkGateway: Brought PaylinkGateway in line with other gateways by introducing PaylinkRequest and PaylinkResponse models. The old method is preserved but @deprecated.
  • Modernized Authentication: Migrated getSessionToken() from legacy HttpURLConnection to the modern HttpClient.
  • Hmac comparison: replaced manual for loop comparison with more secure MessageDigest.equals()

@chaixdev chaixdev force-pushed the improve-java-sdk-consistency branch from 210432a to 960d63d Compare January 19, 2026 09:14
@koen-serry koen-serry merged commit 6768af1 into twikey:master Jan 19, 2026
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.

2 participants