Class DefaultCheckoutService
- java.lang.Object
-
- de.hybris.platform.sap.sapordermgmtservices.cart.impl.DefaultCartCheckoutBaseService
-
- de.hybris.platform.sap.sapordermgmtservices.checkout.impl.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 Summary
Constructors Constructor Description DefaultCheckoutService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BolOrderFacadegetBolOrderFacade()java.lang.StringgetCurrentDeliveryMode()Converter<java.util.Map.Entry<java.lang.String,java.lang.String>,DeliveryModeData>getDeliveryModeConverter()Converter<Order,OrderData>getOrderConverter()SapPartnerServicegetSapPartnerService()java.util.List<DeliveryModeData>getSupportedDeliveryModes()Retrieving delivery modes from SAP back end.OrderDataplaceOrder()Submits an order from the current session cart which is held in the SAP back end.voidsetBolOrderFacade(BolOrderFacade bolOrderFacade)voidsetCartRestorationService(CartRestorationService cartRestorationService)booleansetDeliveryAddress(java.lang.String sapCustomerId)Sets current delivery address.booleansetDeliveryMode(java.lang.String deliveryModeCode)Sets a delivery mode code into the current session cart which is held in SD, and updates the cart afterwards as prices can change.voidsetDeliveryModeConverter(Converter<java.util.Map.Entry<java.lang.String,java.lang.String>,DeliveryModeData> deliveryModeConverter)voidsetOrderConverter(Converter<Order,OrderData> orderConverter)booleansetPurchaseOrderNumber(java.lang.String purchaseOrderNumber)Sets the purchase order number into the current session cart which is held in SD, and updates the cart afterwards.voidsetSapPartnerService(SapPartnerService sapPartnerService)CartDataupdateCheckoutCart(CartData cartData)Update the checkout cart quantity,-
Methods inherited from class de.hybris.platform.sap.sapordermgmtservices.cart.impl.DefaultCartCheckoutBaseService
compileSessionCart, createEmptyCart, getBolCartFacade, getCartConverter, getI18nService, getMessageSource, getSessionCart, getSessionCart, hasSessionCart, removeSessionCart, reverseCartSorting, reverseCartSorting, setBolCartFacade, setCartConverter, setI18nService, setMessageSource
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.sap.sapordermgmtservices.cart.CartCheckoutBaseService
getSessionCart, getSessionCart, hasSessionCart, removeSessionCart
-
-
-
-
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:CheckoutServiceSubmits an order from the current session cart which is held in the SAP back end.- Specified by:
placeOrderin interfaceCheckoutService- 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:CheckoutServiceRetrieving delivery modes from SAP back end. In SAP terminology, this is mostly referred to as 'Shipping Condition'- Specified by:
getSupportedDeliveryModesin interfaceCheckoutService- 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:CheckoutServiceSets 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:
setDeliveryModein interfaceCheckoutService- 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:CheckoutServiceSets the purchase order number into the current session cart which is held in SD, and updates the cart afterwards.- Specified by:
setPurchaseOrderNumberin interfaceCheckoutService- 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:CheckoutServiceSets 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:
setDeliveryAddressin interfaceCheckoutService- 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
-
updateCheckoutCart
public CartData updateCheckoutCart(CartData cartData)
Description copied from interface:CheckoutServiceUpdate the checkout cart quantity,- Specified by:
updateCheckoutCartin interfaceCheckoutService- Parameters:
cartData- Cartdata values- Returns:
- cartData after update.
-
getSapPartnerService
public SapPartnerService getSapPartnerService()
- Returns:
- the sapPartnerService
-
setSapPartnerService
public void setSapPartnerService(SapPartnerService sapPartnerService)
- Parameters:
sapPartnerService- the sapPartnerService to set
-
-