Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//...
@GetMapping("/capture")
public String captureOrder(){
return "";
}
@PostMapping
public String placeOrder(@RequestParam Double amountId, HttpServletRequest request){
final URI returnUrl = buildReturnUrl(request);
return "";
}
private URI buildReturnUrl(HttpServletRequest request) {
try {
URI requestUri = URI.create(request.getRequestURL().toString());
return new URI(requestUri.getScheme(),
requestUri.getUserInfo(),
requestUri.getHost(),
requestUri.getPort(),
"/orders/capture",
null, null);
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
}
//...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment