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

public abstract class PaymentCard extends PaymentMethod
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 PaymentCards such as prepaid cards or charge cards are not implemented at the moment.
Author:
Hannes Weisbach, Oliver Gierke
See Also:
  • Constructor Details

    • PaymentCard

      public PaymentCard(String cardName, String cardAssociationName, String cardNumber, String nameOnCard, String billingAddress, LocalDateTime validFrom, LocalDateTime expiryDate, String cardVerificationCode)
      Instantiates a PaymentCard.
      Parameters:
      cardName - specific name of this card, e.g. VISA, or MasterCard
      cardAssociationName - the name of the association which issued the card
      cardNumber - the number of this card
      nameOnCard - name of the card owner
      billingAddress - the address to which account statements are sent
      validFrom - date from which the card is valid
      expiryDate - date on which the card expires
      cardVerificationCode - verification code printed on the card or a PIN
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class PaymentMethod
    • getCardAssociationName

      public String getCardAssociationName()
      The name of the card association.
    • getCardNumber

      public String getCardNumber()
      The number uniquely identifying this payment card.
    • getNameOnCard

      public String getNameOnCard()
      The name of the party to which the card was issued to.
    • getBillingAddress

      public String getBillingAddress()
      The billing address registered with this card.
    • getValidFrom

      public LocalDateTime getValidFrom()
      The date from which on the card is valid.
    • getExpiryDate

      public LocalDateTime getExpiryDate()
      The date on which the card expires.
    • getCardVerificationCode

      public String getCardVerificationCode()
      The verification code of this card.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class PaymentMethod
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class PaymentMethod
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class PaymentMethod