Interface PaymentApi


public interface PaymentApi
PaymentApi contains all the api operations handling Payment in the DzidziApp.
  • Method Details

    • getPaymentById

      Payment getPaymentById(UUID paymentId)
      Finds a payment by the given payment id.
      Parameters:
      paymentId - the id of the payment
      Returns:
      the payment found
    • getPaymentByOrderId

      Payment getPaymentByOrderId(UUID orderId)
      Finds a payment by the given order id.
      Parameters:
      orderId - the id of the order
      Returns:
      the payment found
    • getPaymentByPaymentIntentId

      Payment getPaymentByPaymentIntentId(String intentId)
      Finds a payment by the given intent id.
      Parameters:
      intentId - the id of the payment intent
      Returns:
      the payment found
    • findPaymentsByStatus

      List<Payment> findPaymentsByStatus(PaymentStatus status)
      Finds payments by PaymentStatus.
      Parameters:
      status - the status
      Returns:
      the payments found
    • handlePaymentWebhook

      void handlePaymentWebhook(String payload, String signature)
      This handles the payment status sent by stripe webhook.
      Parameters:
      payload - the payload of the payment from stripe
      signature - the signature of the webhook
    • createPaymentCheckoutSession

      String createPaymentCheckoutSession(UUID orderId)
      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

      String createTipPaymentCheckoutSession(UUID orderId, BigDecimal amount)
      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 tip
      amount - the amount to tip the courier
      Returns:
      the payment session url