File tree Expand file tree Collapse file tree
stripe/src/main/java/com/baeldung/stripe Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88import org .springframework .stereotype .Controller ;
99import org .springframework .ui .Model ;
1010import org .springframework .web .bind .annotation .ExceptionHandler ;
11- import org .springframework .web .bind .annotation .RequestMapping ;
12- import static org .springframework .web .bind .annotation .RequestMethod .POST ;
11+ import org .springframework .web .bind .annotation .PostMapping ;
1312
1413@ Log
1514@ Controller
@@ -18,7 +17,7 @@ public class ChargeController {
1817 @ Autowired
1918 StripeService paymentsService ;
2019
21- @ RequestMapping ( value = "/charge" , method = POST )
20+ @ PostMapping ( "/charge" )
2221 public String charge (ChargeRequest chargeRequest , Model model ) throws StripeException {
2322 chargeRequest .setDescription ("Example charge" );
2423 chargeRequest .setCurrency (Currency .EUR );
Original file line number Diff line number Diff line change 11package com .baeldung .stripe ;
22
3- import lombok .Getter ;
4- import lombok .Setter ;
5- import lombok .ToString ;
3+ import lombok .Data ;
64
7- @ Getter
8- @ Setter
9- @ ToString (includeFieldNames = false )
5+ @ Data
106public class ChargeRequest {
117
128 public enum Currency {
You can’t perform that action at this time.
0 commit comments