CarlRaymond / jquery.cardswipe

jQuery plugin for magnetic card readers
MIT License
115 stars 49 forks source link

I'm getting "+" as the start sentinel for Track 3 #8

Closed Sam-Hall closed 9 years ago

Sam-Hall commented 9 years ago

Track 3 wasn't showing up on the demo until I messed with the regexp to accept a plus for that track: var pattern = new RegExp("^(%[^%;\\?]+\\?)(;[0-9\\:<>\\=]+\\?)?([+;][0-9\\:<>\\=]+\\?)?","i");

I have two slightly different models of card reader and both of these output "+" to denote the start of track 3 data. Other than that minor detail, this plugin is exactly what I needed. Thanks.

Sam-Hall commented 9 years ago

Also, can I offer the following suggestion so the default parser will trim off the sentinel characters (in the cardData)... line1: match[1] ? match[1].substr(1, match[1].length-2) : ""

CarlRaymond commented 9 years ago

Thanks. These are good suggestions, and I'll incorporate them.

What kind of card are you scanning? I don't have any 3-track cards, so I'm not surprised to hear there's a bug.

Sam-Hall commented 9 years ago

These are just standard 3 track HiCo magstripe cards, we print them ourselves for several different applications. Track 3 was not in use, but I've started adding a variable length ID number for another application.

CarlRaymond commented 9 years ago

Fix incorporated in "events" branch.