diff --git a/stripe/src/main/java/com/baeldung/stripe/ChargeController.java b/stripe/src/main/java/com/baeldung/stripe/ChargeController.java index cd3f057cd8..d609f48fb7 100644 --- a/stripe/src/main/java/com/baeldung/stripe/ChargeController.java +++ b/stripe/src/main/java/com/baeldung/stripe/ChargeController.java @@ -8,8 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.RequestMapping; -import static org.springframework.web.bind.annotation.RequestMethod.POST; +import org.springframework.web.bind.annotation.PostMapping; @Log @Controller @@ -18,7 +17,7 @@ public class ChargeController { @Autowired StripeService paymentsService; - @RequestMapping(value = "/charge", method = POST) + @PostMapping("/charge") public String charge(ChargeRequest chargeRequest, Model model) throws StripeException { chargeRequest.setDescription("Example charge"); chargeRequest.setCurrency(Currency.EUR); diff --git a/stripe/src/main/java/com/baeldung/stripe/ChargeRequest.java b/stripe/src/main/java/com/baeldung/stripe/ChargeRequest.java index 76cdea7bb4..a5c056b659 100644 --- a/stripe/src/main/java/com/baeldung/stripe/ChargeRequest.java +++ b/stripe/src/main/java/com/baeldung/stripe/ChargeRequest.java @@ -1,12 +1,8 @@ package com.baeldung.stripe; -import lombok.Getter; -import lombok.Setter; -import lombok.ToString; +import lombok.Data; -@Getter -@Setter -@ToString(includeFieldNames = false) +@Data public class ChargeRequest { public enum Currency {