Class DefaultCheckoutFacade
java.lang.Object
de.hybris.platform.commercefacades.order.impl.DefaultCheckoutFacade
- All Implemented Interfaces:
CheckoutFacade
- Direct Known Subclasses:
DefaultAcceleratorCheckoutFacade,DefaultCheckoutFacade
Default implementation of
CheckoutFacade-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterPlaceOrder(CartModel cartModel, OrderModel orderModel) booleanauthorizePayment(String securityCode) Authorize payment for the order.protected voidbeforePlaceOrder(CartModel cartModel) protected booleanbooleanChecks that cart or any of cart entries has TaxValuesprotected DeliveryModeDataconvert(DeliveryModeModel deliveryModeModel) protected CommerceCheckoutParametercreateCommerceCheckoutParameter(CartModel cart, boolean enableHooks) protected AddressModelcreateDeliveryAddressModel(AddressData addressData, CartModel cartModel) createPaymentSubscription(CCPaymentInfoData paymentInfoData) Create new payment subscription.protected Converter<AddressModel,AddressData> getAddressDataForId(String addressId, boolean visibleAddressesOnly) Looks up addresses in the customer address bookprotected Populator<AddressData,AddressModel> protected BaseStoreServiceDeprecated, for removal: This API element is subject to removal in a future version.since 1808.protected Converter<CardType,CardTypeData> protected CartModelgetCart()protected CartFacadeprotected <T extends CartService>
TMethod gets checkout cart, if any exist.protected CheckoutCustomerStrategyprotected CommerceCardTypeServiceprotected CommerceCheckoutServiceprotected CommonI18NServicegetCountries(CountryType countryType) Get countries.protected Converter<CountryModel,CountryData> protected Converter<CreditCardPaymentInfoModel,CCPaymentInfoData> protected CustomerModelprotected CustomerAccountServiceprotected AddressDataGet the delivery address with the specified codeprotected AddressModelDeprecated, for removal: This API element is subject to removal in a future version.since 1808.protected DeliveryModeDataprotected Converter<DeliveryModeModel,DeliveryModeData> protected DeliveryServiceprotected EnumerationServiceprotected ModelServiceprotected Converter<OrderModel,OrderData> protected CCPaymentInfoDataprotected Stringprotected PriceDataFactoryGet supported payment card typesgetSupportedDeliveryAddresses(boolean visibleAddressesOnly) Get the list of supported delivery addresses.List<? extends DeliveryModeData>Get the supported delivery modes for the cart.protected UserServiceprotected Converter<ZoneDeliveryModeModel,ZoneDeliveryModeData> booleanCheck if checkout cart exist.protected booleanbooleanChecks if at least one entry in the cart is a pickup entrybooleanChecks if at least one entry in the cart is for shippingprotected booleanisSupportedDeliveryMode(String deliveryModeCode, CartModel cartModel) Place orderprotected OrderModelplaceOrder(CartModel cartModel) voidPrepares cart for checkoutbooleanRemoves delivery address from session cart.booleanRemoves the delivery mode on the cartvoidsetAddressConverter(Converter<AddressModel, AddressData> addressConverter) voidsetAddressReversePopulator(Populator<AddressData, AddressModel> addressReversePopulator) voidsetBaseStoreService(BaseStoreService baseStoreService) voidsetCardTypeConverter(Converter<CardType, CardTypeData> cardTypeConverter) voidsetCartFacade(CartFacade cartFacade) voidsetCartService(CartService cartService) booleanSets the cheapest delivery mode in the cart when calledvoidsetCheckoutCustomerStrategy(CheckoutCustomerStrategy checkoutCustomerStrategy) voidsetCommerceCardTypeService(CommerceCardTypeService commerceCardTypeService) voidsetCommerceCheckoutService(CommerceCheckoutService commerceCheckoutService) voidsetCommonI18NService(CommonI18NService commonI18NService) voidsetCountryConverter(Converter<CountryModel, CountryData> countryConverter) voidsetCreditCardPaymentInfoConverter(Converter<CreditCardPaymentInfoModel, CCPaymentInfoData> creditCardPaymentInfoConverter) voidsetCustomerAccountService(CustomerAccountService customerAccountService) booleanSets the defaultAddress info on the cart with if current user has a default address infobooleanSets the defaultPayment info on the cart if the current user has a default payment infobooleansetDeliveryAddress(AddressData addressData) Set the delivery address on the cart.booleanSet delivery address if customer has a default delivery address and is valid for the cartbooleansetDeliveryMode(String deliveryModeCode) Set the delivery mode on the cart Checks if the deliveryMode code is supported.voidsetDeliveryModeConverter(Converter<DeliveryModeModel, DeliveryModeData> deliveryModeConverter) booleanSet cheapest delivery mode if the cart has one or more supported delivery modesvoidsetDeliveryService(DeliveryService deliveryService) voidsetEnumerationService(EnumerationService enumerationService) voidsetModelService(ModelService modelService) voidsetOrderConverter(Converter<OrderModel, OrderData> orderConverter) booleansetPaymentDetails(String paymentInfoId) Set Payment Details on the cartbooleanSet payment details if the customer has a default payment detailsvoidsetPriceDataFactory(PriceDataFactory priceDataFactory) voidsetUserService(UserService userService) voidsetZoneDeliveryModeConverter(Converter<ZoneDeliveryModeModel, ZoneDeliveryModeData> zoneDeliveryModeConverter)
-
Constructor Details
-
DefaultCheckoutFacade
public DefaultCheckoutFacade()
-
-
Method Details
-
hasCheckoutCart
public boolean hasCheckoutCart()Description copied from interface:CheckoutFacadeCheck if checkout cart exist.- Specified by:
hasCheckoutCartin interfaceCheckoutFacade- Returns:
- true if cart exists
-
getCheckoutCart
Description copied from interface:CheckoutFacadeMethod gets checkout cart, if any exist.- Specified by:
getCheckoutCartin interfaceCheckoutFacade- Returns:
- cart data if cart exists
-
getCart
-
getSupportedDeliveryAddresses
Description copied from interface:CheckoutFacadeGet the list of supported delivery addresses.- Specified by:
getSupportedDeliveryAddressesin interfaceCheckoutFacade- Parameters:
visibleAddressesOnly- include only the visible addresses- Returns:
- the supported delivery addresses
-
getDeliveryAddressForCode
Description copied from interface:CheckoutFacadeGet the delivery address with the specified code- Specified by:
getDeliveryAddressForCodein interfaceCheckoutFacade- Parameters:
code- the code- Returns:
- the delivery address
-
getDeliveryAddressModelForCode
-
createDeliveryAddressModel
-
getDeliveryAddress
-
setDeliveryAddress
Description copied from interface:CheckoutFacadeSet the delivery address on the cart.- Specified by:
setDeliveryAddressin interfaceCheckoutFacade- Parameters:
addressData- the address, If null the delivery address is removed from the session cart.- Returns:
- true if operation succeeded
-
getSupportedDeliveryModes
Description copied from interface:CheckoutFacadeGet the supported delivery modes for the cart.- Specified by:
getSupportedDeliveryModesin interfaceCheckoutFacade- Returns:
- the collection of supported delivery modes
-
setDeliveryAddressIfAvailable
public boolean setDeliveryAddressIfAvailable()Description copied from interface:CheckoutFacadeSet delivery address if customer has a default delivery address and is valid for the cart- Specified by:
setDeliveryAddressIfAvailablein interfaceCheckoutFacade- Returns:
- true if successful
-
setDeliveryModeIfAvailable
public boolean setDeliveryModeIfAvailable()Description copied from interface:CheckoutFacadeSet cheapest delivery mode if the cart has one or more supported delivery modes- Specified by:
setDeliveryModeIfAvailablein interfaceCheckoutFacade- Returns:
- true if successful
-
setPaymentInfoIfAvailable
public boolean setPaymentInfoIfAvailable()Description copied from interface:CheckoutFacadeSet payment details if the customer has a default payment details- Specified by:
setPaymentInfoIfAvailablein interfaceCheckoutFacade- Returns:
- true if successful
-
getDeliveryMode
-
setDeliveryMode
Description copied from interface:CheckoutFacadeSet the delivery mode on the cart Checks if the deliveryMode code is supported. If the code is not supported it does not get set and a false is returned.- Specified by:
setDeliveryModein interfaceCheckoutFacade- Parameters:
deliveryModeCode- the delivery mode- Returns:
- true if successful
-
isSupportedDeliveryMode
-
convert
-
getDeliveryCountries
Deprecated, for removal: This API element is subject to removal in a future version.since 1808. Please useCheckoutFacade.getCountries(CountryType)instead.Description copied from interface:CheckoutFacadeGet the supported delivery countries. The list is sorted alphabetically.- Specified by:
getDeliveryCountriesin interfaceCheckoutFacade- Returns:
- list of supported delivery countries.
-
getBillingCountries
Deprecated, for removal: This API element is subject to removal in a future version.since 1808. Please useCheckoutFacade.getCountries(CountryType)instead.Description copied from interface:CheckoutFacadeGet the supported billing countries. The list is sorted alphabetically.- Specified by:
getBillingCountriesin interfaceCheckoutFacade- Returns:
- list of supported billing countries.
-
getCountries
Description copied from interface:CheckoutFacadeGet countries.- Specified by:
getCountriesin interfaceCheckoutFacade- 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. The list is sorted alphabetically.- Returns:
- list of countries.
-
containsTaxValues
public boolean containsTaxValues()Description copied from interface:CheckoutFacadeChecks that cart or any of cart entries has TaxValues- Specified by:
containsTaxValuesin interfaceCheckoutFacade- Returns:
- true if the cart or its entries has TaxValues
-
getPaymentDetails
-
setPaymentDetails
Description copied from interface:CheckoutFacadeSet Payment Details on the cart- Specified by:
setPaymentDetailsin interfaceCheckoutFacade- Parameters:
paymentInfoId- the ID of the payment info to set as the default payment- Returns:
- true if operation succeeded
-
getSupportedCardTypes
Description copied from interface:CheckoutFacadeGet supported payment card types- Specified by:
getSupportedCardTypesin interfaceCheckoutFacade- Returns:
- list of supported card types
-
createPaymentSubscription
Description copied from interface:CheckoutFacadeCreate new payment subscription. Pass in a CCPaymentInfoData containing the customer's card details. A new payment subscription will be created, and the sorted card details will be returned in a new CCPaymentInfoData.- Specified by:
createPaymentSubscriptionin interfaceCheckoutFacade- Parameters:
paymentInfoData- the data instance containing the customers cart details- Returns:
- the newly created payment info data
-
authorizePayment
Description copied from interface:CheckoutFacadeAuthorize payment for the order. The order must have a subscription payment details set on it before the payment can be authorized.- Specified by:
authorizePaymentin interfaceCheckoutFacade- Parameters:
securityCode- the 3 or 4 number CV2 or CVV security code- Returns:
- true if successful
-
placeOrder
Description copied from interface:CheckoutFacadePlace order- Specified by:
placeOrderin interfaceCheckoutFacade- Returns:
- orderData representing the order
- Throws:
InvalidCartException- is thrown by underlyingCartValidator
-
beforePlaceOrder
-
placeOrder
- Throws:
InvalidCartException
-
afterPlaceOrder
-
removeDeliveryAddress
public boolean removeDeliveryAddress()Description copied from interface:CheckoutFacadeRemoves delivery address from session cart.- Specified by:
removeDeliveryAddressin interfaceCheckoutFacade- Returns:
- true if delivery address was removed from cart
-
removeDeliveryMode
public boolean removeDeliveryMode()Description copied from interface:CheckoutFacadeRemoves the delivery mode on the cart- Specified by:
removeDeliveryModein interfaceCheckoutFacade- Returns:
- true if successfully removed.
-
getAddressDataForId
Description copied from interface:CheckoutFacadeLooks up addresses in the customer address book- Specified by:
getAddressDataForIdin interfaceCheckoutFacade- Parameters:
addressId- The PK of an addressvisibleAddressesOnly- If true checks visible addresses in the address book- Returns:
- A address from the address book with a matching id
-
prepareCartForCheckout
public void prepareCartForCheckout()Description copied from interface:CheckoutFacadePrepares cart for checkout- Specified by:
prepareCartForCheckoutin interfaceCheckoutFacade
-
setDefaultDeliveryAddressForCheckout
public boolean setDefaultDeliveryAddressForCheckout()Description copied from interface:CheckoutFacadeSets the defaultAddress info on the cart with if current user has a default address info- Specified by:
setDefaultDeliveryAddressForCheckoutin interfaceCheckoutFacade- Returns:
- true if successful
-
setDefaultPaymentInfoForCheckout
public boolean setDefaultPaymentInfoForCheckout()Description copied from interface:CheckoutFacadeSets the defaultPayment info on the cart if the current user has a default payment info- Specified by:
setDefaultPaymentInfoForCheckoutin interfaceCheckoutFacade- Returns:
- true if successful
-
setCheapestDeliveryModeForCheckout
public boolean setCheapestDeliveryModeForCheckout()Description copied from interface:CheckoutFacadeSets the cheapest delivery mode in the cart when called- Specified by:
setCheapestDeliveryModeForCheckoutin interfaceCheckoutFacade- Returns:
- boolean if successful
-
hasShippingItems
public boolean hasShippingItems()Description copied from interface:CheckoutFacadeChecks if at least one entry in the cart is for shipping- Specified by:
hasShippingItemsin interfaceCheckoutFacade- Returns:
- true if at least one shipping entry is found in the cart
-
hasPickUpItems
public boolean hasPickUpItems()Description copied from interface:CheckoutFacadeChecks if at least one entry in the cart is a pickup entry- Specified by:
hasPickUpItemsin interfaceCheckoutFacade- Returns:
- true if even one pickup entry is found in the cart
-
hasItemsMatchingPredicate
-
checkIfCurrentUserIsTheCartUser
protected boolean checkIfCurrentUserIsTheCartUser() -
getPaymentProvider
-
getCurrentUserForCheckout
-
createCommerceCheckoutParameter
protected CommerceCheckoutParameter createCommerceCheckoutParameter(CartModel cart, boolean enableHooks) -
getCartFacade
-
setCartFacade
-
getCartService
-
setCartService
-
getAddressConverter
-
setAddressConverter
-
getAddressReversePopulator
-
setAddressReversePopulator
-
getDeliveryService
-
setDeliveryService
-
getUserService
-
setUserService
-
getPriceDataFactory
-
setPriceDataFactory
-
getCommerceCheckoutService
-
setCommerceCheckoutService
-
getEnumerationService
-
setEnumerationService
-
getCommerceCardTypeService
-
setCommerceCardTypeService
-
getCustomerAccountService
-
setCustomerAccountService
-
getCreditCardPaymentInfoConverter
protected Converter<CreditCardPaymentInfoModel,CCPaymentInfoData> getCreditCardPaymentInfoConverter() -
setCreditCardPaymentInfoConverter
public void setCreditCardPaymentInfoConverter(Converter<CreditCardPaymentInfoModel, CCPaymentInfoData> creditCardPaymentInfoConverter) -
getDeliveryModeConverter
-
setDeliveryModeConverter
public void setDeliveryModeConverter(Converter<DeliveryModeModel, DeliveryModeData> deliveryModeConverter) -
getZoneDeliveryModeConverter
-
setZoneDeliveryModeConverter
public void setZoneDeliveryModeConverter(Converter<ZoneDeliveryModeModel, ZoneDeliveryModeData> zoneDeliveryModeConverter) -
getOrderConverter
-
setOrderConverter
-
getModelService
-
setModelService
-
getCommonI18NService
-
setCommonI18NService
-
getBaseStoreService
-
setBaseStoreService
-
getCardTypeConverter
-
setCardTypeConverter
-
getCheckoutCustomerStrategy
-
setCheckoutCustomerStrategy
-
getCountryConverter
-
setCountryConverter
-