java.lang.Object
com.broadleafcommerce.cartoperation.domain.payment.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:
  • Constructor Details

    • CreditAccount

      public CreditAccount()
  • Method Details

    • 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, ANONYMOUS_USER_EMAIL, ANONYMOUS_USER_PHONE, or BLC_ACCOUNT.
      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.
    • getAlternativeOwningUserType

      public String getAlternativeOwningUserType()
      Describes an alternative owning user type of the credit account, that can be used instead of the owningUserType.
      Returns:
      An alternative owning user type of the credit account.
    • getAlternativeOwningUserRef

      public String getAlternativeOwningUserRef()
      Describes an alternative owning user reference for the credit account, that can be used instead of the owningUserRef.
      Returns:
      An alternative owning user reference for the credit account.
    • getBalance

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

      public Map<String,Object> getAttributes()
      Additional attributes associated with this credit account.
      Returns:
      Additional attributes associated with 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, ANONYMOUS_USER_EMAIL, ANONYMOUS_USER_PHONE, or BLC_ACCOUNT.
      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.
    • setAlternativeOwningUserType

      public void setAlternativeOwningUserType(String alternativeOwningUserType)
      Describes an alternative owning user type of the credit account, that can be used instead of the owningUserType.
      Parameters:
      alternativeOwningUserType - an alternative owning user type of the credit account.
    • setAlternativeOwningUserRef

      public void setAlternativeOwningUserRef(String alternativeOwningUserRef)
      Describes an alternative owning user reference for the credit account, that can be used instead of the owningUserRef.
      Parameters:
      alternativeOwningUserRef - An alternative owning user reference for the 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.
    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Additional attributes associated with this credit account.
      Parameters:
      attributes - Additional attributes associated with 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
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object