Handle Cloud Device API BaseURL logic - #1835
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces regional base URL support for the Adyen Device API, enabling the construction of region-specific live URLs based on configuration. The feedback highlights a logic issue where early returns prevent generic URL transformations, suggests escaping dots in regex strings for accuracy, and identifies a potential misconfiguration for the India region. Furthermore, it recommends simplifying the test suite by removing unnecessary reflection for accessing protected fields within the same package.
…ccess Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…locks Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…ethodSource Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
| assertEquals(testUrl, actualUrl); | ||
| } | ||
|
|
||
| static Stream<Arguments> deviceApiRegionToLiveUrl() { |
thomasc-adyen
approved these changes
Apr 2, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends the
createBaseURLlogic inService.javato properly handle the Cloud Device API base URL when switching from test to live environments.Previously, the generic
-testto-livereplacement was applied to all URLs. The Device API uses a different URL pattern (device-api-test.adyen.com) that requires region-aware routing in live environments.Changes
Service.java: Added a condition to detect Device API URLs (device-api-) and replace the test URL with the correct live URL based onterminalApiRegion:https://device-api-live.adyen.comhttps://device-api-live-{region}.adyen.comServiceTest.java: Added unit tests covering all region cases (default/EU, AU, US, APSE) and the test environment passthrough.CloudDeviceApiTest.java: Added integration-style tests verifying the resolvedbaseURLfield onCloudDeviceApifor various environment/region combinations.