java.lang.Object
de.hybris.platform.ndc182shoppingfacades.facades.order.impl.DefaultNDCOrderFacade
All Implemented Interfaces:
NDCOrderFacade

public class DefaultNDCOrderFacade extends Object implements NDCOrderFacade
The ndc 18.2 implementation of NDCOrderFacade interface.
  • Constructor Details

    • DefaultNDCOrderFacade

      public DefaultNDCOrderFacade()
  • Method Details

    • createOrder

      Description copied from interface: NDCOrderFacade
      Creates an order from an OrderCreateRQ message.
      Specified by:
      createOrder in interface NDCOrderFacade
      Parameters:
      orderCreateRQ - the orderCreateRQ
      Returns:
      the orderViewRS
      Throws:
      NDCException
      MerchandisingRequestException
    • changeOrder

      Description copied from interface: NDCOrderFacade
      Retrieves the original order and calculates the difference between this and the new one and places the amended order.
      Specified by:
      changeOrder in interface NDCOrderFacade
      Parameters:
      orderChangeRQ - the orderChangeRQ
      Returns:
      the orderViewRS
      Throws:
      NDCException - the ndc exception
      MerchandisingRequestException
    • retrieveOrder

      public IATAOrderViewRS retrieveOrder(IATAOrderRetrieveRQ orderRetrieveRQ) throws NDCException
      Retrieves the order from the booking reference specified in the OrderRetrieveRQ.
      Specified by:
      retrieveOrder in interface NDCOrderFacade
      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: NDCOrderFacade
      Cancel order iata order cancel rs.
      Specified by:
      cancelOrder in interface NDCOrderFacade
      Parameters:
      orderCancelRQ - the order cancel rq
      Returns:
      the iata order cancel rs
      Throws:
      NDCException - the ndc exception
    • createOrderCancelResponse

      protected ordercancelresponse.IATAOrderCancelRS createOrderCancelResponse(String orderID)
      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 request
      amendmentCart - the amendment cart
      Returns:
      the placed order
      Throws:
      NDCException - the ndc exception
    • validateNDCOffers

      protected void validateNDCOffers(Map<String,List<NDCOfferData>> ndcOfferDataMap, IATAOrderCreateRQ orderCreateRQ) throws NDCException
      Validate ndc offers.
      Parameters:
      ndcOfferDataMap - the ndc offer data map
      orderCreateRQ - 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

      protected void setCurrencyInSession(IATAOrderCreateRQ orderCreateRQ) throws NDCException
      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

      protected List<NDCBookingActionType> getNDCBookingActionTypes(IATAOrderChangeRQ orderChangeRQ)
      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 list
      updateOrderItem - 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 list
      updateOrderItem - the update order item
      containsAlaCarteOfferItem - 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 list
      updateOrderItem - the update order item
      containsAlaCarteOfferItem - the contains ala carte offer item
    • getOrderByBookingReference

      protected OrderModel getOrderByBookingReference(String bookingReference) throws NDCException
      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 rq
      originalOrder - the original order
      Throws:
      NDCException - the ndc exception
    • isOrderPaid

      protected boolean isOrderPaid(OrderModel originalOrder)
      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 order
      orderChangeRQ - the order change rq
      amendmentCart - 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 info
      orderChangeRQ - 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 rq
      ndcBookingActionTypeList - the ndc booking action type list
      amendmentCart - the amendment cart
      orderEntries - 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 list
      orderModel - 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 rq
      orderEntries - the order entries
      amendmentCart - the amendment cart
      Throws:
      NDCException - the ndc exception
    • calculateTotalToPay

      protected BigDecimal calculateTotalToPay(AbstractOrderModel abstractOrderModel)
      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

      protected BookingService getBookingService()
      gets booking service
      Returns:
      booking service
    • setBookingService

      public void setBookingService(BookingService bookingService)
      sets booking service
      Parameters:
      bookingService - the booking service
    • getOrderViewPipelineManager

      protected OrderViewPipelineManager getOrderViewPipelineManager()
      gets order view pipeline manager
      Returns:
      order view pipeline manager
    • setOrderViewPipelineManager

      public void setOrderViewPipelineManager(OrderViewPipelineManager orderViewPipelineManager)
      sets order view pipeline manager
      Parameters:
      orderViewPipelineManager - the order view pipeline manager
    • getReservationFacade

      protected ReservationFacade getReservationFacade()
      Gets reservation facade.
      Returns:
      the reservation facade
    • setReservationFacade

      public void setReservationFacade(ReservationFacade reservationFacade)
      Sets reservation facade.
      Parameters:
      reservationFacade - the reservation facade
    • getNdcBookingActionMap

      protected Map<NDCBookingActionType,ActionTypeOption> getNdcBookingActionMap()
      Gets ndc booking action map.
      Returns:
      the ndc booking action map
    • setNdcBookingActionMap

      public void setNdcBookingActionMap(Map<NDCBookingActionType,ActionTypeOption> ndcBookingActionMap)
      Sets ndc booking action map.
      Parameters:
      ndcBookingActionMap - the ndc booking action map
    • getActionFacade

      protected ActionFacade getActionFacade()
      Gets action facade.
      Returns:
      the action facade
    • setActionFacade

      public void setActionFacade(ActionFacade actionFacade)
      Sets action facade.
      Parameters:
      actionFacade - the action facade
    • getNdcBookingActionStrategyMap

      protected Map<NDCBookingActionType,ChangeOrderStrategy> 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

      protected NDCCheckoutFacade getNdcCheckoutFacade()
      Gets ndc checkout facade.
      Returns:
      the ndc checkout facade
    • setNdcCheckoutFacade

      public void setNdcCheckoutFacade(NDCCheckoutFacade ndcCheckoutFacade)
      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

      protected CreatePaymentTransactionSrategy 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

      protected NDCOfferFacade getNdcOfferFacade()
      Gets ndc offer facade.
      Returns:
      the ndc offer facade
    • setNdcOfferFacade

      public void setNdcOfferFacade(NDCOfferFacade ndcOfferFacade)
      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

      protected NDCPaymentFacade getNdcPaymentFacade()
      Gets ndc payment facade.
      Returns:
      the ndc payment facade
    • setNdcPaymentFacade

      public void setNdcPaymentFacade(NDCPaymentFacade ndcPaymentFacade)
      Sets ndc payment facade.
      Parameters:
      ndcPaymentFacade - the ndc payment facade
    • getNdcShoppingMerchandisingFacade

      protected NDCShoppingMerchandisingFacade 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

      protected CreateCartPipelineManager getCreateCartPipelineManager()
      Gets order create pipeline manager.
      Returns:
      the order create pipeline manager
    • setCreateCartPipelineManager

      public void setCreateCartPipelineManager(CreateCartPipelineManager createCartPipelineManager)
      Sets order create pipeline manager.
      Parameters:
      createCartPipelineManager - the order create pipeline manager
    • getTravelCartService

      protected TravelCartService getTravelCartService()
      Gets travel cart service.
      Returns:
      the travel cart service
    • setTravelCartService

      public void setTravelCartService(TravelCartService travelCartService)
      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

      protected NDCPaymentService getNdcPaymentService()
      Gets ndc payment service.
      Returns:
      the ndc payment service
    • setNdcPaymentService

      public void setNdcPaymentService(NDCPaymentService ndcPaymentService)
      Sets ndc payment service.
      Parameters:
      ndcPaymentService - the ndc payment service
    • getShoppingTravelCartFacade

      protected ShoppingTravelCartFacade getShoppingTravelCartFacade()
      Gets shopping travel cart facade.
      Returns:
      the shopping travel cart facade
    • setShoppingTravelCartFacade

      public void setShoppingTravelCartFacade(ShoppingTravelCartFacade shoppingTravelCartFacade)
      Sets shopping travel cart facade.
      Parameters:
      shoppingTravelCartFacade - the shopping travel cart facade
    • getShoppingBookingFacade

      protected ShoppingBookingFacade getShoppingBookingFacade()
      Gets shopping booking facade.
      Returns:
      the shopping booking facade
    • setShoppingBookingFacade

      public void setShoppingBookingFacade(ShoppingBookingFacade shoppingBookingFacade)
      Sets shopping booking facade.
      Parameters:
      shoppingBookingFacade - the shopping booking facade