Created
June 10, 2021 21:11
-
-
Save NajeebArif/0a17d7e324a35362fe94ad830f5aa998 to your computer and use it in GitHub Desktop.
This file contains 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
//... | |
@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