Class DefaultNDCPaymentFacade
java.lang.Object
de.hybris.platform.ndc182shoppingfacades.facades.order.impl.DefaultNDCPaymentFacade
- All Implemented Interfaces:
NDCPaymentFacade
The ndc 18.2 implementation of
NDCPaymentFacade interface.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreatePaymentTransaction(AbstractOrderModel order, List<AbstractOrderEntryModel> orderEntries, BigDecimal paymentInfoAmount, boolean isPayLater) Create payment transactions from ndc offer data list.voidcreatePaymentTransactionsFromPaymentInfoNdcOfferDataAssociations(AbstractOrderModel order, List<NDCOfferData> ndcOfferDataList, List<String> offerIdsAssociation, BigDecimal paymentInfoAmount) Creates payment transactions.protected de.hybris.platform.order.CartServiceGets cart service.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,RetrieveOrderEntryStrategy> Gets retrieve order entry strategy map.voidpopulatePaymentInfo(AbstractOrderModel order, NDCPaymentCardInfoData ndcPaymentCardInfoData) Creates the creditCardPaymentInfo based on the information contained in the paymentInfos and set the paymentInfo in the order.voidsetCartService(de.hybris.platform.order.CartService cartService) Sets cart service.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.voidsetRetrieveOrderEntryStrategyMap(Map<String, RetrieveOrderEntryStrategy> retrieveOrderEntryStrategyMap) Sets retrieve order entry strategy map.voidvalidateTotalOrderAmountAgainstPaymentInfo(AbstractOrderModel order, BigDecimal totalPaymentInfoAmount) Validates the total amount of the order against the paymentInfos.
-
Constructor Details
-
DefaultNDCPaymentFacade
public DefaultNDCPaymentFacade()
-
-
Method Details
-
createPaymentTransactionsFromPaymentInfoNdcOfferDataAssociations
public void createPaymentTransactionsFromPaymentInfoNdcOfferDataAssociations(AbstractOrderModel 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(AbstractOrderModel 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(AbstractOrderModel 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
-
getMaskedCardNumber
Gets masked card number.- Parameters:
cardNumber- the card number- Returns:
- masked card number
-
createPaymentTransaction
public void createPaymentTransaction(AbstractOrderModel 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
-
getCartService
protected de.hybris.platform.order.CartService getCartService()Gets cart service.- Returns:
- the cart service
-
setCartService
public void setCartService(de.hybris.platform.order.CartService cartService) Sets cart service.- Parameters:
cartService- the cart service
-
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
-
getRetrieveOrderEntryStrategyMap
Gets retrieve order entry strategy map.- Returns:
- the retrieve order entry strategy map
-
setRetrieveOrderEntryStrategyMap
public void setRetrieveOrderEntryStrategyMap(Map<String, RetrieveOrderEntryStrategy> retrieveOrderEntryStrategyMap) Sets retrieve order entry strategy map.- Parameters:
retrieveOrderEntryStrategyMap- the retrieve order entry strategy map
-