Class DefaultOrderCreatePaymentTransactionHandler
java.lang.Object
de.hybris.platform.ndc182facades.facades.order.handlers.impl.DefaultOrderCreatePaymentTransactionHandler
- All Implemented Interfaces:
OrderCreateHandler
public class DefaultOrderCreatePaymentTransactionHandler
extends Object
implements OrderCreateHandler
The ndc 18.2 implementation of of
OrderCreateHandler interface.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreatePaymentTransactionsFromNdcOfferDataMap(Map<String, List<NDCOfferData>> ndcOfferDataMap, OrderModel order, List<PaymentInfoType> paymentInfos) Creates a payment transaction list from ndcOfferDataMap.protected de.hybris.platform.servicelayer.model.ModelServiceGets model service.protected NDCOrderServiceGets ndc order service.protected NDCPaymentFacadeGets ndc payment facade.voidhandle(Map<String, List<NDCOfferData>> ndcOfferDataMap, OrderModel order, IATAOrderCreateRQ orderCreateRQ) This handler creates the payment transactions and link the order entries to them.voidsetModelService(de.hybris.platform.servicelayer.model.ModelService modelService) Sets model service.voidsetNdcOrderService(NDCOrderService ndcOrderService) Sets ndc order service.voidsetNdcPaymentFacade(NDCPaymentFacade ndcPaymentFacade) Sets ndc payment facade.
-
Constructor Details
-
DefaultOrderCreatePaymentTransactionHandler
public DefaultOrderCreatePaymentTransactionHandler()
-
-
Method Details
-
handle
public void handle(Map<String, List<NDCOfferData>> ndcOfferDataMap, OrderModel order, IATAOrderCreateRQ orderCreateRQ) throws NDCExceptionThis handler creates the payment transactions and link the order entries to them. 1) Retrieves all the empty payment transactions and remove them from the order. 2) If the list of paymentInfos is empty, creates an empty transaction and links all the order entries to it. Otherwise, create one payment transaction for each paymentInfo in the list. 3) Validates the payment transactions against the total amount of the order and the amount of the order entries associated to each of them.- Specified by:
handlein interfaceOrderCreateHandler- Parameters:
ndcOfferDataMap- the ndcOfferDataMaporder- the orderorderCreateRQ- the orderCreateRQ- Throws:
NDCException
-
createPaymentTransactionsFromNdcOfferDataMap
protected void createPaymentTransactionsFromNdcOfferDataMap(Map<String, List<NDCOfferData>> ndcOfferDataMap, OrderModel order, List<PaymentInfoType> paymentInfos) throws NDCExceptionCreates a payment transaction list from ndcOfferDataMap. For each payment info, filter the ndcOfferData linked to that payment and create a payment transaction associated to them.- Parameters:
ndcOfferDataMap- the map of NDCOfferData class type and list of NdcOfferData of that type. NDCCarrierOfferData - NDCAlaCarteOfferData.order- the orderpaymentInfos- the payment infos- Throws:
NDCException
-
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
-
getNdcOrderService
Gets ndc order service.- Returns:
- the ndc order service
-
setNdcOrderService
Sets ndc order service.- Parameters:
ndcOrderService- the ndc order service
-
getNdcPaymentFacade
Gets ndc payment facade.- Returns:
- the ndc payment facade
-
setNdcPaymentFacade
Sets ndc payment facade.- Parameters:
ndcPaymentFacade- the ndc payment facade
-