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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanGenerated code that can be used to reference the credit account.Describes an alternative owning user reference for the credit account, that can be used instead of theowningUserRef.Describes an alternative owning user type of the credit account, that can be used instead of theowningUserType.Additional attributes associated with this credit account.javax.money.MonetaryAmountThe current balance for this credit account.com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextStateA subset ofTrackinginformation to expose the context state for this object.javax.money.CurrencyUnitThe currency gathered from thegetBalance()getId()The id of this credit account.The reference to the user that owns this credit account.Describes the owning user type of the credit account.getType()The type of this credit account.The version of this credit account.inthashCode()voidsetAccountNumber(String accountNumber) Generated code that can be used to reference the credit account.voidsetAlternativeOwningUserRef(String alternativeOwningUserRef) Describes an alternative owning user reference for the credit account, that can be used instead of theowningUserRef.voidsetAlternativeOwningUserType(String alternativeOwningUserType) Describes an alternative owning user type of the credit account, that can be used instead of theowningUserType.voidsetAttributes(Map<String, Object> attributes) Additional attributes associated with this 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.voidThe 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.voidThe type of this credit account.voidsetVersion(Integer version) The version of this credit account.toString()
-
Constructor Details
-
CreditAccount
public CreditAccount()
-
-
Method Details
-
getCurrency
@Nullable public javax.money.CurrencyUnit getCurrency()The currency gathered from thegetBalance()- Returns:
- The currency gathered from the credit account balance
-
getOwnerIdentifier
- Specified by:
getOwnerIdentifierin interfacecom.broadleafcommerce.data.tracking.core.policy.Owned
-
getId
The id of this credit account.- Returns:
- The id of this credit account.
-
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
Generated code that can be used to reference the credit account.- Returns:
- The account number.
-
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
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
Describes an alternative owning user type of the credit account, that can be used instead of theowningUserType.- Returns:
- An alternative owning user type of the credit account.
-
getAlternativeOwningUserRef
Describes an alternative owning user reference for the credit account, that can be used instead of theowningUserRef.- 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
Additional attributes associated with this credit account.- Returns:
- Additional attributes associated with this credit account.
-
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
The id of this credit account.- Parameters:
id- The id of this credit account.
-
setType
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
Generated code that can be used to reference the credit account.- Parameters:
accountNumber- The account number.
-
setOwningUserType
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
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
Describes an alternative owning user type of the credit account, that can be used instead of theowningUserType.- Parameters:
alternativeOwningUserType- an alternative owning user type of the credit account.
-
setAlternativeOwningUserRef
Describes an alternative owning user reference for the credit account, that can be used instead of theowningUserRef.- 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
Additional attributes associated with this credit account.- Parameters:
attributes- Additional attributes associated with this credit account.
-
setVersion
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
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-