Interface CheckoutFacade
- All Known Subinterfaces:
AcceleratorCheckoutFacade,B2BCheckoutFacade,CheckoutFlowFacade,ChineseCheckoutFacade,DeliveryTimeSlotFacade,TaxInvoiceCheckoutFacade
- All Known Implementing Classes:
B2BMultiStepCheckoutFlowFacade,ChinesePaymentMockCheckoutFacade,ChineseTaxInvoiceCheckoutFacade,DefaultAcceleratorCheckoutFacade,DefaultB2BAcceleratorCheckoutFacade,DefaultB2BCheckoutFacade,DefaultCheckoutFacade,DefaultCheckoutFacade,DefaultCheckoutFlowFacade,DefaultChineseCheckoutFacade,DefaultChineseDeliveryTimeSlotFacade,SessionOverrideCheckoutFlowFacade
public interface CheckoutFacade
Checkout facade interface. Service is responsible for getting information for checkout.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanauthorizePayment(String securityCode) Authorize payment for the order.booleanChecks that cart or any of cart entries has TaxValuescreatePaymentSubscription(CCPaymentInfoData paymentInfoData) Create new payment subscription.getAddressDataForId(String addressId, boolean visibleAddressesOnly) Looks up addresses in the customer address bookDeprecated, for removal: This API element is subject to removal in a future version.since 1808.Method gets checkout cart, if any exist.getCountries(CountryType countryType) Get countries.Get the delivery address with the specified codeDeprecated, for removal: This API element is subject to removal in a future version.since 1808.Get supported payment card typesList<? extends AddressData>getSupportedDeliveryAddresses(boolean visibleAddressesOnly) Get the list of supported delivery addresses.List<? extends DeliveryModeData>Get the supported delivery modes for the cart.booleanCheck if checkout cart exist.booleanChecks if at least one entry in the cart is a pickup entrybooleanChecks if at least one entry in the cart is for shippingPlace ordervoidPrepares cart for checkoutbooleanRemoves delivery address from session cart.booleanRemoves the delivery mode on the cartbooleanSets the cheapest delivery mode in the cart when calledbooleanSets 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 address) 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.booleanSet cheapest delivery mode if the cart has one or more supported delivery modesbooleansetPaymentDetails(String paymentInfoId) Set Payment Details on the cartbooleanSet payment details if the customer has a default payment details
-
Method Details
-
hasCheckoutCart
boolean hasCheckoutCart()Check if checkout cart exist.- Returns:
- true if cart exists
-
getCheckoutCart
CartData getCheckoutCart()Method gets checkout cart, if any exist.- Returns:
- cart data if cart exists
-
getSupportedDeliveryAddresses
Get the list of supported delivery addresses.- Parameters:
visibleAddressesOnly- include only the visible addresses- Returns:
- the supported delivery addresses
-
getDeliveryAddressForCode
Get the delivery address with the specified code- Parameters:
code- the code- Returns:
- the delivery address
-
setDeliveryAddress
Set the delivery address on the cart.- Parameters:
address- the address, If null the delivery address is removed from the session cart.- Returns:
- true if operation succeeded
-
removeDeliveryAddress
boolean removeDeliveryAddress()Removes delivery address from session cart.- Returns:
- true if delivery address was removed from cart
-
getSupportedDeliveryModes
List<? extends DeliveryModeData> getSupportedDeliveryModes()Get the supported delivery modes for the cart.- Returns:
- the collection of supported delivery modes
-
setDeliveryAddressIfAvailable
boolean setDeliveryAddressIfAvailable()Set delivery address if customer has a default delivery address and is valid for the cart- Returns:
- true if successful
-
setDeliveryModeIfAvailable
boolean setDeliveryModeIfAvailable()Set cheapest delivery mode if the cart has one or more supported delivery modes- Returns:
- true if successful
-
setPaymentInfoIfAvailable
boolean setPaymentInfoIfAvailable()Set payment details if the customer has a default payment details- Returns:
- true if successful
-
setDeliveryMode
Set 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.- Parameters:
deliveryModeCode- the delivery mode- Returns:
- true if successful
-
removeDeliveryMode
boolean removeDeliveryMode()Removes the delivery mode on the cart- Returns:
- true if successfully removed.
-
getDeliveryCountries
Deprecated, for removal: This API element is subject to removal in a future version.since 1808. Please usegetCountries(CountryType)instead.Get the supported delivery countries. The list is sorted alphabetically.- Returns:
- list of supported delivery countries.
-
getBillingCountries
Deprecated, for removal: This API element is subject to removal in a future version.since 1808. Please usegetCountries(CountryType)instead.Get the supported billing countries. The list is sorted alphabetically.- Returns:
- list of supported billing countries.
-
getCountries
Get countries.- 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.
-
setPaymentDetails
Set Payment Details on the cart- Parameters:
paymentInfoId- the ID of the payment info to set as the default payment- Returns:
- true if operation succeeded
-
getSupportedCardTypes
List<CardTypeData> getSupportedCardTypes()Get supported payment card types- Returns:
- list of supported card types
-
createPaymentSubscription
Create 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.- Parameters:
paymentInfoData- the data instance containing the customers cart details- Returns:
- the newly created payment info data
-
authorizePayment
Authorize payment for the order. The order must have a subscription payment details set on it before the payment can be authorized.- Parameters:
securityCode- the 3 or 4 number CV2 or CVV security code- Returns:
- true if successful
-
placeOrder
Place order- Returns:
- orderData representing the order
- Throws:
InvalidCartException- is thrown by underlyingCartValidator
-
containsTaxValues
boolean containsTaxValues()Checks that cart or any of cart entries has TaxValues- Returns:
- true if the cart or its entries has TaxValues
-
getAddressDataForId
Looks up addresses in the customer address book- 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
void prepareCartForCheckout()Prepares cart for checkout -
setDefaultPaymentInfoForCheckout
boolean setDefaultPaymentInfoForCheckout()Sets the defaultPayment info on the cart if the current user has a default payment info- Returns:
- true if successful
-
setDefaultDeliveryAddressForCheckout
boolean setDefaultDeliveryAddressForCheckout()Sets the defaultAddress info on the cart with if current user has a default address info- Returns:
- true if successful
-
setCheapestDeliveryModeForCheckout
boolean setCheapestDeliveryModeForCheckout()Sets the cheapest delivery mode in the cart when called- Returns:
- boolean if successful
-
hasShippingItems
boolean hasShippingItems()Checks if at least one entry in the cart is for shipping- Returns:
- true if at least one shipping entry is found in the cart
-
hasPickUpItems
boolean hasPickUpItems()Checks if at least one entry in the cart is a pickup entry- Returns:
- true if even one pickup entry is found in the cart
-