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 Summary
Modifier and TypeMethodDescriptionvoidcreatePaymentTransaction(OrderModel order, List<AbstractOrderEntryModel> orderEntries, BigDecimal paymentInfoAmount, boolean isPayLater) Create payment transactions from ndc offer data list.booleanChecks if there is at least one order entries in the order which has been not associated to any payment transaction.booleanisOriginalOrderPaid(OrderModel order) Verifies if the contains payment transactions.voidRetrieves all the empty payment transactions from the order and remove them.booleanvalidateOrderTotalAgainstTotalAmountPaymentInfos(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.voidvalidateTotalorderAmountAgainstPaymentInfo(OrderModel order, BigDecimal totalPaymentInfoAmount) Validates the total amount of the order against the paymentInfos.
-
Method Details
-
removeEmptyPaymentTransactions
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 orderorderEntries- the order entriespaymentInfoAmount- the payment info amountisPayLater- true if orderCreate RQ does not have any payment info.- Throws:
NDCException- the ndc exception
-
isOriginalOrderPaid
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 ordertotalPaymentInfoAmount- 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 ordertotalAmountPaymentInfos- the total price of all the payment infos- Returns:
- true if the totals are equal
-
isAnyOrderEntryWithoutPaymentTransaction
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.
-