Package com.dzidzi.api
Interface PaymentApi
public interface PaymentApi
PaymentApi contains all the api operations handling
Payment in the DzidziApp.-
Method Summary
Modifier and TypeMethodDescriptioncreatePaymentCheckoutSession(UUID orderId) Creates a payment checkout session for the user to make a payment for an order.createTipPaymentCheckoutSession(UUID orderId, BigDecimal amount) Creates a payment checkout session for the user to make a payment for a tip on an order.findPaymentsByStatus(PaymentStatus status) Finds payments byPaymentStatus.getPaymentById(UUID paymentId) Finds a payment by the given payment id.getPaymentByOrderId(UUID orderId) Finds a payment by the given order id.getPaymentByPaymentIntentId(String intentId) Finds a payment by the given intent id.voidhandlePaymentWebhook(String payload, String signature) This handles the payment status sent by stripe webhook.
-
Method Details
-
getPaymentById
Finds a payment by the given payment id.- Parameters:
paymentId- the id of the payment- Returns:
- the payment found
-
getPaymentByOrderId
Finds a payment by the given order id.- Parameters:
orderId- the id of the order- Returns:
- the payment found
-
getPaymentByPaymentIntentId
Finds a payment by the given intent id.- Parameters:
intentId- the id of the payment intent- Returns:
- the payment found
-
findPaymentsByStatus
Finds payments byPaymentStatus.- Parameters:
status- the status- Returns:
- the payments found
-
handlePaymentWebhook
This handles the payment status sent by stripe webhook.- Parameters:
payload- the payload of the payment from stripesignature- the signature of the webhook
-
createPaymentCheckoutSession
Creates a payment checkout session for the user to make a payment for an order.- Parameters:
orderId- the id of the order to pay for- Returns:
- the payment session url
-
createTipPaymentCheckoutSession
Creates a payment checkout session for the user to make a payment for a tip on an order.- Parameters:
orderId- the id of the order to make the tipamount- the amount to tip the courier- Returns:
- the payment session url
-