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
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description PaymentTransactionEntryModelauthorizePayment(CommerceCheckoutParameter parameter)Authorizes the total amount of the cart ifCommerceCheckoutParameter.authorizationAmountis null otherwise the passed in amout is authorizedPaymentTransactionEntryModelauthorizePayment(CartModel cartModel, java.lang.String securityCode, java.lang.String paymentProvider)Deprecated, for removal: This API element is subject to removal in a future version.Since 5.2.PaymentTransactionEntryModelauthorizePayment(CartModel cartModel, java.lang.String securityCode, java.lang.String paymentProvider, java.math.BigDecimal amount)Deprecated, for removal: This API element is subject to removal in a future version.Since 5.2.protected java.math.BigDecimalcalculateAuthAmount(CartModel cartModel)Calculate authorization amount.voidcalculateCart(CommerceCheckoutParameter parameter)Calculates the cartModel if the calculated flag is false.voidcalculateCart(CartModel cartModel)Deprecated, for removal: This API element is subject to removal in a future version.Since 5.2.protected BaseSiteServicegetBaseSiteService()protected BaseStoreServicegetBaseStoreService()protected CalculationServicegetCalculationService()protected CommerceCartCalculationStrategygetCommerceCartCalculationStrategy()protected CommerceDeliveryAddressStrategygetCommerceDeliveryAddressStrategy()protected CommerceDeliveryModeStrategygetCommerceDeliveryModeStrategy()protected CommerceDeliveryModeValidationStrategygetCommerceDeliveryModeValidationStrategy()protected CommercePaymentAuthorizationStrategygetCommercePaymentAuthorizationStrategy()protected CommercePaymentInfoStrategygetCommercePaymentInfoStrategy()protected CommercePaymentProviderStrategygetCommercePaymentProviderStrategy()protected CommercePlaceOrderStrategygetCommercePlaceOrderStrategy()protected CommonI18NServicegetCommonI18NService()java.util.List<CountryModel>getCountries(CountryType countryType)Get countries.protected DeliveryServicegetDeliveryService()ExternalTaxesServicegetExternalTaxesService()protected I18NServicegetI18nService()protected ModelServicegetModelService()protected OrderServicegetOrderService()java.lang.StringgetPaymentProvider()Get the payment provider nameprotected PaymentServicegetPaymentService()protected PromotionsServicegetPromotionsService()CommerceOrderResultplaceOrder(CommerceCheckoutParameter parameter)Creates an order for the given cartOrderModelplaceOrder(CartModel cartModel)Deprecated, for removal: This API element is subject to removal in a future version.Since 5.2.OrderModelplaceOrder(CartModel cartModel, SalesApplication salesApplication)Deprecated, for removal: This API element is subject to removal in a future version.Since 5.2.booleanremoveDeliveryMode(CommerceCheckoutParameter parameter)Removes delivery mode from cart.booleanremoveDeliveryMode(CartModel cartModel)Deprecated, for removal: This API element is subject to removal in a future version.Since 5.2.voidsetBaseSiteService(BaseSiteService siteService)voidsetBaseStoreService(BaseStoreService service)voidsetCalculationService(CalculationService calculationService)voidsetCommerceCartCalculationStrategy(CommerceCartCalculationStrategy commerceCartCalculationStrategy)voidsetCommerceDeliveryAddressStrategy(CommerceDeliveryAddressStrategy commerceDeliveryAddressStrategy)voidsetCommerceDeliveryModeStrategy(CommerceDeliveryModeStrategy commerceDeliveryModeStrategy)voidsetCommerceDeliveryModeValidationStrategy(CommerceDeliveryModeValidationStrategy commerceDeliveryModeValidationStrategy)voidsetCommercePaymentAuthorizationStrategy(CommercePaymentAuthorizationStrategy commercePaymentAuthorizationStrategy)voidsetCommercePaymentInfoStrategy(CommercePaymentInfoStrategy commercePaymentInfoStrategy)voidsetCommercePaymentProviderStrategy(CommercePaymentProviderStrategy commercePaymentProviderStrategy)voidsetCommercePlaceOrderStrategy(CommercePlaceOrderStrategy commercePlaceOrderStrategy)voidsetCommonI18NService(CommonI18NService commonI18NService)booleansetDeliveryAddress(CommerceCheckoutParameter parameter)Sets the given address as delivery address on the cart and also marks the address as delivery address.booleansetDeliveryAddress(CartModel cartModel, AddressModel addressModel)Deprecated, for removal: This API element is subject to removal in a future version.Since 5.2.booleansetDeliveryAddress(CartModel cartModel, AddressModel addressModel, boolean flagAsDeliveryAddress)Deprecated, for removal: This API element is subject to removal in a future version.Since 5.2.booleansetDeliveryMode(CommerceCheckoutParameter parameter)Sets the given delivery mode on the cartbooleansetDeliveryMode(CartModel cartModel, DeliveryModeModel deliveryModeModel)Deprecated, for removal: This API element is subject to removal in a future version.Since 5.2.voidsetDeliveryService(DeliveryService deliveryService)voidsetExternalTaxesService(ExternalTaxesService externalTaxesService)voidsetI18nService(I18NService i18nService)voidsetModelService(ModelService modelService)voidsetOrderService(OrderService orderService)booleansetPaymentInfo(CommerceCheckoutParameter parameter)Sets the given payment info on the cartbooleansetPaymentInfo(CartModel cartModel, PaymentInfoModel paymentInfoModel)Deprecated, for removal: This API element is subject to removal in a future version.Since 5.2.voidsetPaymentService(PaymentService paymentService)voidsetPromotionsService(PromotionsService promotionsService)voidvalidateDeliveryMode(CommerceCheckoutParameter parameter)Validates 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)voidvalidateDeliveryMode(CartModel cartModel)Deprecated, for removal: This API element is subject to removal in a future version.Since 5.2.
-
-
-
Method Detail
-
setDeliveryAddress
@Deprecated(since="5.2", forRemoval=true) public boolean setDeliveryAddress(CartModel cartModel, AddressModel addressModel)Deprecated, for removal: This API element is subject to removal in a future version.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", forRemoval=true) public boolean setDeliveryAddress(CartModel cartModel, AddressModel addressModel, boolean flagAsDeliveryAddress)Deprecated, for removal: This API element is subject to removal in a future version.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", forRemoval=true) public boolean setDeliveryMode(CartModel cartModel, DeliveryModeModel deliveryModeModel)Deprecated, for removal: This API element is subject to removal in a future version.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", forRemoval=true) public boolean removeDeliveryMode(CartModel cartModel)Deprecated, for removal: This API element is subject to removal in a future version.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", forRemoval=true) public void calculateCart(CartModel cartModel)Deprecated, for removal: This API element is subject to removal in a future version.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", forRemoval=true) public void validateDeliveryMode(CartModel cartModel)Deprecated, for removal: This API element is subject to removal in a future version.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", forRemoval=true) public boolean setPaymentInfo(CartModel cartModel, PaymentInfoModel paymentInfoModel)Deprecated, for removal: This API element is subject to removal in a future version.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", forRemoval=true) public PaymentTransactionEntryModel authorizePayment(CartModel cartModel, java.lang.String securityCode, java.lang.String paymentProvider)Deprecated, for removal: This API element is subject to removal in a future version.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", forRemoval=true) public PaymentTransactionEntryModel authorizePayment(CartModel cartModel, java.lang.String securityCode, java.lang.String paymentProvider, java.math.BigDecimal amount)Deprecated, for removal: This API element is subject to removal in a future version.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", forRemoval=true) public OrderModel placeOrder(CartModel cartModel, SalesApplication salesApplication) throws InvalidCartExceptionDeprecated, for removal: This API element is subject to removal in a future version.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", forRemoval=true) public OrderModel placeOrder(CartModel cartModel) throws InvalidCartExceptionDeprecated, for removal: This API element is subject to removal in a future version.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)
-
-