Skip to content

Instantly share code, notes, and snippets.

@NajeebArif
Last active June 10, 2021 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NajeebArif/6eaf5c377db77244328ef3abd1adc9c0 to your computer and use it in GitHub Desktop.
Save NajeebArif/6eaf5c377db77244328ef3abd1adc9c0 to your computer and use it in GitHub Desktop.
//...
private final PaymentService paymentService;
public OrderController(PaymentService paymentService) {
this.paymentService = paymentService;
}
@PostMapping
public String placeOrder(@RequestParam Double totalAmount, HttpServletRequest request){
final URI returnUrl = buildReturnUrl(request);
CreatedOrder createdOrder = paymentService.createOrder(totalAmount, returnUrl);
return "";
}
//...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment