com.elasticpath.domain.customer.impl
Class CustomerCreditCardImpl

java.lang.Object
  extended by com.elasticpath.domain.impl.AbstractEpDomainImpl
      extended by com.elasticpath.domain.impl.AbstractPersistenceImpl
          extended by com.elasticpath.domain.impl.AbstractEntityImpl
              extended by com.elasticpath.domain.customer.impl.CustomerCreditCardImpl
All Implemented Interfaces:
CustomerCreditCard, Entity, EpDomain, Persistence, java.io.Serializable

public class CustomerCreditCardImpl
extends AbstractEntityImpl
implements CustomerCreditCard

The default implementation of Customer.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.elasticpath.domain.impl.AbstractEntityImpl
serialVersionUID
 
Constructor Summary
CustomerCreditCardImpl()
          The default constructor.
 
Method Summary
 void encrypt()
          Encrypts the credit card number.
 CustomerAddress getBillingAddress()
           
 java.lang.String getCardHolderName()
           
 java.lang.String getCardNumber()
           
 java.lang.String getCardType()
           
 java.lang.String getExpiryMonth()
           
 java.lang.String getExpiryYear()
           
 int getIssueNumber()
           
 java.lang.String getMaskedCardNumber()
          Decrypts and returns the masked credit card number: ************5381.
 java.lang.String getSecurityCode()
          Get the 3 or 4 digit security code from the back of the card.
 java.lang.String getStartMonth()
           
 java.lang.String getStartYear()
           
 java.lang.String getUnencryptedCardNumber()
          Decrypts and returns the full credit card number.
 boolean isDefaultCard()
           
 void setBillingAddress(CustomerAddress billingAddress)
           
 void setCardHolderName(java.lang.String cardHolderName)
           
 void setCardNumber(java.lang.String cardNumber)
           
 void setCardType(java.lang.String cardType)
           
 void setDefaultCard(boolean defaultCard)
           
 void setDefaultValues()
          Set default values for those fields need default values.
 void setExpiryMonth(java.lang.String expiryMonth)
           
 void setExpiryYear(java.lang.String expiryYear)
           
 void setIssueNumber(int issueNumber)
           
 void setSecurityCode(java.lang.String securityCode)
          Set the 3 or 4 digit security code from the back of the card.
 void setStartMonth(java.lang.String startMonth)
           
 void setStartYear(java.lang.String startYear)
           
 
Methods inherited from class com.elasticpath.domain.impl.AbstractEntityImpl
convertAttributeGroupAttributes, getGuid, setGuid
 
Methods inherited from class com.elasticpath.domain.impl.AbstractPersistenceImpl
executeBeforePersistAction, getUidPk, isPersistent, setUidPk
 
Methods inherited from class com.elasticpath.domain.impl.AbstractEpDomainImpl
getElasticPath, setElasticPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.elasticpath.domain.Entity
getGuid, setGuid
 
Methods inherited from interface com.elasticpath.domain.Persistence
executeBeforePersistAction, getUidPk, isPersistent, setUidPk
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 

Constructor Detail

CustomerCreditCardImpl

public CustomerCreditCardImpl()
The default constructor.

Method Detail

encrypt

public void encrypt()
Encrypts the credit card number.

Specified by:
encrypt in interface CustomerCreditCard

getBillingAddress

public CustomerAddress getBillingAddress()
Specified by:
getBillingAddress in interface CustomerCreditCard
Returns:
the billingAddress

getCardHolderName

public java.lang.String getCardHolderName()
Specified by:
getCardHolderName in interface CustomerCreditCard
Returns:
the cardHolderName

getCardNumber

public java.lang.String getCardNumber()
Specified by:
getCardNumber in interface CustomerCreditCard
Returns:
the cardNumber

getCardType

public java.lang.String getCardType()
Specified by:
getCardType in interface CustomerCreditCard
Returns:
the cardType

getExpiryMonth

