Class DefaultNDCOrderFacade
java.lang.Object
de.hybris.platform.ndc182shoppingfacades.facades.order.impl.DefaultNDCOrderFacade
- All Implemented Interfaces:
NDCOrderFacade
The ndc 18.2 implementation of
NDCOrderFacade interface.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddBookingActionForAmendAncillary(List<NDCBookingActionType> ndcBookingActionTypeList, UpdateOrderItemType updateOrderItem, boolean containsAlaCarteOfferItem) Add booking action for amend ancillary.protected voidaddBookingActionForRemoveAncillary(List<NDCBookingActionType> ndcBookingActionTypeList, UpdateOrderItemType updateOrderItem) Add booking action for remove ancillary.protected voidaddBookingActionForUpdatePassenger(List<NDCBookingActionType> ndcBookingActionTypeList, UpdateOrderItemType updateOrderItem, boolean containsAlaCarteOfferItem) Add booking action for update passenger.protected voidamendOrder(IATAOrderChangeRQ orderChangeRQ, List<NDCBookingActionType> ndcBookingActionTypeList, CartModel amendmentCart, List<AbstractOrderEntryModel> orderEntries) This method validates the booking action list and amends the order.protected BigDecimalcalculateTotalToPay(AbstractOrderModel abstractOrderModel) Calculates difference between old total and amended total to know how much user should pay (or how much they should be refunded)ordercancelresponse.IATAOrderCancelRScancelOrder(ordercancelrequest.IATAOrderCancelRQ orderCancelRQ) Cancel order iata order cancel rs.changeOrder(IATAOrderChangeRQ orderChangeRQ) Retrieves the original order and calculates the difference between this and the new one and places the amended order.protected BookingActionRequestDatacreateBookingActionRequestData(List<NDCBookingActionType> ndcBookingActionDataList, OrderModel orderModel) Create booking action request data.protected ordercancelresponse.MarketingMessageTypeCreate marketing message for order cancel response marketing message type.protected Map<String,List<NDCOfferData>> createNdcOfferDataMap(IATAOrderCreateRQ orderCreateRQ) Create ndc offer data map.createOrder(IATAOrderCreateRQ orderCreateRQ) Creates an order from an OrderCreateRQ message.protected ordercancelresponse.IATAOrderCancelRScreateOrderCancelResponse(String orderID) Create order cancel response iata order cancel rs.protected ActionFacadeGets action facade.protected BookingServicegets booking serviceprotected de.hybris.platform.servicelayer.config.ConfigurationServiceGets configuration service.protected CreateCartPipelineManagerGets order create pipeline manager.protected de.hybris.platform.servicelayer.model.ModelServiceGets model service.protected Map<NDCBookingActionType,ActionTypeOption> Gets ndc booking action map.protected Map<NDCBookingActionType,ChangeOrderStrategy> Gets ndc booking action strategy map.protected List<NDCBookingActionType>getNDCBookingActionTypes(IATAOrderChangeRQ orderChangeRQ) Create ndc booking action data list.protected NDCCheckoutFacadeGets ndc checkout facade.protected CreatePaymentTransactionSrategyGets ndc create payment transaction strategy.protected NDCOfferFacadeGets ndc offer facade.protected NDCPaymentFacadeGets ndc payment facade.protected NDCPaymentServiceGets ndc payment service.protected NDCShoppingMerchandisingFacadeGets ndc shopping merchandising facade.protected OrderModelgetOrderByBookingReference(String bookingReference) Retrieves an order based on the bookingReference number and the current user, Error field in the response is populated in case the booking was not place by the current userprotected Map<String,OrderCreateRequestValidationStrategy> Gets order create request validation strategy map.protected OrderViewPipelineManagergets order view pipeline managerprotected ReservationFacadeGets reservation facade.protected ShoppingBookingFacadeGets shopping booking facade.protected ShoppingTravelCartFacadeGets shopping travel cart facade.protected de.hybris.platform.commercefacades.storesession.StoreSessionFacadeGets store session facade.protected TravelCartServiceGets travel cart service.protected de.hybris.platform.servicelayer.user.UserServiceGets user service.protected booleanisOrderPaid(OrderModel originalOrder) Checks if the order is paid.protected IATAOrderViewRSpayOrder(OrderModel originalOrder, IATAOrderChangeRQ orderChangeRQ, CartModel amendmentCart) Pay order.protected OrderModelplaceOrder(IATAOrderChangeRQ orderChangeRQ, CartModel amendmentCart) Place an order from amendment cart.protected voidpopulateNDCPaymentCardInfoData(NDCPaymentCardInfoData ndcPaymentCardInfo, IATAOrderChangeRQ orderChangeRQ) Populate ndc payment card info data.retrieveOrder(IATAOrderRetrieveRQ orderRetrieveRQ) Retrieves the order from the booking reference specified in the OrderRetrieveRQ.voidsetActionFacade(ActionFacade actionFacade) Sets action facade.voidsetBookingService(BookingService bookingService) sets booking servicevoidsetConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService) Sets configuration service.voidsetCreateCartPipelineManager(CreateCartPipelineManager createCartPipelineManager) Sets order create pipeline manager.protected voidsetCurrencyInSession(IATAOrderCreateRQ orderCreateRQ) Sets currency in session if it is present at least one currency code in a paymentInfo.voidsetModelService(de.hybris.platform.servicelayer.model.ModelService modelService) Sets model service.voidsetNdcBookingActionMap(Map<NDCBookingActionType, ActionTypeOption> ndcBookingActionMap) Sets ndc booking action map.voidsetNdcBookingActionStrategyMap(Map<NDCBookingActionType, ChangeOrderStrategy> ndcBookingActionStrategyMap) Sets ndc booking action strategy map.voidsetNdcCheckoutFacade(NDCCheckoutFacade ndcCheckoutFacade) Sets ndc checkout facade.voidsetNdcCreatePaymentTransactionStrategy(CreatePaymentTransactionSrategy ndcCreatePaymentTransactionStrategy) Sets ndc create payment transaction strategy.voidsetNdcOfferFacade(NDCOfferFacade ndcOfferFacade) Sets ndc offer facade.voidsetNdcPaymentFacade(NDCPaymentFacade ndcPaymentFacade) Sets ndc payment facade.voidsetNdcPaymentService(NDCPaymentService ndcPaymentService) Sets ndc payment service.voidsetNdcShoppingMerchandisingFacade(NDCShoppingMerchandisingFacade ndcShoppingMerchandisingFacade) Sets ndc shopping merchandising facade.voidsetOrderCreateRequestValidationStrategyMap(Map<String, OrderCreateRequestValidationStrategy> orderCreateRequestValidationStrategyMap) Sets order create request validation strategy map.voidsetOrderViewPipelineManager(OrderViewPipelineManager orderViewPipelineManager) sets order view pipeline managervoidsetReservationFacade(ReservationFacade reservationFacade) Sets reservation facade.voidsetShoppingBookingFacade(ShoppingBookingFacade shoppingBookingFacade) Sets shopping booking facade.voidsetShoppingTravelCartFacade(ShoppingTravelCartFacade shoppingTravelCartFacade) Sets shopping travel cart facade.voidsetStoreSessionFacade(de.hybris.platform.commercefacades.storesession.StoreSessionFacade storeSessionFacade) Sets store session facade.voidsetTravelCartService(TravelCartService travelCartService) Sets travel cart service.voidsetUserService(de.hybris.platform.servicelayer.user.UserService userService) Sets user service.protected voidvalidateAmendmentCart(IATAOrderChangeRQ orderChangeRQ, List<AbstractOrderEntryModel> orderEntries, CartModel amendmentCart) Validates the amended cart: compares if the total amount of the paymentInfos in the orderChangeRQ is equal to the total amount of the amended cart entries.protected voidvalidateCurrencyForOrderChange(IATAOrderChangeRQ orderChangeRQ, OrderModel originalOrder) Validate currency.protected voidvalidateNDCOffers(Map<String, List<NDCOfferData>> ndcOfferDataMap, IATAOrderCreateRQ orderCreateRQ) Validate ndc offers.
-
Constructor Details
-
DefaultNDCOrderFacade
public DefaultNDCOrderFacade()
-
-
Method Details
-
createOrder
public IATAOrderViewRS createOrder(IATAOrderCreateRQ orderCreateRQ) throws NDCException, MerchandisingRequestException Description copied from interface:NDCOrderFacadeCreates an order from an OrderCreateRQ message.- Specified by:
createOrderin interfaceNDCOrderFacade- Parameters:
orderCreateRQ- the orderCreateRQ- Returns:
- the orderViewRS
- Throws:
NDCExceptionMerchandisingRequestException
-
changeOrder
public IATAOrderViewRS changeOrder(IATAOrderChangeRQ orderChangeRQ) throws NDCException, MerchandisingRequestException Description copied from interface:NDCOrderFacadeRetrieves the original order and calculates the difference between this and the new one and places the amended order.- Specified by:
changeOrderin interfaceNDCOrderFacade- Parameters:
orderChangeRQ- the orderChangeRQ- Returns:
- the orderViewRS
- Throws:
NDCException- the ndc exceptionMerchandisingRequestException
-
retrieveOrder
Retrieves the order from the booking reference specified in the OrderRetrieveRQ.- Specified by:
retrieveOrderin interfaceNDCOrderFacade- Parameters:
orderRetrieveRQ- the orderRetrieveRQ- Returns:
- the orderViewRS
- Throws:
NDCException- the ndc exception
-
cancelOrder
public ordercancelresponse.IATAOrderCancelRS cancelOrder(ordercancelrequest.IATAOrderCancelRQ orderCancelRQ) throws NDCException Description copied from interface:NDCOrderFacadeCancel order iata order cancel rs.- Specified by:
cancelOrderin interfaceNDCOrderFacade- Parameters:
orderCancelRQ- the order cancel rq- Returns:
- the iata order cancel rs
- Throws:
NDCException- the ndc exception
-
createOrderCancelResponse
Create order cancel response iata order cancel rs.- Parameters:
orderID- the order id- Returns:
- the iata order cancel rs
-
createMarketingMessageForOrderCancelResponse
protected ordercancelresponse.MarketingMessageType createMarketingMessageForOrderCancelResponse(String orderID) Create marketing message for order cancel response marketing message type.- Parameters:
orderID- the order id- Returns:
- the marketing message type
-
placeOrder
protected OrderModel placeOrder(IATAOrderChangeRQ orderChangeRQ, CartModel amendmentCart) throws NDCException Place an order from amendment cart.- Parameters:
orderChangeRQ- the order change requestamendmentCart- the amendment cart- Returns:
- the placed order
- Throws:
NDCException- the ndc exception
-
validateNDCOffers
protected void validateNDCOffers(Map<String, List<NDCOfferData>> ndcOfferDataMap, IATAOrderCreateRQ orderCreateRQ) throws NDCExceptionValidate ndc offers.- Parameters:
ndcOfferDataMap- the ndc offer data maporderCreateRQ- the order create rq- Throws:
NDCException- the ndc exception
-
createNdcOfferDataMap
protected Map<String,List<NDCOfferData>> createNdcOfferDataMap(IATAOrderCreateRQ orderCreateRQ) throws NDCException Create ndc offer data map.- Parameters:
orderCreateRQ- the order create rq- Returns:
- the map
- Throws:
NDCException- the ndc exception
-
setCurrencyInSession
Sets currency in session if it is present at least one currency code in a paymentInfo.- Parameters:
orderCreateRQ- the order create request- Throws:
NDCException- the ndc exception
-
getNDCBookingActionTypes
Create ndc booking action data list.- Parameters:
orderChangeRQ- the order change rq- Returns:
- the list
-
addBookingActionForRemoveAncillary
protected void addBookingActionForRemoveAncillary(List<NDCBookingActionType> ndcBookingActionTypeList, UpdateOrderItemType updateOrderItem) Add booking action for remove ancillary.- Parameters:
ndcBookingActionTypeList- the ndc booking action type listupdateOrderItem- the update order item
-
addBookingActionForUpdatePassenger
protected void addBookingActionForUpdatePassenger(List<NDCBookingActionType> ndcBookingActionTypeList, UpdateOrderItemType updateOrderItem, boolean containsAlaCarteOfferItem) Add booking action for update passenger.- Parameters:
ndcBookingActionTypeList- the ndc booking action type listupdateOrderItem- the update order itemcontainsAlaCarteOfferItem- the contains ala carte offer item
-
addBookingActionForAmendAncillary
protected void addBookingActionForAmendAncillary(List<NDCBookingActionType> ndcBookingActionTypeList, UpdateOrderItemType updateOrderItem, boolean containsAlaCarteOfferItem) Add booking action for amend ancillary.- Parameters:
ndcBookingActionTypeList- the ndc booking action type listupdateOrderItem- the update order itemcontainsAlaCarteOfferItem- the contains ala carte offer item
-
getOrderByBookingReference
Retrieves an order based on the bookingReference number and the current user, Error field in the response is populated in case the booking was not place by the current user- Parameters:
bookingReference- the booking reference- Returns:
- order by booking reference
- Throws:
NDCException- the ndc exception
-
validateCurrencyForOrderChange
protected void validateCurrencyForOrderChange(IATAOrderChangeRQ orderChangeRQ, OrderModel originalOrder) throws NDCException Validate currency.- Parameters:
orderChangeRQ- the order change rqoriginalOrder- the original order- Throws:
NDCException- the ndc exception
-
isOrderPaid
Checks if the order is paid.- Parameters:
originalOrder- the original order- Returns:
- the boolean
-
payOrder
protected IATAOrderViewRS payOrder(OrderModel originalOrder, IATAOrderChangeRQ orderChangeRQ, CartModel amendmentCart) throws NDCException Pay order.- Parameters:
originalOrder- the original orderorderChangeRQ- the order change rqamendmentCart- the amendment cart- Returns:
- the iata order view rs
- Throws:
NDCException- the ndc exception
-
populateNDCPaymentCardInfoData
protected void populateNDCPaymentCardInfoData(NDCPaymentCardInfoData ndcPaymentCardInfo, IATAOrderChangeRQ orderChangeRQ) Populate ndc payment card info data.- Parameters:
ndcPaymentCardInfo- the ndc payment card infoorderChangeRQ- the order change rq
-
amendOrder
protected void amendOrder(IATAOrderChangeRQ orderChangeRQ, List<NDCBookingActionType> ndcBookingActionTypeList, CartModel amendmentCart, List<AbstractOrderEntryModel> orderEntries) throws NDCException This method validates the booking action list and amends the order.- Parameters:
orderChangeRQ- the order change rqndcBookingActionTypeList- the ndc booking action type listamendmentCart- the amendment cartorderEntries- the order entries- Throws:
NDCException- the ndc exception
-
createBookingActionRequestData
protected BookingActionRequestData createBookingActionRequestData(List<NDCBookingActionType> ndcBookingActionDataList, OrderModel orderModel) Create booking action request data.- Parameters:
ndcBookingActionDataList- the ndc booking action data listorderModel- the order model- Returns:
- the booking action request data
-
validateAmendmentCart
protected void validateAmendmentCart(IATAOrderChangeRQ orderChangeRQ, List<AbstractOrderEntryModel> orderEntries, CartModel amendmentCart) throws NDCException Validates the amended cart: compares if the total amount of the paymentInfos in the orderChangeRQ is equal to the total amount of the amended cart entries. If there are some entries that have been removed, it creates the refund transaction associated to them.- Parameters:
orderChangeRQ- the order change rqorderEntries- the order entriesamendmentCart- the amendment cart- Throws:
NDCException- the ndc exception
-
calculateTotalToPay
Calculates difference between old total and amended total to know how much user should pay (or how much they should be refunded)- Parameters:
abstractOrderModel- the abstract order model- Returns:
- price to pay (or to be refunded)
-
getBookingService
gets booking service- Returns:
- booking service
-
setBookingService
sets booking service- Parameters:
bookingService- the booking service
-
getOrderViewPipelineManager
gets order view pipeline manager- Returns:
- order view pipeline manager
-
setOrderViewPipelineManager
sets order view pipeline manager- Parameters:
orderViewPipelineManager- the order view pipeline manager
-
getReservationFacade
Gets reservation facade.- Returns:
- the reservation facade
-
setReservationFacade
Sets reservation facade.- Parameters:
reservationFacade- the reservation facade
-
getNdcBookingActionMap
Gets ndc booking action map.- Returns:
- the ndc booking action map
-
setNdcBookingActionMap
Sets ndc booking action map.- Parameters:
ndcBookingActionMap- the ndc booking action map
-
getActionFacade
Gets action facade.- Returns:
- the action facade
-
setActionFacade
Sets action facade.- Parameters:
actionFacade- the action facade
-
getNdcBookingActionStrategyMap
Gets ndc booking action strategy map.- Returns:
- the ndc booking action strategy map
-
setNdcBookingActionStrategyMap
public void setNdcBookingActionStrategyMap(Map<NDCBookingActionType, ChangeOrderStrategy> ndcBookingActionStrategyMap) Sets ndc booking action strategy map.- Parameters:
ndcBookingActionStrategyMap- the ndc booking action strategy map
-
getNdcCheckoutFacade
Gets ndc checkout facade.- Returns:
- the ndc checkout facade
-
setNdcCheckoutFacade
Sets ndc checkout facade.- Parameters:
ndcCheckoutFacade- the ndc checkout facade
-
getUserService
protected de.hybris.platform.servicelayer.user.UserService getUserService()Gets user service.- Returns:
- the user service
-
setUserService
public void setUserService(de.hybris.platform.servicelayer.user.UserService userService) Sets user service.- Parameters:
userService- the user 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
-
getNdcCreatePaymentTransactionStrategy
Gets ndc create payment transaction strategy.- Returns:
- the ndc create payment transaction strategy
-
setNdcCreatePaymentTransactionStrategy
public void setNdcCreatePaymentTransactionStrategy(CreatePaymentTransactionSrategy ndcCreatePaymentTransactionStrategy) Sets ndc create payment transaction strategy.- Parameters:
ndcCreatePaymentTransactionStrategy- the ndc create payment transaction strategy
-
getNdcOfferFacade
Gets ndc offer facade.- Returns:
- the ndc offer facade
-
setNdcOfferFacade
Sets ndc offer facade.- Parameters:
ndcOfferFacade- the ndc offer facade
-
getStoreSessionFacade
protected de.hybris.platform.commercefacades.storesession.StoreSessionFacade getStoreSessionFacade()Gets store session facade.- Returns:
- the store session facade
-
setStoreSessionFacade
public void setStoreSessionFacade(de.hybris.platform.commercefacades.storesession.StoreSessionFacade storeSessionFacade) Sets store session facade.- Parameters:
storeSessionFacade- the store session facade
-
getOrderCreateRequestValidationStrategyMap
protected Map<String,OrderCreateRequestValidationStrategy> getOrderCreateRequestValidationStrategyMap()Gets order create request validation strategy map.- Returns:
- the order create request validation strategy map
-
setOrderCreateRequestValidationStrategyMap
public void setOrderCreateRequestValidationStrategyMap(Map<String, OrderCreateRequestValidationStrategy> orderCreateRequestValidationStrategyMap) Sets order create request validation strategy map.- Parameters:
orderCreateRequestValidationStrategyMap- the order create request validation strategy map
-
getNdcPaymentFacade
Gets ndc payment facade.- Returns:
- the ndc payment facade
-
setNdcPaymentFacade
Sets ndc payment facade.- Parameters:
ndcPaymentFacade- the ndc payment facade
-
getNdcShoppingMerchandisingFacade
Gets ndc shopping merchandising facade.- Returns:
- the ndc shopping merchandising facade
-
setNdcShoppingMerchandisingFacade
public void setNdcShoppingMerchandisingFacade(NDCShoppingMerchandisingFacade ndcShoppingMerchandisingFacade) Sets ndc shopping merchandising facade.- Parameters:
ndcShoppingMerchandisingFacade- the ndc shopping merchandising facade
-
getCreateCartPipelineManager
Gets order create pipeline manager.- Returns:
- the order create pipeline manager
-
setCreateCartPipelineManager
Sets order create pipeline manager.- Parameters:
createCartPipelineManager- the order create pipeline manager
-
getTravelCartService
Gets travel cart service.- Returns:
- the travel cart service
-
setTravelCartService
Sets travel cart service.- Parameters:
travelCartService- the travel cart service
-
getConfigurationService
protected de.hybris.platform.servicelayer.config.ConfigurationService getConfigurationService()Gets configuration service.- Returns:
- the configuration service
-
setConfigurationService
public void setConfigurationService(de.hybris.platform.servicelayer.config.ConfigurationService configurationService) Sets configuration service.- Parameters:
configurationService- the configuration service
-
getNdcPaymentService
Gets ndc payment service.- Returns:
- the ndc payment service
-
setNdcPaymentService
Sets ndc payment service.- Parameters:
ndcPaymentService- the ndc payment service
-
getShoppingTravelCartFacade
Gets shopping travel cart facade.- Returns:
- the shopping travel cart facade
-
setShoppingTravelCartFacade
Sets shopping travel cart facade.- Parameters:
shoppingTravelCartFacade- the shopping travel cart facade
-
getShoppingBookingFacade
Gets shopping booking facade.- Returns:
- the shopping booking facade
-
setShoppingBookingFacade
Sets shopping booking facade.- Parameters:
shoppingBookingFacade- the shopping booking facade
-