Interface CheckoutFacade

    • 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 use getCountries(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 use getCountries(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
      • 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 address
        visibleAddressesOnly - 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