Class CardHolder
java.lang.Object
org.jpos.core.CardHolder
- All Implemented Interfaces:
Serializable, Cloneable, Loggeable
- Since:
- jPOS 1.1 This class is called 'CardHolder', but a better name could have been 'Card' At some point we'll deprecate this one and create a new 'Card' class.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptioncreates an empty CardHolderCardHolder(String track2) creates a new CardHolder based on track2CardHolder(String pan, String exp) creates a new CardHolder based on pan and expCardHolder(ISOMsg m) Construct a CardHolder based on content received on field 35 (track2) or field 2 (PAN) + field 14 (EXP) -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(PrintStream p, String indent) dumps CardHolder basic information
by default we do not dump neither track1/2 nor securityCode for security reasons.booleangetBIN()Get the traditional 6-digit BIN (Bank Issuer Number) from the PANgetBIN(int len) Get the firstlendigits from the PAN.getEXP()Get Expiration DategetPAN()Deprecated.use getTrailer()inthashCode()booleanbooleanbooleanbooleanY2K compliant expiration checkbooleanY2K compliant expiration checkbooleanstatic booleanisValidCRC(String p) voidextract pan/exp/trailler from track2booleanvoidSet Expiration DatevoidSets Primary Account NumbervoidsetSecurityCode(String securityCode) assigns securityCode to this CardHolder objectvoidvoidsetTrailer(String trailer) voidsetTrailler(String trailer) Deprecated.use setTrailer
-
Field Details
-
pan
-
exp
-
trailer
-
securityCode
Optional security code (CVC, CVV, Locale ID, wse) -
track1
-
-
Constructor Details
-
CardHolder
public CardHolder()creates an empty CardHolder -
CardHolder
creates a new CardHolder based on track2- Parameters:
track2- cards track2- Throws:
InvalidCardException
-
CardHolder
creates a new CardHolder based on pan and exp- Throws:
InvalidCardException
-
CardHolder
Construct a CardHolder based on content received on field 35 (track2) or field 2 (PAN) + field 14 (EXP)- Parameters:
m- an ISOMsg- Throws:
InvalidCardException
-
-
Method Details
-
parseTrack2
extract pan/exp/trailler from track2- Parameters:
s- a valid track2- Throws:
InvalidCardException
-
setTrack1
-
getTrack1
-
hasTrack1
- Returns:
- true if we have a track1
-
getNameOnCard
- Returns:
- the Name written on the card (from track1)
-
getTrack2
-
hasTrack2
- Returns:
- true if we have a (may be valid) track2
-
setSecurityCode
assigns securityCode to this CardHolder object- Parameters:
securityCode- Card's security code
-
getSecurityCode
- Returns:
- securityCode (or null)
-
hasSecurityCode
- Returns:
- true if we have a security code
-
getTrailler
-
setTrailler
Deprecated.use setTrailerSet Card's trailer- Parameters:
trailer- Card's trailer
-
getTrailer
-
setTrailer
-
setPAN
Sets Primary Account Number- Parameters:
pan- Primary Account NUmber- Throws:
InvalidCardException
-
getPAN
-
getBIN
-
getBIN
-
setEXP
Set Expiration Date- Parameters:
exp- card expiration date- Throws:
InvalidCardException
-
getEXP
-
isExpired
Y2K compliant expiration check- Returns:
- true if card is expired (or expiration is invalid)
-
isExpired
-
isValidCRC
-
isValidCRC
-
dump
dumps CardHolder basic information
by default we do not dump neither track1/2 nor securityCode for security reasons. -
getServiceCode
- Returns:
- ServiceCode (if available) or a String with three blanks
-
seemsManualEntry
-
hashCode
-
equals
-