parent
3751e27288
commit
129c751cb4
|
@ -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);
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue