Package com.scriptel.proscript.input
Class MagneticCardSwipe
- java.lang.Object
-
- com.scriptel.proscript.input.MagneticCardSwipe
-
public final class MagneticCardSwipe extends java.lang.Object
This class represents a swipe of a magnetic swipe card on an equipped ScripTouch device.
-
-
Field Summary
Fields Modifier and Type Field Description static int
CARD_FORMAT_FINANCIAL
Card is a financial card.static int
CARD_FORMAT_IDENTITY
Card is an identity card.static int
CARD_FORMAT_UNKNOWN
Card type is unknown.static int
TRACK_STATUS_CORRUPT
Track failed CRC.static int
TRACK_STATUS_PARITY_ERROR
Track encountered a parity error.static int
TRACK_STATUS_UNKNOWN_FORMAT
Track is an unknown format.static int
TRACK_STATUS_VALID
Track status is valid.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCardFormat()
Gets the card format.java.lang.String
getCardFormatString()
Gets the card format as a readable string.java.lang.String
getTrackOne()
Gets track oneint
getTrackOneStatus()
Gets track one status.java.lang.String
getTrackOneStatusString()
Gets the track one status as a string.static java.lang.String
getTrackStatusString(int status)
Gets a track status as a string.java.lang.String
getTrackThree()
Gets track threeint
getTrackThreeStatus()
Gets track three status.java.lang.String
getTrackThreeStatusString()
Track three status as string.java.lang.String
getTrackTwo()
Gets track twoint
getTrackTwoStatus()
Gets track two status.java.lang.String
getTrackTwoStatusString()
Track two status as string.FinancialCard
parseAsFinancialCard()
Attempts to parse this card as a financial card.IdentificationCard
parseAsIdentificationCard()
Attempts to parse this card as an identification card.java.lang.String
toString()
Prints this object as a human readable string.
-
-
-
Field Detail
-
CARD_FORMAT_FINANCIAL
public static final int CARD_FORMAT_FINANCIAL
Card is a financial card.- See Also:
- Constant Field Values
-
CARD_FORMAT_IDENTITY
public static final int CARD_FORMAT_IDENTITY
Card is an identity card.- See Also:
- Constant Field Values
-
CARD_FORMAT_UNKNOWN
public static final int CARD_FORMAT_UNKNOWN
Card type is unknown.- See Also:
- Constant Field Values
-
TRACK_STATUS_VALID
public static final int TRACK_STATUS_VALID
Track status is valid.- See Also:
- Constant Field Values
-
TRACK_STATUS_PARITY_ERROR
public static final int TRACK_STATUS_PARITY_ERROR
Track encountered a parity error.- See Also:
- Constant Field Values
-
TRACK_STATUS_UNKNOWN_FORMAT
public static final int TRACK_STATUS_UNKNOWN_FORMAT
Track is an unknown format.- See Also:
- Constant Field Values
-
TRACK_STATUS_CORRUPT
public static final int TRACK_STATUS_CORRUPT
Track failed CRC.- See Also:
- Constant Field Values
-
-
Method Detail
-
parseAsFinancialCard
public FinancialCard parseAsFinancialCard()
Attempts to parse this card as a financial card.- Returns:
- Financial card object if the card type matches, null otherwise.
-
parseAsIdentificationCard
public IdentificationCard parseAsIdentificationCard()
Attempts to parse this card as an identification card.- Returns:
- Identification card object if the card type matches, null otherwise.
-
toString
public java.lang.String toString()
Prints this object as a human readable string.- Overrides:
toString
in classjava.lang.Object
- Returns:
- Human readable string.
-
getCardFormatString
public java.lang.String getCardFormatString()
Gets the card format as a readable string.- Returns:
- Card format.
-
getTrackOneStatusString
public java.lang.String getTrackOneStatusString()
Gets the track one status as a string.- Returns:
- Track one status as string.
-
getTrackTwoStatusString
public java.lang.String getTrackTwoStatusString()
Track two status as string.- Returns:
- Track two status as string.
-
getTrackThreeStatusString
public java.lang.String getTrackThreeStatusString()
Track three status as string.- Returns:
- Track three status as string.
-
getTrackStatusString
public static java.lang.String getTrackStatusString(int status)
Gets a track status as a string.- Parameters:
status
- Track status- Returns:
- Track status as string.
-
getCardFormat
public int getCardFormat()
Gets the card format.- Returns:
- the cardFormat
-
getTrackOneStatus
public int getTrackOneStatus()
Gets track one status.- Returns:
- the trackOneStatus
-
getTrackTwoStatus
public int getTrackTwoStatus()
Gets track two status.- Returns:
- the trackTwoStatus
-
getTrackThreeStatus
public int getTrackThreeStatus()
Gets track three status.- Returns:
- the trackThreeStatus
-
getTrackOne
public java.lang.String getTrackOne()
Gets track one- Returns:
- the trackOne
-
getTrackTwo
public java.lang.String getTrackTwo()
Gets track two- Returns:
- the trackTwo
-
getTrackThree
public java.lang.String getTrackThree()
Gets track three- Returns:
- the trackThree
-
-