-
Notifications
You must be signed in to change notification settings - Fork 146
PW-647: Fix Java library for checkout dynamic urls #120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/main/java/com/adyen/Client.java
Outdated
| this.config.setConnectionTimeoutMillis(connectionTimeoutMillis); | ||
| } | ||
|
|
||
| public Client(String username, String password, Environment environment, String applicationName, String liveEndpointUrlPrefix) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove it as applicationName will be removed and not needed after we implement applicationInformation
src/main/java/com/adyen/Client.java
Outdated
| this.config.setCheckoutEndpoint(CHECKOUT_ENDPOINT_LIVE); | ||
| } else { | ||
| // throw exception | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you use setEnvironment(environment) this is not setting any live endpoints any more ? would it not be better to just call setEnvironment(environment, null) and handle the null value as we already do ?
src/main/java/com/adyen/Client.java
Outdated
| this.config.setEndpoint(ENDPOINT_LIVE); | ||
| this.config.setCheckoutEndpoint(null); // not supported please specify unique identifier | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove empy line.
| if (client.getConfig().getCheckoutEndpoint() == null || client.getConfig().getCheckoutEndpoint().isEmpty()) { | ||
| String message = "Please specify the unique identifier when setting the environment"; | ||
| throw new IllegalArgumentException(message); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate code, let's find a better spot to reduct duplication
| this.config.setCheckoutEndpoint(ENDPOINT_PROTOCOL + liveEndpointUrlPrefix + CHECKOUT_ENDPOINT_LIVE_SUFFIX); | ||
| } else { | ||
| this.config.setEndpoint(ENDPOINT_LIVE); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe best to setCheckoutEndpoint to null so if you first do a setEnvironment(TEST) and then setEnvironment(LIVE) you don't use the test endpoint and our exception can be triggered. Now it will ignore it as it has a value.
No description provided.