Interface CartTransferService

All Known Implementing Classes:
DefaultCartTransferService

public interface CartTransferService
Service for performing ownership transfers between anonymous, CSR, and customer-owned carts.
  • Method Summary

    Modifier and Type
    Method
    Description
    createTransferCartToken(com.broadleafcommerce.cart.client.domain.Cart cart)
    Creates a new TransferCartToken that can be exchanged for proof of access to transfer a particular cart.
    com.broadleafcommerce.cart.client.domain.Cart
    setCartAsDefault(com.broadleafcommerce.cart.client.domain.Cart cartToMakeDefault, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Transfer the provided cart to be the default/implicit cart for the provided customer.
    com.broadleafcommerce.cart.client.domain.Cart
    transferAnonymousCartOwnership(com.broadleafcommerce.cart.client.domain.Cart anonymousCart, com.broadleafcommerce.cart.client.domain.Cart registeredCustomerCart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Transfer the provided anonymous cart to be in-process for the currently authenticated customer.
    com.broadleafcommerce.cart.client.domain.Cart
    transferAnonymousCartOwnership(com.broadleafcommerce.cart.client.domain.Cart anonymousCart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Transfer the provided anonymous cart to be in-process for the currently authenticated customer.
    com.broadleafcommerce.cart.client.domain.Cart
    transferAnonymousCsrCartToInProcess(com.broadleafcommerce.cart.client.domain.Cart csrCart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    com.broadleafcommerce.cart.client.domain.Cart
    transferAnonymousCsrCartToInProcess(com.broadleafcommerce.cart.client.domain.Cart csrCart, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Transfer the provided anonymous CSR cart to be in-process for the provided customer
    com.broadleafcommerce.cart.client.domain.Cart
    transferAnonymousCsrQuote(com.broadleafcommerce.cart.client.domain.Cart csrCart, com.broadleafcommerce.order.common.domain.CustomerRef customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Transfer the provided anonymous CSR quote to be in drafting status for the provided customer
    com.broadleafcommerce.cart.client.domain.Cart
    transferCsrCartToInProcess(com.broadleafcommerce.cart.client.domain.Cart csrCart, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Transfer the provided CSR cart to be in-process for its customer.
    Attempts to decode and validate the provided token string into a TransferCartToken.
  • Method Details

    • transferAnonymousCartOwnership

      com.broadleafcommerce.cart.client.domain.Cart transferAnonymousCartOwnership(com.broadleafcommerce.cart.client.domain.Cart anonymousCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Transfer the provided anonymous cart to be in-process for the currently authenticated customer.
      Parameters:
      anonymousCart - The anonymous cart to transfer ownership
      contextInfo - Context information around sandbox and multitenant state.
      Returns:
      The cart now owned by the customer
    • createTransferCartToken

      TransferCartToken createTransferCartToken(com.broadleafcommerce.cart.client.domain.Cart cart)
      Creates a new TransferCartToken that can be exchanged for proof of access to transfer a particular cart.
      Parameters:
      cart - the cart which can be transferred using this token
      Returns:
      a transfer cart token object with an encoded token that is used to prove access to transfer the cart
    • transferAnonymousCartOwnership

      com.broadleafcommerce.cart.client.domain.Cart transferAnonymousCartOwnership(com.broadleafcommerce.cart.client.domain.Cart anonymousCart, @Nullable com.broadleafcommerce.cart.client.domain.Cart registeredCustomerCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Transfer the provided anonymous cart to be in-process for the currently authenticated customer.
      Parameters:
      anonymousCart - The anonymous cart to transfer ownership
      registeredCustomerCart - The pre-existing customer's cart
      contextInfo - Context information around sandbox and multitenant state.
      Returns:
      The cart now owned by the customer
    • transferCsrCartToInProcess

      com.broadleafcommerce.cart.client.domain.Cart transferCsrCartToInProcess(com.broadleafcommerce.cart.client.domain.Cart csrCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Transfer the provided CSR cart to be in-process for its customer.
      Parameters:
      csrCart - The CSR-owned cart to replace the customer's in-process cart
      contextInfo - Context information around sandbox and multitenant state.
      Returns:
      The in-process cart transferred to the customer
    • validateTransferCartToken

      TransferCartToken validateTransferCartToken(String tokenString) throws TransferCartTokenParseException
      Attempts to decode and validate the provided token string into a TransferCartToken. This is used to provide a way to check that a token is valid and to extract the contents.
      Parameters:
      tokenString - the encoded token string
      Returns:
      a transfer cart token object
      Throws:
      TransferCartTokenParseException
    • transferAnonymousCsrCartToInProcess

      @Deprecated com.broadleafcommerce.cart.client.domain.Cart transferAnonymousCsrCartToInProcess(com.broadleafcommerce.cart.client.domain.Cart csrCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Transfer the provided anonymous CSR cart to be in-process for the current customer or anonymous user.
      Parameters:
      csrCart - The anonymous CSR-owned cart to transfer
      contextInfo - Context information around sandbox and multitenant state.
      Returns:
      The in-process cart transferred to the customer or anonymous user
    • transferAnonymousCsrCartToInProcess

      com.broadleafcommerce.cart.client.domain.Cart transferAnonymousCsrCartToInProcess(com.broadleafcommerce.cart.client.domain.Cart csrCart, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Transfer the provided anonymous CSR cart to be in-process for the provided customer
      Parameters:
      csrCart - the CSR cart
      customer - the customer
      contextInfo - the context info
      Returns:
      the transferred cart
    • transferAnonymousCsrQuote

      com.broadleafcommerce.cart.client.domain.Cart transferAnonymousCsrQuote(com.broadleafcommerce.cart.client.domain.Cart csrCart, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Transfer the provided anonymous CSR quote to be in drafting status for the provided customer
      Parameters:
      csrCart - the CSR cart of type DefaultCartTypes.QUOTE
      customer - the customer
      contextInfo - the context info
      Returns:
      the transferred cart
    • setCartAsDefault

      com.broadleafcommerce.cart.client.domain.Cart setCartAsDefault(com.broadleafcommerce.cart.client.domain.Cart cartToMakeDefault, @Nullable com.broadleafcommerce.order.common.domain.CustomerRef customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Transfer the provided cart to be the default/implicit cart for the provided customer.

      By default, implicit cart refers to a cart with no name and status of DefaultCartStatuses.IN_PROCESS.

      Parameters:
      cartToMakeDefault - the cart to make default
      customer - the current authenticated customer
      contextInfo - Context information around sandbox and multitenant state.
      Returns:
      the cart that is set to default