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
,DefaultSapDigitalPaymentAcceleratorCheckoutFacade
,SapCreditCheckB2BAcceleratorCheckoutFacade
,SapCreditCheckB2BCheckoutFacade
,SapCreditCheckB2BMultiStepCheckoutFlowFacade
,SapOrdermgmtB2BAcceleratorCheckoutFacade
,SapOrdermgmtB2BCheckoutFacade
,SapOrdermgmtB2BMultiStepCheckoutFlowFacade
,SessionOverrideCheckoutFlowFacade
public interface CheckoutFacade
Checkout facade interface. Service is responsible for getting information for checkout.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description boolean
authorizePayment(java.lang.String securityCode)
Authorize payment for the order.boolean
containsTaxValues()
Checks that cart or any of cart entries has TaxValuesCCPaymentInfoData
createPaymentSubscription(CCPaymentInfoData paymentInfoData)
Create new payment subscription.AddressData
getAddressDataForId(java.lang.String addressId, boolean visibleAddressesOnly)
Looks up addresses in the customer address bookjava.util.List<CountryData>
getBillingCountries()
Deprecated.since 1808.CartData
getCheckoutCart()
Method gets checkout cart, if any exist.java.util.List<CountryData>
getCountries(CountryType countryType)
Get countries.AddressData
getDeliveryAddressForCode(java.lang.String code)
Get the delivery address with the specified codejava.util.List<CountryData>
getDeliveryCountries()
Deprecated.since 1808.java.util.List<CardTypeData>
getSupportedCardTypes()
Get supported payment card typesjava.util.List<? extends AddressData>
getSupportedDeliveryAddresses(boolean visibleAddressesOnly)
Get the list of supported delivery addresses.java.util.List<? extends DeliveryModeData>
getSupportedDeliveryModes()
Get the supported delivery modes for the cart.boolean
hasCheckoutCart()
Check if checkout cart exist.boolean
hasPickUpItems()
Checks if at least one entry in the cart is a pickup entryboolean
hasShippingItems()
Checks if at least one entry in the cart is for shippingOrderData
placeOrder()
Place ordervoid
prepareCartForCheckout()
Prepares cart for checkoutboolean
removeDeliveryAddress()
Removes delivery address from session cart.boolean
removeDeliveryMode()
Removes the delivery mode on the cartboolean
setCheapestDeliveryModeForCheckout()
Sets the cheapest delivery mode in the cart when calledboolean
setDefaultDeliveryAddressForCheckout()
Sets the defaultAddress info on the cart with if current user has a default address infoboolean
setDefaultPaymentInfoForCheckout()
Sets the defaultPayment info on the cart if the current user has a default payment infoboolean
setDeliveryAddress(AddressData address)
Set the delivery address on the cart.boolean
setDeliveryAddressIfAvailable()
Set delivery address if customer has a default delivery address and is valid for the cartboolean
setDeliveryMode(java.lang.String deliveryModeCode)
Set the delivery mode on the cart Checks if the deliveryMode code is supported.boolean
setDeliveryModeIfAvailable()
Set cheapest delivery mode if the cart has one or more supported delivery modesboolean
setPaymentDetails(java.lang.String paymentInfoId)
Set Payment Details on the cartboolean
setPaymentInfoIfAvailable()
Set payment details if the customer has a default payment details
-
-
-
Method Detail
-
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
java.util.List<? extends AddressData> getSupportedDeliveryAddresses(boolean visibleAddressesOnly)
Get the list of supported delivery addresses.- Parameters:
visibleAddressesOnly
- include only the visible addresses- Returns:
- the supported delivery addresses
-
getDeliveryAddressForCode
AddressData getDeliveryAddressForCode(java.lang.String code)
Get the delivery address with the specified code- Parameters:
code
- the code- Returns:
- the delivery address
-
setDeliveryAddress
boolean setDeliveryAddress(AddressData address)
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
java.util.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
boolean setDeliveryMode(java.lang.String deliveryModeCode)
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(since="1808") java.util.List<CountryData> getDeliveryCountries()
Deprecated.since 1808. Please usegetCountries(CountryType)
instead.Get the supported delivery countries. The list is sorted alphabetically.- Returns:
- list of supported delivery countries.
-
getBillingCountries
@Deprecated(since="1808") java.util.List<CountryData> getBillingCountries()
Deprecated.since 1808. Please usegetCountries(CountryType)
instead.Get the supported billing countries. The list is sorted alphabetically.- Returns:
- list of supported billing countries.
-
getCountries
java.util.List<CountryData> getCountries(CountryType countryType)
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
boolean setPaymentDetails(java.lang.String paymentInfoId)
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
java.util.List<CardTypeData> getSupportedCardTypes()
Get supported payment card types- Returns:
- list of supported card types
-
createPaymentSubscription
CCPaymentInfoData createPaymentSubscription(CCPaymentInfoData paymentInfoData)
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
boolean authorizePayment(java.lang.String securityCode)
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
OrderData placeOrder() throws InvalidCartException
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
AddressData getAddressDataForId(java.lang.String addressId, boolean visibleAddressesOnly)
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
-
-