com.elasticpath.domain.order.impl
Class OrderPaymentImpl

java.lang.Object
  extended by com.elasticpath.domain.impl.AbstractEpDomainImpl
      extended by com.elasticpath.domain.impl.AbstractPersistenceImpl
          extended by com.elasticpath.domain.impl.AbstractValueObjectImpl
              extended by com.elasticpath.domain.order.impl.OrderPaymentImpl
All Implemented Interfaces:
EpDomain, OrderPayment, Persistence, ValueObject, java.io.Serializable

public class OrderPaymentImpl
extends AbstractValueObjectImpl
implements OrderPayment

Represents customer payment information.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
          Serial version id.
 
Fields inherited from interface com.elasticpath.domain.order.OrderPayment
AUTHORIZATION_TRANSACTION, CAPTURE_TRANSACTION, CREDIT_TRANSACTION
 
Constructor Summary
OrderPaymentImpl()
           
 
Method Summary
 void encryptCardNumber()
          Encrypts the credit card number.
 java.math.BigDecimal getAmount()
          Get the amount of this payment.
 java.lang.String getAuthorizationCode()
          Get the authorization code.
 java.lang.String getCardHolderName()
          Set the card holder name.
 java.lang.String getCardNumber()
          Get the encrypted credit cart number.
 java.lang.String getCardType()
          Get the vendor/brand of the credit card (e.g.
 java.util.Date getCreatedDate()
          Get the date that this order was created on.
 java.lang.String getCurrencyCode()
          Get the currency code (e.g.
 java.lang.String getCvv2Code()
          Get the card security code (found near the signature on the back of the card).
 java.lang.String getEmail()
          Get the customer's email address (Required for card processing).
 java.lang.String getExpiryMonth()
          Get the two-digit expiry date month.
 java.lang.String getExpiryYear()
          Get the two-digit expiry date year.
 java.lang.String getGatewayToken()
          Return the payment gateway token.
 java.lang.String getIssueNumber()
          Get the issue number used by some U.K.
 java.lang.String getMaskedCardNumber()
          Decrypts and returns the masked credit card number: ************5381.
 java.lang.String getPaymentMethod()
          Get the payment method.
 java.lang.String getReferenceId()
          Get the reference id.
 java.lang.String getRequestToken()
          Get the request token.
 java.util.Date getStartDate()
          Get the card start date Used by some U.K.
 OrderPaymentStatus getStatus()
          Get the status of the order payment.
 java.lang.String getTransactionType()
          Get the payment transaction type, i.e.
 java.lang.String getUnencryptedCardNumber()
          Decrypts and returns the full credit card number.
 void setAmount(java.math.BigDecimal amount)
          Set the amount of this payment.
 void setAuthorizationCode(java.lang.String authorizationCode)
          Set the authorization code.
 void setCardHolderName(java.lang.String cardHolderName)
          Get the card holder name.
 void setCardNumber(java.lang.String number)
          Set the credit card number.
 void setCardType(java.lang.String cardType)
          Set the vendor/brand of the credit card (e.g.
 void setCreatedDate(java.util.Date createdDate)
          Set the date that the order is created.
 void setCurrencyCode(java.lang.String currencyCode)
          Set the currency code.
 void setCvv2Code(java.lang.String cvv2Code)
          Set the security code (found near the signature on the back of the card).
 void setEmail(java.lang.String email)
          Set the customer's email address (Required for card processing).
 void setExpiryMonth(java.lang.String expiryMonth)
          Set the expiry two-digit date month.
 void setExpiryYear(java.lang.String expiryYear)
          Set the two-digit expiry date year.
 void setGatewayToken(java.lang.String gatewayToken)
          Store the temporary token needed by some payment gateway, i.e.
 void setIssueNumber(java.lang.String issueNumber)
          Set the issue number used by some U.K.
 void setPaymentMethod(java.lang.String paymentMethod)
          Set the payment method such as "C.O.D." or "Verisign".
 void setReferenceId(java.lang.String referenceId)
          Set the reference id.
 void setRequestToken(java.lang.String requestToken)
          Set the request token.
 void setStartDate(java.util.Date startDate)
          Set the cart start date used by some U.K.
 void setStatus(OrderPaymentStatus status)
          Set the status of the order payment.
 void setTransactionType(java.lang.String transactionType)
          Get the payment transaction type, i.e.
 
Methods inherited from class com.elasticpath.domain.impl.AbstractPersistenceImpl
executeBeforePersistAction, getUidPk, isPersistent, setDefaultValues, 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.Persistence
executeBeforePersistAction, getUidPk, isPersistent, setDefaultValues, setUidPk
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Serial version id.

See Also:
Constant Field Values
Constructor Detail

OrderPaymentImpl

public OrderPaymentImpl()
Method Detail

encryptCardNumber

public void encryptCardNumber()
Encrypts the credit card number.

Specified by:
encryptCardNumber in interface OrderPayment

getAmount

public java.math.BigDecimal getAmount()
Get the amount of this payment.

Specified by:
getAmount in interface OrderPayment
Returns:
the amount

getAuthorizationCode

public java.lang.String getAuthorizationCode()
Get the authorization code.

Specified by:
getAuthorizationCode in interface OrderPayment
Returns:
the authorization code

getCardHolderName

public java.lang.String getCardHolderName()
Set the card holder name.

Specified by:
getCardHolderName in interface OrderPayment
Returns:
the name on the card

getCardNumber

public java.lang.String getCardNumber()
Get the encrypted credit cart number.

Specified by:
getCardNumber in interface OrderPayment
Returns:
the credit card number

getCardType

public java.lang.String getCardType()
Get the vendor/brand of the credit card (e.g. VISA).

Specified by:
getCardType in interface OrderPayment
Returns:
the type

getCreatedDate

public java.util.Date getCreatedDate()
Get the date that this order was created on.

Specified by:
getCreatedDate in interface OrderPayment
Returns:
the created date

getCurrencyCode

public java.lang.String getCurrencyCode()
Get the currency code (e.g. CAD or USD).

Specified by:
getCurrencyCode in interface OrderPayment
Returns:
the currency code

getCvv2Code

public java.lang.String getCvv2Code()
Get the card security code (found near the signature on the back of the card).

Specified by:
getCvv2Code in interface OrderPayment
Returns:
the card security code

getEmail

public java.lang.String getEmail()
Get the customer's email address (Required for card processing).

Specified by:
getEmail in interface OrderPayment
Returns:
the customer email address

getExpiryMonth

public java.lang.String getExpiryMonth()
Get the two-digit expiry date month.

Specified by:
getExpiryMonth in interface OrderPayment
Returns:
the two-digit expiry date month

getExpiryYear

public java.lang.String getExpiryYear()
Get the two-digit expiry date year.

Specified by:
getExpiryYear in interface OrderPayment
Returns:
the expiry date year

getGatewayToken

public java.lang.String getGatewayToken()
Return the payment gateway token.

Specified by:
getGatewayToken in interface OrderPayment
Returns:
the temproary payment gateway token.

getIssueNumber

public java.lang.String getIssueNumber()
Get the issue number used by some U.K. cards.

Specified by:
getIssueNumber in interface OrderPayment
Returns:
the issue number

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 OrderPayment
Returns:
the masked credit card number

getPaymentMethod

public java.lang.String getPaymentMethod()
Get the payment method. A payment method could be the name of the payment processor/gateway.

Specified by:
getPaymentMethod in interface OrderPayment
Returns:
the payment method

getReferenceId

public java.lang.String getReferenceId()
Get the reference id.

Specified by:
getReferenceId in interface OrderPayment
Returns:
the reference id.

getRequestToken

public java.lang.String getRequestToken()
Get the request token.

Specified by:
getRequestToken in interface OrderPayment
Returns:
the request token

getStartDate

public java.util.Date getStartDate()
Get the card start date Used by some U.K. cards.

Specified by:
getStartDate in interface OrderPayment
Returns:
the start date

getStatus

public OrderPaymentStatus getStatus()
Get the status of the order payment.

Specified by:
getStatus in interface OrderPayment
Returns:
the order payment status

getTransactionType

public java.lang.String getTransactionType()
Get the payment transaction type, i.e. "Authorization", "Sale" or "Credit".

Specified by:
getTransactionType in interface OrderPayment
Returns:
the payment transaction type

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 OrderPayment
Returns:
the decrypted credit card number

setAmount

public void setAmount(java.math.BigDecimal amount)
Set the amount of this payment.

Specified by:
setAmount in interface OrderPayment
Parameters:
amount - the amount

setAuthorizationCode

public void setAuthorizationCode(java.lang.String authorizationCode)
Set the authorization code.

Specified by:
setAuthorizationCode in interface OrderPayment
Parameters:
authorizationCode - the authorization code

setCardHolderName

public void setCardHolderName(java.lang.String cardHolderName)
Get the card holder name.

Specified by:
setCardHolderName in interface OrderPayment
Parameters:
cardHolderName - the name on the card

setCardNumber

public void setCardNumber(java.lang.String number)
Set the credit card number.

Specified by:
setCardNumber in interface OrderPayment
Parameters:
number - the credit card number

setCardType

public void setCardType(java.lang.String cardType)
Set the vendor/brand of the credit card (e.g. VISA).

Specified by:
setCardType in interface OrderPayment
Parameters:
cardType - the card type

setCreatedDate

public void setCreatedDate(java.util.Date createdDate)
Set the date that the order is created.

Specified by:
setCreatedDate in interface OrderPayment
Parameters:
createdDate - the start date

setCurrencyCode

public void setCurrencyCode(java.lang.String currencyCode)
Set the currency code.

Specified by:
setCurrencyCode in interface OrderPayment
Parameters:
currencyCode - the currency code code

setCvv2Code

public void setCvv2Code(java.lang.String cvv2Code)
Set the security code (found near the signature on the back of the card).

Specified by:
setCvv2Code in interface OrderPayment
Parameters:
cvv2Code - the security code

setEmail

public void setEmail(java.lang.String email)
Set the customer's email address (Required for card processing).

Specified by:
setEmail in interface OrderPayment
Parameters:
email - the customer's email address

setExpiryMonth

public void setExpiryMonth(java.lang.String expiryMonth)
Set the expiry two-digit date month.

Specified by:
setExpiryMonth in interface OrderPayment
Parameters:
expiryMonth - the two digit expiry date month

setExpiryYear

public void setExpiryYear(java.lang.String expiryYear)
Set the two-digit expiry date year.

Specified by:
setExpiryYear in interface OrderPayment
Parameters:
expiryYear - the expiry date year

setGatewayToken

public void setGatewayToken(java.lang.String gatewayToken)
Store the temporary token needed by some payment gateway, i.e. PayPal to complete the process.

Specified by:
setGatewayToken in interface OrderPayment
Parameters:
gatewayToken - payment gateway token

setIssueNumber

public void setIssueNumber(java.lang.String issueNumber)
Set the issue number used by some U.K. cards.

Specified by:
setIssueNumber in interface OrderPayment
Parameters:
issueNumber - the issue number

setPaymentMethod

public void setPaymentMethod(java.lang.String paymentMethod)
Set the payment method such as "C.O.D." or "Verisign".

Specified by:
setPaymentMethod in interface OrderPayment
Parameters:
paymentMethod - the payment method

setReferenceId

public void setReferenceId(java.lang.String referenceId)
Set the reference id.

Specified by:
setReferenceId in interface OrderPayment
Parameters:
referenceId - the reference id

setRequestToken

public void setRequestToken(java.lang.String requestToken)
Set the request token.

Specified by:
setRequestToken in interface OrderPayment
Parameters:
requestToken - the request token

setStartDate

public void setStartDate(java.util.Date startDate)
Set the cart start date used by some U.K. cards.

Specified by:
setStartDate in interface OrderPayment
Parameters:
startDate - the start date

setStatus

public void setStatus(OrderPaymentStatus status)
Set the status of the order payment.

Specified by:
setStatus in interface OrderPayment
Parameters:
status - the status of the order payment

setTransactionType

public void setTransactionType(java.lang.String transactionType)
Get the payment transaction type, i.e. "Authorization", "Sale" or "Credit".

Specified by:
setTransactionType in interface OrderPayment
Parameters:
transactionType - the payment transaction type