track_data Property
Magnetic stripe data read off the credit card.
Syntax
def get_track_data() -> str: ... def set_track_data(value: str) -> None: ...
track_data = property(get_track_data, set_track_data)
Default Value
""
Remarks
This property may be set with the magnetic stripe read off the back of a credit card using any commercially available card reader. You may set this property with either Track1 or Track2 data. If track_data is set, the values contained in card_number, card_exp_month, and card_exp_year are ignored when calling validate_card. Instead, these properties are parsed out of the track data. This allows you to easily retrieve the expiration date and card number from either Track1 or Track2 data. For instance:
CardValidator1.TrackData = "4012000033330026=21121015432112345678" CardValidator1.ValidateCard()
The card_number, card_exp_month, and card_exp_year will now contain the values parsed from the track data. track_type will also indicate whether the track_data is Track1 or Track2 (in this case, it's Track2 data).