Class CreditAccount

  • All Implemented Interfaces:
    com.broadleafcommerce.data.tracking.core.ContextStateAware, com.broadleafcommerce.data.tracking.core.policy.Owned, Serializable

    public class CreditAccount
    extends Object
    implements Serializable, com.broadleafcommerce.data.tracking.core.ContextStateAware, com.broadleafcommerce.data.tracking.core.policy.Owned
    The credit account is an alternative form of payment which has been granted to the customer (or account). Customers can use it like any other form of payment. Typical use cases are store credit, account credit (i.e. B2B buy on credit), & digital gift cards.
    Author:
    Dima Myroniuk (dmyroniuk)
    See Also:
    Serialized Form
    • Constructor Detail

      • CreditAccount

        public CreditAccount()
    • Method Detail

      • getCurrency

        @Nullable
        public javax.money.CurrencyUnit getCurrency()
        The currency gathered from the getBalance()
        Returns:
        The currency gathered from the credit account balance
      • getOwnerIdentifier

        public String getOwnerIdentifier()
        Specified by:
        getOwnerIdentifier in interface com.broadleafcommerce.data.tracking.core.policy.Owned
      • getId

        public String getId()
        The id of this credit account.
        Returns:
        The id of this credit account.
      • getType

        public String getType()
        The type of this credit account. By default, it can be "STORE_CREDIT", "ACCOUNT_CREDIT" or "GIFT_CARD".
        Returns:
        The type of this credit account.
      • getAccountNumber

        public String getAccountNumber()
        Generated code that can be used to reference the credit account.
        Returns:
        The account number.
      • getOwningUserType

        public String getOwningUserType()
        Describes the owning user type of the credit account. For example, the credit account could belong to a customer, anonymous user or an account, therefore this value might be "BLC_CUSTOMER", "BLC_ACCOUNT" or "ANONYMOUS".
        Returns:
        The type describing the owning user of the credit account
      • getOwningUserRef

        public String getOwningUserRef()
        The reference to the user that owns this credit account. For example, this may be a customer id, an account id, or the anonymous user's email address.
        Returns:
        The reference to the user that owns this credit account.
      • getBalance

        public javax.money.MonetaryAmount getBalance()
        The current balance for this credit account.
        Returns:
        The current balance for this credit account.
      • getVersion

        public Integer getVersion()
        The version of this credit account. Used for checking that the requested version of the credit account is up-to-date before saving changes. Required for any request which results in an update being made to the credit account. This should never be manually incremented/decremented.
      • getContextState

        public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()
        A subset of Tracking information to expose the context state for this object.
        Specified by:
        getContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
        Returns:
        a subset of Tracking information to expose the context state for this object
      • setId

        public void setId​(String id)
        The id of this credit account.
        Parameters:
        id - The id of this credit account.
      • setType

        public void setType​(String type)
        The type of this credit account. By default, it can be "STORE_CREDIT", "ACCOUNT_CREDIT" or "GIFT_CARD".
        Parameters:
        type - The type of this credit account.
      • setAccountNumber

        public void setAccountNumber​(String accountNumber)
        Generated code that can be used to reference the credit account.
        Parameters:
        accountNumber - The account number.
      • setOwningUserType

        public void setOwningUserType​(String owningUserType)
        Describes the owning user type of the credit account. For example, the credit account could belong to a customer, anonymous user or an account, therefore this value might be "BLC_CUSTOMER", "BLC_ACCOUNT" or "ANONYMOUS".
        Parameters:
        owningUserType - The type describing the owning user of the credit account
      • setOwningUserRef

        public void setOwningUserRef​(String owningUserRef)
        The reference to the user that owns this credit account. For example, this may be a customer id, an account id, or the anonymous user's email address.
        Parameters:
        owningUserRef - The reference to the user that owns this credit account.
      • setBalance

        public void setBalance​(javax.money.MonetaryAmount balance)
        The current balance for this credit account.
        Parameters:
        balance - The current balance for this credit account.
      • setVersion

        public void setVersion​(Integer version)
        The version of this credit account. Used for checking that the requested version of the credit account is up-to-date before saving changes. Required for any request which results in an update being made to the credit account. This should never be manually incremented/decremented.
      • setContextState

        public void setContextState​(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState)
        A subset of Tracking information to expose the context state for this object.
        Specified by:
        setContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
        Parameters:
        contextState - a subset of Tracking information to expose the context state for this object
      • canEqual

        protected boolean canEqual​(Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object