| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- package com.zipcoder.payment;
-
- public class CreditCard implements Payment {
-
- Long id;
- String payerName;
- String number;
- int expiredMonth;
- int expiredYear;
-
- public CreditCard(){}
-
- public CreditCard(String payerName, String number, int expiredMonth, int expiredYear){
- this.payerName = payerName;
- this.number = number;
- this.expiredMonth = expiredMonth;
- this.expiredYear = expiredYear;
- }
-
- public Long getId() {
- return id;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- public String getPayerName() {
- return payerName;
- }
-
- public void setPayerName(String payerName) {
- this.payerName = payerName;
- }
-
- public String getNumber() {
- return number;
- }
-
- public void setNumber(String number) {
- this.number = number;
- }
-
- public int getExpiredMonth() {
- return expiredMonth;
- }
-
- public void setExpiredMonth(int expiredMonth) {
- this.expiredMonth = expiredMonth;
- }
-
- public int getExpiredYear() {
- return expiredYear;
- }
-
- public void setExpiredYear(int expiredYear) {
- this.expiredYear = expiredYear;
- }
-
- public Long getID() {
- return null;
- }
-
- public String getShortDescription() {
- String result = "CC " + getPayerName() + " " + getLastFourDigits() + " " + getExpiredMonth() + "/" + getExpiredYear();
- return result;
- }
-
- public String getLastFourDigits(){
- String lastFour = number.substring(number.length()-4);
- return lastFour;
- }
-
- }
|