Class DefaultCommerceCheckoutService
- java.lang.Object
-
- de.hybris.platform.commerceservices.order.impl.DefaultCommerceCheckoutService
-
- All Implemented Interfaces:
CommerceCheckoutService
- Direct Known Subclasses:
DefaultB2BCommerceCheckoutService
public class DefaultCommerceCheckoutService extends java.lang.Object implements CommerceCheckoutService
Default implementation ofCommerceCheckoutService
-
-
Constructor Summary
Constructors Constructor Description DefaultCommerceCheckoutService()
-
Method Summary
-
-
-
Method Detail
-
setDeliveryAddress
@Deprecated(since="5.2") public boolean setDeliveryAddress(CartModel cartModel, AddressModel addressModel)
Deprecated.Since 5.2.- Specified by:
setDeliveryAddressin interfaceCommerceCheckoutService- Parameters:
cartModel- the cartaddressModel- the address, a null address will cause the delivery address to be removed from the cart.- Returns:
- true if successful
-
setDeliveryAddress
@Deprecated(since="5.2") public boolean setDeliveryAddress(CartModel cartModel, AddressModel addressModel, boolean flagAsDeliveryAddress)
Deprecated.Since 5.2.- Specified by:
setDeliveryAddressin interfaceCommerceCheckoutService- Parameters:
cartModel- the cartaddressModel- the address a null address will cause the delivery address to be removed from the cart.flagAsDeliveryAddress- true to mark the given address as delivery address- Returns:
- true if successful
-
setDeliveryAddress
public boolean setDeliveryAddress(CommerceCheckoutParameter parameter)
Description copied from interface:CommerceCheckoutServiceSets the given address as delivery address on the cart and also marks the address as delivery address. A null address will cause removal of deliveryAddress from the cart.- Specified by:
setDeliveryAddressin interfaceCommerceCheckoutService- Parameters:
parameter- A parameter object- Returns:
- true if successful
-
setDeliveryMode
public boolean setDeliveryMode(CommerceCheckoutParameter parameter)
Description copied from interface:CommerceCheckoutServiceSets the given delivery mode on the cart- Specified by:
setDeliveryModein interfaceCommerceCheckoutService- Parameters:
parameter- A parameter object for cart and deliverymode- Returns:
- true if successful
-
setDeliveryMode
@Deprecated(since="5.2") public boolean setDeliveryMode(CartModel cartModel, DeliveryModeModel deliveryModeModel)
Deprecated.Since 5.2.- Specified by:
setDeliveryModein interfaceCommerceCheckoutService- Parameters:
cartModel- the cartdeliveryModeModel- the delivery mode- Returns:
- true if successful
-
removeDeliveryMode
public boolean removeDeliveryMode(CommerceCheckoutParameter parameter)
Description copied from interface:CommerceCheckoutServiceRemoves delivery mode from cart. the cart is then calculated viaCommerceCartCalculationStrategy.calculateCart(de.hybris.platform.core.model.order.CartModel)- Specified by:
removeDeliveryModein interfaceCommerceCheckoutService- Parameters:
parameter- A parameter object holding the cart- Returns:
- true if success
-
removeDeliveryMode
@Deprecated(since="5.2") public boolean removeDeliveryMode(CartModel cartModel)
Deprecated.Since 5.2.- Specified by:
removeDeliveryModein interfaceCommerceCheckoutService- Parameters:
cartModel- the cart- Returns:
- true if the deliver mode is removed
-
calculateCart
public void calculateCart(CommerceCheckoutParameter parameter)
Description copied from interface:CommerceCheckoutServiceCalculates the cartModel if the calculated flag is false.- Specified by:
calculateCartin interfaceCommerceCheckoutService- Parameters:
parameter- The parameter object for the current user's cartModel
-
calculateCart
@Deprecated(since="5.2") public void calculateCart(CartModel cartModel)
Deprecated.Since 5.2.- Specified by:
calculateCartin interfaceCommerceCheckoutService- Parameters:
cartModel- The current user's cartModel
-
validateDeliveryMode
public void validateDeliveryMode(CommerceCheckoutParameter parameter)
Description copied from interface:CommerceCheckoutServiceValidates the current delivery mode on the cart and clears if not valid the cart is then calculated viaCommerceCartCalculationStrategy.calculateCart(de.hybris.platform.core.model.order.CartModel)- Specified by:
validateDeliveryModein interfaceCommerceCheckoutService- Parameters:
parameter- The parameter object holding the cart
-
validateDeliveryMode
@Deprecated(since="5.2") public void validateDeliveryMode(CartModel cartModel)
Deprecated.Since 5.2.- Specified by:
validateDeliveryModein interfaceCommerceCheckoutService- Parameters:
cartModel- the cart
-
setPaymentInfo
public boolean setPaymentInfo(CommerceCheckoutParameter parameter)
Description copied from interface:CommerceCheckoutServiceSets the given payment info on the cart- Specified by:
setPaymentInfoin interfaceCommerceCheckoutService- Parameters:
parameter- A parameter object for cart and payment details- Returns:
- true if successful
-
setPaymentInfo
@Deprecated(since="5.2") public boolean setPaymentInfo(CartModel cartModel, PaymentInfoModel paymentInfoModel)
Deprecated.Since 5.2.- Specified by:
setPaymentInfoin interfaceCommerceCheckoutService- Parameters:
cartModel- the cartpaymentInfoModel- the payment details- Returns:
- true if successful
-
authorizePayment
public PaymentTransactionEntryModel authorizePayment(CommerceCheckoutParameter parameter)
Description copied from interface:CommerceCheckoutServiceAuthorizes the total amount of the cart ifCommerceCheckoutParameter.authorizationAmountis null otherwise the passed in amout is authorized- Specified by:
authorizePaymentin interfaceCommerceCheckoutService- Parameters:
parameter- A parameter object holding the cart, security code, payment provider and optionaly authorization amount.- Returns:
- A payment transaction entry.
-
calculateAuthAmount
protected java.math.BigDecimal calculateAuthAmount(CartModel cartModel)
Calculate authorization amount.- Parameters:
cartModel- the cart model- Returns:
- the big decimal authorization amount
-
authorizePayment
@Deprecated(since="5.2") public PaymentTransactionEntryModel authorizePayment(CartModel cartModel, java.lang.String securityCode, java.lang.String paymentProvider)
Deprecated.Since 5.2.- Specified by:
authorizePaymentin interfaceCommerceCheckoutService- Parameters:
cartModel- the cartsecurityCode- the cv2 numberpaymentProvider- the payment provider that will be used to authorize- Returns:
- the payment transaction entry
-
authorizePayment
@Deprecated(since="5.2") public PaymentTransactionEntryModel authorizePayment(CartModel cartModel, java.lang.String securityCode, java.lang.String paymentProvider, java.math.BigDecimal amount)
Deprecated.Since 5.2.- Specified by:
authorizePaymentin interfaceCommerceCheckoutService- Parameters:
cartModel- the cartsecurityCode- the cv2 numberpaymentProvider- the payment provider that will be used to authorizeamount- the amount to authorize- Returns:
- the payment transaction entry
-
placeOrder
@Deprecated(since="5.2") public OrderModel placeOrder(CartModel cartModel, SalesApplication salesApplication) throws InvalidCartException
Deprecated.Since 5.2.- Specified by:
placeOrderin interfaceCommerceCheckoutService- Parameters:
cartModel- the cartsalesApplication- the sales application that placed the order- Returns:
- the order that has been created
- Throws:
InvalidCartException- if the order cannot be placed
-
placeOrder
@Deprecated(since="5.2") public OrderModel placeOrder(CartModel cartModel) throws InvalidCartException
Deprecated.Since 5.2.- Specified by:
placeOrderin interfaceCommerceCheckoutService- Parameters:
cartModel- the cart- Returns:
- the order that has been created
- Throws:
InvalidCartException- if the order cannot be placed
-
placeOrder
public CommerceOrderResult placeOrder(CommerceCheckoutParameter parameter) throws InvalidCartException
Description copied from interface:CommerceCheckoutServiceCreates an order for the given cart- Specified by:
placeOrderin interfaceCommerceCheckoutService- Returns:
- the order that has been created
- Throws:
InvalidCartException- if the order cannot be placed
-
getPaymentProvider
public java.lang.String getPaymentProvider()
Description copied from interface:CommerceCheckoutServiceGet the payment provider name- Specified by:
getPaymentProviderin interfaceCommerceCheckoutService- Returns:
- the payment provider
-
getCountries
public java.util.List<CountryModel> getCountries(CountryType countryType)
Description copied from interface:CommerceCheckoutServiceGet countries.- Specified by:
getCountriesin interfaceCommerceCheckoutService- Parameters:
countryType- If the value of type equals to shipping, then return shipping countries. If the value of type equals to billing, then return billing countries. If the value of type is not given, return all countries.- Returns:
- list of countries.
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getDeliveryService
protected DeliveryService getDeliveryService()
-
setDeliveryService
public void setDeliveryService(DeliveryService deliveryService)
-
getI18nService
protected I18NService getI18nService()
-
setI18nService
public void setI18nService(I18NService i18nService)
-
getCommonI18NService
protected CommonI18NService getCommonI18NService()
-
setCommonI18NService
public void setCommonI18NService(CommonI18NService commonI18NService)
-
getPaymentService
protected PaymentService getPaymentService()
-
setPaymentService
public void setPaymentService(PaymentService paymentService)
-
getOrderService
protected OrderService getOrderService()
-
setOrderService
public void setOrderService(OrderService orderService)
-
getBaseSiteService
protected BaseSiteService getBaseSiteService()
-
setBaseSiteService
public void setBaseSiteService(BaseSiteService siteService)
-
getBaseStoreService
protected BaseStoreService getBaseStoreService()
-
setBaseStoreService
public void setBaseStoreService(BaseStoreService service)
-
getPromotionsService
protected PromotionsService getPromotionsService()
-
setPromotionsService
public void setPromotionsService(PromotionsService promotionsService)
-
getCalculationService
protected CalculationService getCalculationService()
-
setCalculationService
public void setCalculationService(CalculationService calculationService)
-
getExternalTaxesService
public ExternalTaxesService getExternalTaxesService()
-
setExternalTaxesService
public void setExternalTaxesService(ExternalTaxesService externalTaxesService)
-
getCommerceCartCalculationStrategy
protected CommerceCartCalculationStrategy getCommerceCartCalculationStrategy()
-
setCommerceCartCalculationStrategy
public void setCommerceCartCalculationStrategy(CommerceCartCalculationStrategy commerceCartCalculationStrategy)
-
getCommercePlaceOrderStrategy
protected CommercePlaceOrderStrategy getCommercePlaceOrderStrategy()
-
setCommercePlaceOrderStrategy
public void setCommercePlaceOrderStrategy(CommercePlaceOrderStrategy commercePlaceOrderStrategy)
-
getCommercePaymentAuthorizationStrategy
protected CommercePaymentAuthorizationStrategy getCommercePaymentAuthorizationStrategy()
-
setCommercePaymentAuthorizationStrategy
public void setCommercePaymentAuthorizationStrategy(CommercePaymentAuthorizationStrategy commercePaymentAuthorizationStrategy)
-
getCommercePaymentInfoStrategy
protected CommercePaymentInfoStrategy getCommercePaymentInfoStrategy()
-
setCommercePaymentInfoStrategy
public void setCommercePaymentInfoStrategy(CommercePaymentInfoStrategy commercePaymentInfoStrategy)
-
getCommerceDeliveryModeValidationStrategy
protected CommerceDeliveryModeValidationStrategy getCommerceDeliveryModeValidationStrategy()
-
setCommerceDeliveryModeValidationStrategy
public void setCommerceDeliveryModeValidationStrategy(CommerceDeliveryModeValidationStrategy commerceDeliveryModeValidationStrategy)
-
getCommercePaymentProviderStrategy
protected CommercePaymentProviderStrategy getCommercePaymentProviderStrategy()
-
setCommercePaymentProviderStrategy
public void setCommercePaymentProviderStrategy(CommercePaymentProviderStrategy commercePaymentProviderStrategy)
-
getCommerceDeliveryAddressStrategy
protected CommerceDeliveryAddressStrategy getCommerceDeliveryAddressStrategy()
-
setCommerceDeliveryAddressStrategy
public void setCommerceDeliveryAddressStrategy(CommerceDeliveryAddressStrategy commerceDeliveryAddressStrategy)
-
getCommerceDeliveryModeStrategy
protected CommerceDeliveryModeStrategy getCommerceDeliveryModeStrategy()
-
setCommerceDeliveryModeStrategy
public void setCommerceDeliveryModeStrategy(CommerceDeliveryModeStrategy commerceDeliveryModeStrategy)
-
-