Interface NDCPaymentService

All Known Implementing Classes:
DefaultNDCPaymentService

public interface NDCPaymentService
Interface exposing methods involved in handling payment information and payment transactions of a given order
  • Method Details

    • removeEmptyPaymentTransactions

      void removeEmptyPaymentTransactions(OrderModel order)
      Retrieves all the empty payment transactions from the order and remove them.
      Parameters:
      order - the order
    • createPaymentTransaction

      void createPaymentTransaction(OrderModel order, List<AbstractOrderEntryModel> orderEntries, BigDecimal paymentInfoAmount, boolean isPayLater) throws NDCException
      Create payment transactions from ndc offer data list.
      Parameters:
      order - the order
      orderEntries - the order entries
      paymentInfoAmount - the payment info amount
      isPayLater - true if orderCreate RQ does not have any payment info.
      Throws:
      NDCException - the ndc exception
    • isOriginalOrderPaid

      boolean isOriginalOrderPaid(OrderModel order)
      Verifies if the contains payment transactions. If yes, the order has already been payed.
      Parameters:
      order - the order
      Returns:
      true if the list of payment transaction is not empty.
    • validateTotalorderAmountAgainstPaymentInfo

      void validateTotalorderAmountAgainstPaymentInfo(OrderModel order, BigDecimal totalPaymentInfoAmount) throws NDCException
      Validates the total amount of the order against the paymentInfos. Checks if there are orderEntries that are not linked to any paymentTransactions.
      Parameters:
      order - the order
      totalPaymentInfoAmount - the totalPaymentInfoAmount
      Throws:
      NDCException - the ndc exception
    • validateOrderTotalAgainstTotalAmountPaymentInfos

      boolean validateOrderTotalAgainstTotalAmountPaymentInfos(BigDecimal totalAmountOrder, BigDecimal totalAmountPaymentInfos)
      Validates if the total price of the order to place is equal to the total amount of all the payment infos provided.
      Parameters:
      totalAmountOrder - the total price of the order
      totalAmountPaymentInfos - the total price of all the payment infos
      Returns:
      true if the totals are equal
    • isAnyOrderEntryWithoutPaymentTransaction

      boolean isAnyOrderEntryWithoutPaymentTransaction(OrderModel order)
      Checks if there is at least one order entries in the order which has been not associated to any payment transaction.
      Parameters:
      order - the order
      Returns:
      true if the order contains any order entries with no payment transaction.