Class DefaultCheckoutService

  • All Implemented Interfaces:
    CartCheckoutBaseService, CheckoutService

    public class DefaultCheckoutService
    extends DefaultCartCheckoutBaseService
    implements CheckoutService
    Default service implementation for checkout with SAP Synchronous Order Management.
    The class synchronizes accesses to the BOL object representing the cart, as this is not thread safe. Multi-threaded accesses can happen although we use request sequencing, since also filters might call cart facades.
    • Constructor Detail

      • DefaultCheckoutService

        public DefaultCheckoutService()
    • Method Detail

      • getDeliveryModeConverter

        public Converter<java.util.Map.Entry<java.lang.String,​java.lang.String>,​DeliveryModeData> getDeliveryModeConverter()
        Returns:
        The converter for mapping the BOL representation of the delivery mode into the format needed for facade layer
      • setDeliveryModeConverter

        public void setDeliveryModeConverter​(Converter<java.util.Map.Entry<java.lang.String,​java.lang.String>,​DeliveryModeData> deliveryModeConverter)
        Parameters:
        deliveryModeConverter - The converter for mapping the BOL representation of the delivery mode into the format needed for the facade layer
      • placeOrder

        public OrderData placeOrder()
        Description copied from interface: CheckoutService
        Submits an order from the current session cart which is held in the SAP back end.
        Specified by:
        placeOrder in interface CheckoutService
        Returns:
        The order that has been persisted in the SAP back end
      • getOrderConverter

        public Converter<Order,​OrderData> getOrderConverter()
        Returns:
        The converter we need to map the BOL representation of an order into the format needed in the facade layer
      • setOrderConverter

        public void setOrderConverter​(Converter<Order,​OrderData> orderConverter)
        Parameters:
        orderConverter - The converter we need to map the BOL representation of an order into the format needed in the facade layer
      • getSupportedDeliveryModes

        public java.util.List<DeliveryModeData> getSupportedDeliveryModes()
        Description copied from interface: CheckoutService
        Retrieving delivery modes from SAP back end. In SAP terminology, this is mostly referred to as 'Shipping Condition'
        Specified by:
        getSupportedDeliveryModes in interface CheckoutService
        Returns:
        The list of available delivery modes. These are read from the SAP back end.
      • setDeliveryMode

        public boolean setDeliveryMode​(java.lang.String deliveryModeCode)
        Description copied from interface: CheckoutService
        Sets a delivery mode code into the current session cart which is held in SD, and updates the cart afterwards as prices can change.
        Specified by:
        setDeliveryMode in interface CheckoutService
        Parameters:
        deliveryModeCode - The new delivery mode code. Named 'Shipping condition' in SAP back end terms.
        Returns:
        Has this action been performed successfully?
      • getCurrentDeliveryMode

        public java.lang.String getCurrentDeliveryMode()
        Returns:
        Current delivery mode from BOL header object
      • setPurchaseOrderNumber

        public boolean setPurchaseOrderNumber​(java.lang.String purchaseOrderNumber)
        Description copied from interface: CheckoutService
        Sets the purchase order number into the current session cart which is held in SD, and updates the cart afterwards.
        Specified by:
        setPurchaseOrderNumber in interface CheckoutService
        Parameters:
        purchaseOrderNumber - Purchase order number
        Returns:
        Has this action been performed successfully?
      • getBolOrderFacade

        public BolOrderFacade getBolOrderFacade()
        Returns:
        the bolOrderFacade
      • setBolOrderFacade

        public void setBolOrderFacade​(BolOrderFacade bolOrderFacade)
        Parameters:
        bolOrderFacade - the bolOrderFacade to set
      • setDeliveryAddress

        public boolean setDeliveryAddress​(java.lang.String sapCustomerId)
        Description copied from interface: CheckoutService
        Sets current delivery address. It's not possible to set a document specific address, instead the ID of a valid ship-to party needs to be passed.
        Specified by:
        setDeliveryAddress in interface CheckoutService
        Parameters:
        sapCustomerId - Technical key of an back end ship-to party, typically with length 10
        Returns:
        Did it succeed?
      • setCartRestorationService

        public void setCartRestorationService​(CartRestorationService cartRestorationService)
        Parameters:
        cartRestorationService - the cartRestorationService to set
      • getSapPartnerService

        public SapPartnerService getSapPartnerService()
        Returns:
        the sapPartnerService
      • setSapPartnerService

        public void setSapPartnerService​(SapPartnerService sapPartnerService)
        Parameters:
        sapPartnerService - the sapPartnerService to set