Enum Class DefaultCartStatuses

java.lang.Object
java.lang.Enum<DefaultCartStatuses>
com.broadleafcommerce.cart.client.domain.enums.DefaultCartStatuses
All Implemented Interfaces:
CartStatus, Serializable, Comparable<DefaultCartStatuses>, Constable

public enum DefaultCartStatuses extends Enum<DefaultCartStatuses> implements CartStatus
Enumerates the kinds of statuses that could be represented by a cart's Cart.getStatus(). Cart's usually start as IN_PROCESS and end as SUBMITTED or CANCELLED.
Author:
Chad Harchar (charchar)
  • Enum Constant Details

    • IN_PROCESS

      public static final DefaultCartStatuses IN_PROCESS
      The Cart is in process and can be modified.

      Prior to 1.8.0, there's an expectation of having only one IN_PROCESS cart per user, and having the named carts represented by the NAMED status. After 1.8.0, a user can have an unlimited amount of IN_PROCESS carts, and named carts are simply carts with a non-null name. However, a user can only have one default/implicit cart, which out of the box means an IN_PROCESS cart with null name.

    • REQUIRES_APPROVAL

      public static final DefaultCartStatuses REQUIRES_APPROVAL
      Used to represent a Cart that requires approval.

      This is typically used for B2B account carts.

    • REJECTED

      public static final DefaultCartStatuses REJECTED
      Used to represent a Cart that has been rejected.

      This is typically used for B2B account carts.

    • AWAITING_PAYMENT_RESULT

      public static final DefaultCartStatuses AWAITING_PAYMENT_RESULT
      Indicates that the Cart payment is sent to the payment gateway but awaiting transaction result. Note that if one of the transactions is awaiting result in a multiple-payment scenario, the cart would still have this status.
    • AWAITING_PAYMENT_FINALIZATION

      public static final DefaultCartStatuses AWAITING_PAYMENT_FINALIZATION
      Indicates that the Cart payment requires the payment finalization. For example, one or more of the payments require 3D Secure verification. In this case, the customer should be redirected to the external page to finalize the payment. The cart in this status can't be modified.
    • PENDING_PAYMENT_FAILED

      public static final DefaultCartStatuses PENDING_PAYMENT_FAILED
      Indicates that the Cart had a pending payment but is now failed.

      This can happen when the transaction result is pending during the checkout flow, but later failed from receiving the latest transaction result.

    • PAYMENT_RESULT_CHECK_IN_PROGRESS

      public static final DefaultCartStatuses PAYMENT_RESULT_CHECK_IN_PROGRESS
      Indicates that the Cart is actively being used by the scheduled job to check its payment results and update the Cart accordingly.
    • LOCKED_FOR_TX_REVERSAL

      public static final DefaultCartStatuses LOCKED_FOR_TX_REVERSAL
      Used to represent a Cart that has been locked while its transactions requiring reversal are being processed. Setting this status is primarily meant to ensure that no other threads are able to simultaneously modify the cart.
    • SUBMISSION_IN_PROGRESS

      public static final DefaultCartStatuses SUBMISSION_IN_PROGRESS
      Used to represent a Cart that has been submitted by the customer & the processing of that submission is in progress. While in this status, the cart should be locked from modification by any customer requests.
    • SUBMITTED

      public static final DefaultCartStatuses SUBMITTED
      Used to represent a Cart that has been submitted by the customer & the processing of that submission has been successfully completed. This means that the cart can no longer be modified and is locked in. This also means that the cart should have its Cart.getOrderNumber() set.
    • NAMED

      @Deprecated(since="1.8.0", forRemoval=true) public static final DefaultCartStatuses NAMED
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 1.8.0, named carts are no longer represented by a status, and instead just means that the cart has a name.
      Represents a wishlist or some other saved Cart. This also usually means that the Cart has its Cart.getName() set, although not required.
    • CANCELLED

      public static final DefaultCartStatuses CANCELLED
      The Cart has been cancelled either by the customer, a CSR, or an automated process.
    • CSR_OWNED

      public static final DefaultCartStatuses CSR_OWNED
      Represents a Cart which is being managed by a CSR for the customer. A cart in this status is not visible to the customer. This cart was either created by a CSR or cloned from an existing customer's cart, and can be transferred back as the customer's IN_PROCESS cart.
    • IN_TRANSFER

      public static final DefaultCartStatuses IN_TRANSFER
      Represents an anonymous Cart which is primed to be transferred to a user. This cart has no other uses prior to being transferred.
    • TEST

      public static final DefaultCartStatuses TEST
      Represents a Cart which is being managed by an admin in preview mode. This cart cannot be submitted during checkout.
  • Method Details

    • values

      public static DefaultCartStatuses[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DefaultCartStatuses valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isInProcess

      public static boolean isInProcess(String cartStatus)
    • isRequiresApproval

      public static boolean isRequiresApproval(String cartStatus)
    • isRejected

      public static boolean isRejected(String cartStatus)
    • isAwaitingPaymentResult

      public static boolean isAwaitingPaymentResult(String cartStatus)
    • isAwaitingPaymentFinalization

      public static boolean isAwaitingPaymentFinalization(String cartStatus)
    • isPendingPaymentFailed

      public static boolean isPendingPaymentFailed(String cartStatus)
    • isPaymentResultCheckInProgress

      public static boolean isPaymentResultCheckInProgress(String cartStatus)
    • isLockedForTransactionReversal

      public static boolean isLockedForTransactionReversal(String cartStatus)
    • isSubmissionInProgress

      public static boolean isSubmissionInProgress(String cartStatus)
    • isSubmitted

      public static boolean isSubmitted(String cartStatus)
    • isNamed

      @Deprecated(since="1.8.0", forRemoval=true) public static boolean isNamed(String cartStatus)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 1.8.0, named carts are no longer represented by a status, and instead just means that the cart has a name.
    • isCancelled

      public static boolean isCancelled(String cartStatus)
    • isCsrOwned

      public static boolean isCsrOwned(String cartStatus)
    • isInTransfer

      public static boolean isInTransfer(String cartStatus)
    • isTest

      public static boolean isTest(String cartStatus)
    • isSingular

      @Deprecated(since="1.8.0", forRemoval=true) public static boolean isSingular(String cartStatus)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Tells if the given status is "singular", meaning that at most one cart is expected to be in this status for each customer.

      IMPORTANT: IN_PROCESS is not singular following release train 1.8.0-GA. However, it is left in this method for backwards compatibility.

      Parameters:
      cartStatus - the cart status to check
      Returns:
      true if singular, false otherwise