parent
3751e27288
commit
129c751cb4
|
@ -8,8 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import static org.springframework.web.bind.annotation.RequestMethod.POST;
|
|
||||||
|
|
||||||
@Log
|
@Log
|
||||||
@Controller
|
@Controller
|
||||||
|
@ -18,7 +17,7 @@ public class ChargeController {
|
||||||
@Autowired
|
@Autowired
|
||||||
StripeService paymentsService;
|
StripeService paymentsService;
|
||||||
|
|
||||||
@RequestMapping(value = "/charge", method = POST)
|
@PostMapping("/charge")
|
||||||
public String charge(ChargeRequest chargeRequest, Model model) throws StripeException {
|
public String charge(ChargeRequest chargeRequest, Model model) throws StripeException {
|
||||||
chargeRequest.setDescription("Example charge");
|
chargeRequest.setDescription("Example charge");
|
||||||
chargeRequest.setCurrency(Currency.EUR);
|
chargeRequest.setCurrency(Currency.EUR);
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
package com.baeldung.stripe;
|
package com.baeldung.stripe;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Data;
|
||||||
import lombok.Setter;
|
|
||||||
import lombok.ToString;
|
|
||||||
|
|
||||||
@Getter
|
@Data
|
||||||
@Setter
|
|
||||||
@ToString(includeFieldNames = false)
|
|
||||||
public class ChargeRequest {
|
public class ChargeRequest {
|
||||||
|
|
||||||
public enum Currency {
|
public enum Currency {
|
||||||
|
|
Loading…
Reference in New Issue