Interface PaymentClient
@FeignClient(name="payment-service",
url="${payment-service.url}")
public interface PaymentClient
Feign client for interacting with the Payment Service.
- Author:
- Kristian Popov
-
Method Summary
Modifier and TypeMethodDescriptioncreatePaymentIntent(PaymentRequest request) Create a new Payment Intent.getPaymentIntent(String paymentIntentId) Reads a payment intent back from the payment service.
-
Method Details
-
createPaymentIntent
@PostMapping("/api/payment/create") PaymentResponse createPaymentIntent(@RequestBody PaymentRequest request) Create a new Payment Intent.- Parameters:
request- PaymentRequest- Returns:
- PaymentResponse
-
getPaymentIntent
@GetMapping("/api/payment/{paymentIntentId}") PaymentIntentResponse getPaymentIntent(@PathVariable("paymentIntentId") String paymentIntentId) Reads a payment intent back from the payment service.This is the only trustworthy statement about whether money moved. The
redirect_statuson the browser return URL is supplied by the user agent and must never be used to decide that a payment succeeded.- Parameters:
paymentIntentId- The intent id returned when the intent was created.- Returns:
- The intent as the payment provider sees it.
-