Class CreditAccount
- 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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CreditAccount()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(Object other)booleanequals(Object o)StringgetAccountNumber()Generated code that can be used to reference the credit account.javax.money.MonetaryAmountgetBalance()The current balance for this credit account.com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextStategetContextState()A subset ofTrackinginformation to expose the context state for this object.javax.money.CurrencyUnitgetCurrency()The currency gathered from thegetBalance()StringgetId()The id of this credit account.StringgetOwnerIdentifier()StringgetOwningUserRef()The reference to the user that owns this credit account.StringgetOwningUserType()Describes the owning user type of the credit account.StringgetType()The type of this credit account.IntegergetVersion()The version of this credit account.inthashCode()voidsetAccountNumber(String accountNumber)Generated code that can be used to reference the credit account.voidsetBalance(javax.money.MonetaryAmount balance)The current balance for this credit account.voidsetContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState)A subset ofTrackinginformation to expose the context state for this object.voidsetId(String id)The id of this credit account.voidsetOwningUserRef(String owningUserRef)The reference to the user that owns this credit account.voidsetOwningUserType(String owningUserType)Describes the owning user type of the credit account.voidsetType(String type)The type of this credit account.voidsetVersion(Integer version)The version of this credit account.StringtoString()
-
-
-
Method Detail
-
getCurrency
@Nullable public javax.money.CurrencyUnit getCurrency()
The currency gathered from thegetBalance()- Returns:
- The currency gathered from the credit account balance
-
getOwnerIdentifier
public String getOwnerIdentifier()
- Specified by:
getOwnerIdentifierin interfacecom.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 ofTrackinginformation to expose the context state for this object.- Specified by:
getContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Returns:
- a subset of
Trackinginformation 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 ofTrackinginformation to expose the context state for this object.- Specified by:
setContextStatein interfacecom.broadleafcommerce.data.tracking.core.ContextStateAware- Parameters:
contextState- a subset ofTrackinginformation to expose the context state for this object
-
canEqual
protected boolean canEqual(Object other)
-
-