Skip to content

Instantly share code, notes, and snippets.

@NajeebArif
Created June 10, 2021 21:25
Show Gist options
  • Save NajeebArif/6ef797df5263ecb4a6d39c1dfabb0cda to your computer and use it in GitHub Desktop.
Save NajeebArif/6ef797df5263ecb4a6d39c1dfabb0cda to your computer and use it in GitHub Desktop.
//...
private String orderId = "";
@GetMapping
public String orderPage(Model model){
model.addAttribute("orderId",orderId);
return "order";
}
@GetMapping("/capture")
public String captureOrder(@RequestParam String token){
//FIXME(Never Do this either put it in proper scope or in DB)
orderId = token;
paymentService.captureOrder(token);
return "redirect:/orders";
}
//...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment