Package org.salespointframework.payment
Class PaymentCard
java.lang.Object
org.salespointframework.payment.PaymentMethod
org.salespointframework.payment.PaymentCard
- All Implemented Interfaces:
Serializable
,org.jmolecules.ddd.types.ValueObject
- Direct Known Subclasses:
CreditCard
,DebitCard
A
PaymentCard
is used to charge the cost of goods or services to an account, belonging to the party
identified on the card. A PaymentCard
which has a line of credit is a CreditCard
. A
DebitCard
is a PaymentCard
where the associated account is debited immediately. An example for a
DebitCard
is an EC-card or MaestroCard. Other forms of PaymentCard
s such as prepaid cards or charge
cards are not implemented at the moment.- Author:
- Hannes Weisbach, Oliver Gierke
- See Also:
-
Constructor Summary
ConstructorDescriptionPaymentCard
(String cardName, String cardAssociationName, String cardNumber, String nameOnCard, String billingAddress, LocalDateTime validFrom, LocalDateTime expiryDate, String cardVerificationCode) Instantiates aPaymentCard
. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
The billing address registered with this card.The name of the card association.The number uniquely identifying this payment card.The verification code of this card.The date on which the card expires.The name of the party to which the card was issued to.The date from which on the card is valid.int
hashCode()
toString()
-
Constructor Details
-
PaymentCard
public PaymentCard(String cardName, String cardAssociationName, String cardNumber, String nameOnCard, String billingAddress, LocalDateTime validFrom, LocalDateTime expiryDate, String cardVerificationCode) Instantiates aPaymentCard
.- Parameters:
cardName
- specific name of this card, e.g. VISA, or MasterCardcardAssociationName
- the name of the association which issued the cardcardNumber
- the number of this cardnameOnCard
- name of the card ownerbillingAddress
- the address to which account statements are sentvalidFrom
- date from which the card is validexpiryDate
- date on which the card expirescardVerificationCode
- verification code printed on the card or a PIN
-
-
Method Details
-
toString
- Overrides:
toString
in classPaymentMethod
-
getCardAssociationName
The name of the card association. -
getCardNumber
The number uniquely identifying this payment card. -
getNameOnCard
The name of the party to which the card was issued to. -
getBillingAddress
The billing address registered with this card. -
getValidFrom
The date from which on the card is valid. -
getExpiryDate
The date on which the card expires. -
getCardVerificationCode
The verification code of this card. -
equals
- Overrides:
equals
in classPaymentMethod
-
canEqual
- Overrides:
canEqual
in classPaymentMethod
-
hashCode
public int hashCode()- Overrides:
hashCode
in classPaymentMethod
-