public class FinancialCard
extends java.lang.Object
Constructor and Description |
---|
FinancialCard() |
Modifier and Type | Method and Description |
---|---|
FinancialCardIssuer |
getIssuer()
Gets the card issuer determined based on card number patterns.
|
FinancialCardTrackOne |
getTrackOne()
Gets track one.
|
FinancialCardTrackTwo |
getTrackTwo()
Gets track two.
|
boolean |
isNumberValid()
Gets whether or not the credit card number passes Luhn's algorithm.
|
static FinancialCard |
parse(java.lang.String cardData)
This method takes the raw card data from the swipe and attempts to
extract financial card data.
|
void |
setIssuer(FinancialCardIssuer issuer)
Sets the card issuer.
|
void |
setNumberValid(boolean numberValid)
Sets whether or not the credit card number passes Luhn's algorithm.
|
void |
setTrackOne(FinancialCardTrackOne trackOne)
Sets track one.
|
void |
setTrackTwo(FinancialCardTrackTwo trackTwo)
Sets track two.
|
java.lang.String |
toString()
Returns this object as a human readable string.
|
static boolean |
verifyCardChecksum(java.lang.String cardNumber)
This method takes a card number and applies Luhn's algorithm to verify
the card checksum.
|
public static FinancialCard parse(java.lang.String cardData)
cardData
- Raw magnetic strip data.public java.lang.String toString()
toString
in class java.lang.Object
public static boolean verifyCardChecksum(java.lang.String cardNumber)
cardNumber
- Card number to verify.public FinancialCardTrackOne getTrackOne()
public void setTrackOne(FinancialCardTrackOne trackOne)
trackOne
- the trackOne to setpublic FinancialCardTrackTwo getTrackTwo()
public void setTrackTwo(FinancialCardTrackTwo trackTwo)
trackTwo
- the trackTwo to setpublic boolean isNumberValid()
public void setNumberValid(boolean numberValid)
numberValid
- the numberValid to setpublic FinancialCardIssuer getIssuer()
public void setIssuer(FinancialCardIssuer issuer)
issuer
- Card issuer.