Class DefaultNDCPaymentFacade
java.lang.Object
de.hybris.platform.ndc182facades.facades.order.impl.DefaultNDCPaymentFacade
- All Implemented Interfaces:
NDCPaymentFacade
The ndc 18.2 implementation of
NDCPaymentFacade interface.-
Constructor Summary
Constructors -
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) Creates payment transactions.protected de.hybris.platform.commerceservices.order.CommerceCardTypeServiceGets commerce card type service.protected StringgetMaskedCardNumber(String cardNumber) Gets masked card number.protected de.hybris.platform.servicelayer.model.ModelServiceGets model service.protected NDCOrderServiceGets ndc order service.protected NDCPaymentServiceGets model service.protected Map<String,OrderCreatePaymentTransactionStrategy> Gets order create payment transaction strategy map.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.voidsetCommerceCardTypeService(de.hybris.platform.commerceservices.order.CommerceCardTypeService commerceCardTypeService) Sets commerce card type service.voidsetModelService(de.hybris.platform.servicelayer.model.ModelService modelService) Sets model service.voidsetNdcOrderService(NDCOrderService ndcOrderService) Sets ndc order service.voidsetNdcPaymentService(NDCPaymentService ndcPaymentService) Sets payment service.voidsetOrderCreatePaymentTransactionStrategyMap(Map<String, OrderCreatePaymentTransactionStrategy> orderCreatePaymentTransactionStrategyMap) Sets order create payment transaction strategy map.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.
-
Constructor Details
-
DefaultNDCPaymentFacade
public DefaultNDCPaymentFacade()
-
-
Method Details
-
createPaymentTransactionsFromPaymentInfoNdcOfferDataAssociations
public void createPaymentTransactionsFromPaymentInfoNdcOfferDataAssociations(OrderModel order, List<NDCOfferData> ndcOfferDataList, List<String> offerIdsAssociation, BigDecimal paymentInfoAmount) throws NDCException Creates payment transactions. 1) If the paymentInfo doesn't contain an offerId, it will create a paymentTransaction associated to the total of the order and to all the order entries. 2) Collects all the order entries related to the associated offers of the paymentinfo, validates the total amount against their total price and if it is valid, creates a payment transaction linked to them. Note: If the order has not been payed, the transaction will be linked to all the order entries.- Specified by:
createPaymentTransactionsFromPaymentInfoNdcOfferDataAssociationsin interfaceNDCPaymentFacade- Parameters:
order- the orderndcOfferDataList- the ndc offer data listofferIdsAssociation- the offer ids associationpaymentInfoAmount- the payment info amount- Throws:
NDCException- the ndc exception
-
validateTotalorderAmountAgainstPaymentInfo
public void validateTotalorderAmountAgainstPaymentInfo(OrderModel order, BigDecimal totalPaymentInfoAmount) throws NDCException Description copied from interface:NDCPaymentFacadeValidates the total amount of the order against the paymentInfos. Checks if there are orderEntries that are not linked to any paymentTransactions.- Specified by:
validateTotalorderAmountAgainstPaymentInfoin interfaceNDCPaymentFacade- Parameters:
order- the ordertotalPaymentInfoAmount- the totalPaymentInfoAmount- Throws:
NDCException- the ndc exception
-
populatePaymentInfo
public 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.- Specified by:
populatePaymentInfoin interfaceNDCPaymentFacade- Parameters:
order- the orderndcPaymentCardInfoData- the ndcPaymentCardInfoData- Throws:
NDCException- the ndc exception
-
validateOrderTotalAgainstTotalAmountPaymentInfos
public boolean validateOrderTotalAgainstTotalAmountPaymentInfos(BigDecimal totalAmountOrder, BigDecimal totalAmountPaymentInfos) Description copied from interface:NDCPaymentFacadeValidates if the total price of the order to place is equal to the total amount of all the payment infos provided.- Specified by:
validateOrderTotalAgainstTotalAmountPaymentInfosin interfaceNDCPaymentFacade- Parameters:
totalAmountOrder- the total price of the ordertotalAmountPaymentInfos- the total price of all the payment infos- Returns:
- true if the totals are equal
-
isAnyOrderEntryWithoutPaymentTransaction
Description copied from interface:NDCPaymentFacadeChecks if there is at least one order entries in the order which has been not associated to any payment transaction.- Specified by:
isAnyOrderEntryWithoutPaymentTransactionin interfaceNDCPaymentFacade- Parameters:
order- the order- Returns:
- true if the order contains any order entries with no payment transaction.
-
getMaskedCardNumber
Gets masked card number.- Parameters:
cardNumber- the card number- Returns:
- masked card number
-
removeEmptyPaymentTransactions
Description copied from interface:NDCPaymentFacadeRetrieves all the empty payment transactions from the order and remove them.- Specified by:
removeEmptyPaymentTransactionsin interfaceNDCPaymentFacade- Parameters:
order- the order
-
createPaymentTransaction
public void createPaymentTransaction(OrderModel order, List<AbstractOrderEntryModel> orderEntries, BigDecimal paymentInfoAmount, boolean isPayLater) throws NDCException Description copied from interface:NDCPaymentFacadeCreate payment transactions from ndc offer data list.- Specified by:
createPaymentTransactionin interfaceNDCPaymentFacade- 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
Description copied from interface:NDCPaymentFacadeVerifies if the contains payment transactions. If yes, the order has already been payed.- Specified by:
isOriginalOrderPaidin interfaceNDCPaymentFacade- Parameters:
order- the order- Returns:
- true if the list of payment transaction is not empty.
-
getOrderCreatePaymentTransactionStrategyMap
protected Map<String,OrderCreatePaymentTransactionStrategy> getOrderCreatePaymentTransactionStrategyMap()Gets order create payment transaction strategy map.- Returns:
- the order create payment transaction strategy map
-
setOrderCreatePaymentTransactionStrategyMap
public void setOrderCreatePaymentTransactionStrategyMap(Map<String, OrderCreatePaymentTransactionStrategy> orderCreatePaymentTransactionStrategyMap) Sets order create payment transaction strategy map.- Parameters:
orderCreatePaymentTransactionStrategyMap- the order create payment transaction strategy map
-
getModelService
protected de.hybris.platform.servicelayer.model.ModelService getModelService()Gets model service.- Returns:
- the model service
-
setModelService
public void setModelService(de.hybris.platform.servicelayer.model.ModelService modelService) Sets model service.- Parameters:
modelService- the model service
-
getCommerceCardTypeService
protected de.hybris.platform.commerceservices.order.CommerceCardTypeService getCommerceCardTypeService()Gets commerce card type service.- Returns:
- the commerce card type service
-
setCommerceCardTypeService
public void setCommerceCardTypeService(de.hybris.platform.commerceservices.order.CommerceCardTypeService commerceCardTypeService) Sets commerce card type service.- Parameters:
commerceCardTypeService- the commerce card type service
-
getNdcPaymentService
Gets model service.- Returns:
- the payment service
-
setNdcPaymentService
Sets payment service.- Parameters:
ndcPaymentService- the payment service
-
getNdcOrderService
Gets ndc order service.- Returns:
- the ndc order service
-
setNdcOrderService
Sets ndc order service.- Parameters:
ndcOrderService- the ndc order service
-