Interface NDCPaymentFacade
- All Known Implementing Classes:
DefaultNDCPaymentFacade
public interface NDCPaymentFacade
The ndc 18.2 Payment Facade interface.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcreatePaymentTransaction(OrderModel order, List<AbstractOrderEntryModel> orderEntries, BigDecimal paymentInfoAmount, boolean isPayLater) Create payment transactions from ndc offer data list.voidcreatePaymentTransactionsFromPaymentInfoNdcOfferDataAssociations(OrderModel order, List<NDCOfferData> ndcOfferDataList, List<String> offerIdsAssociation, BigDecimal paymentInfoAmount) Create payment transactions from payment info ndc offer data associations.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.voidpopulatePaymentInfo(OrderModel order, NDCPaymentCardInfoData ndcPaymentCardInfoData) Creates the creditCardPaymentInfo based on the information contained in the paymentInfos and set the paymentInfo in the order.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
-
createPaymentTransactionsFromPaymentInfoNdcOfferDataAssociations
void createPaymentTransactionsFromPaymentInfoNdcOfferDataAssociations(OrderModel order, List<NDCOfferData> ndcOfferDataList, List<String> offerIdsAssociation, BigDecimal paymentInfoAmount) throws NDCException Create payment transactions from payment info ndc offer data associations.- Parameters:
order- the orderndcOfferDataList- the ndc offer data listofferIdsAssociation- the offer ids associationpaymentInfoAmount- the payment info amount- Throws:
NDCException- the ndc exception
-
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
-
populatePaymentInfo
void populatePaymentInfo(OrderModel order, NDCPaymentCardInfoData ndcPaymentCardInfoData) throws NDCException Creates the creditCardPaymentInfo based on the information contained in the paymentInfos and set the paymentInfo in the order.- Parameters:
order- the order- 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.
-
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.
-