public java.lang.String getExpiryMonth()
Specified by:
getExpiryMonth in interface CustomerCreditCard
Returns:
the expiryMonth

getExpiryYear

public java.lang.String getExpiryYear()
Specified by:
getExpiryYear in interface CustomerCreditCard
Returns:
the expiryYear

getIssueNumber

public int getIssueNumber()
Specified by:
getIssueNumber in interface CustomerCreditCard
Returns:
the issueNumber

getMaskedCardNumber

public java.lang.String getMaskedCardNumber()
Decrypts and returns the masked credit card number: ************5381. Useful for displaying in receipts, GUI, order history, etc.

Specified by:
getMaskedCardNumber in interface CustomerCreditCard
Returns:
the masked credit card number

getSecurityCode

public java.lang.String getSecurityCode()
Get the 3 or 4 digit security code from the back of the card. This value cannot be persisted and will not be available unless the user has specified it.

Specified by:
getSecurityCode in interface CustomerCreditCard
Returns:
the security code

getStartMonth

public java.lang.String getStartMonth()
Specified by:
getStartMonth in interface CustomerCreditCard
Returns:
the startMonth

getStartYear

public java.lang.String getStartYear()
Specified by:
getStartYear in interface CustomerCreditCard
Returns:
the startYear

getUnencryptedCardNumber

public java.lang.String getUnencryptedCardNumber()
Decrypts and returns the full credit card number. Access to this method should be restricted!

Specified by:
getUnencryptedCardNumber in interface CustomerCreditCard
Returns:
the decrypted credit card number

isDefaultCard

public boolean isDefaultCard()
Specified by:
isDefaultCard in interface CustomerCreditCard
Returns:
the defaultCard

setBillingAddress

public void setBillingAddress(CustomerAddress billingAddress)
Specified by:
setBillingAddress in interface CustomerCreditCard
Parameters:
billingAddress - the billingAddress to set

setCardHolderName

public void setCardHolderName(java.lang.String cardHolderName)
Specified by:
setCardHolderName in interface CustomerCreditCard
Parameters:
cardHolderName - the cardHolderName to set

setCardNumber

public void setCardNumber(java.lang.String cardNumber)
Specified by:
setCardNumber in interface CustomerCreditCard
Parameters:
cardNumber - the cardNumber to set

setCardType

public void setCardType(java.lang.String cardType)
Specified by:
setCardType in interface CustomerCreditCard
Parameters:
cardType - the cardType to set

setDefaultCard

public void setDefaultCard(boolean defaultCard)
Specified by:
setDefaultCard in interface CustomerCreditCard
Parameters:
defaultCard - the defaultCard to set

setDefaultValues

public void setDefaultValues()
Set default values for those fields need default values.

Specified by:
setDefaultValues in interface Persistence
Overrides:
setDefaultValues in class AbstractEntityImpl

setExpiryMonth

public void setExpiryMonth(java.lang.String expiryMonth)
Specified by:
setExpiryMonth in interface CustomerCreditCard
Parameters:
expiryMonth - the expiryMonth to set

setExpiryYear

public void setExpiryYear(java.lang.String expiryYear)
Specified by:
setExpiryYear in interface CustomerCreditCard
Parameters:
expiryYear - the expiryYear to set

setIssueNumber

public void setIssueNumber(int issueNumber)
Specified by:
setIssueNumber in interface CustomerCreditCard
Parameters:
issueNumber - the issueNumber to set

setSecurityCode

public void setSecurityCode(java.lang.String securityCode)
Set the 3 or 4 digit security code from the back of the card. This value IS NOT persistent.

Specified by:
setSecurityCode in interface CustomerCreditCard
Parameters:
securityCode - the security code

setStartMonth

public void setStartMonth(java.lang.String startMonth)
Specified by:
setStartMonth in interface CustomerCreditCard
Parameters:
startMonth - the startMonth to set

setStartYear

public void setStartYear(java.lang.String startYear)
Specified by:
setStartYear in interface CustomerCreditCard
Parameters:
startYear - the startYear to set