CardData class

Immutable value object representing all data read from a payment card.

Use the named factory constructors (fromNfc, fromOcr, fromManual) to create instances — they automatically tag the readMode and detect the cardType from the BIN.

Constructors

CardData({required String pan, String? expiryDate, String? cvv, String? cardholderName, required CardType cardType, required CardReadMode readMode, required DateTime timestamp})
const
CardData.fromManual({required String pan, required String expiryDate, String? cvv, String? cardholderName})
factory
CardData.fromNfc({required String pan, required String expiryDate, String? cardholderName})
factory
CardData.fromOcr({required String pan, String? expiryDate})
OCR result. expiryDate is optional — PAN-first scanning may complete without a confidently read expiry.
factory

Properties

cardholderName String?
Cardholder name as printed on the card (optional).
final
cardType CardType
Payment network detected from the BIN.
final
cvv String?
Card Verification Value (optional — not available from NFC/OCR).
final
expiryDate String?
Expiry date in MM/YY format.
final
formattedPan String
PAN formatted according to the card network's standard grouping.
no setter
hashCode int
The hash code for this object.
no setterinherited
maskedPan String
PAN with all but the last four digits replaced by *.
no setter
pan String
Primary Account Number (digits only, no separators).
final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
readMode CardReadMode
Channel through which this data was acquired.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
timestamp DateTime
UTC timestamp when the data was captured.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited