2

I am developing an application that accepts credit card track data from a USB credit card (swipe) reader. The credit card magnetic strip provides Track1 and Track2.

If the data from Track1 is unreadable or damaged, you can get the same information from the Track2 data.

How can you programmatically tell if the Track1 data is damaged?

This application is written in C# using the .NET Framework. I am using PayPal as my payment gateway service to process credit card transactions.

Michael Kniskern
  • 24,792
  • 68
  • 164
  • 231

1 Answers1

1

There is a checksum on each track.

How this checksum is delivered depends on the hardware and card type. Usually it is simply included at the end. This is especially true with the HID and Serial versions.

Some card readers calculate the checksum and verify the data themselves. Finally, of course, it is possible to have bad data even though checksum shows it as correct. This is rare though.

A second method is to verify the credit card using Luhn.

Brad
  • 159,648
  • 54
  • 349
  • 530