Closed Sam-Hall closed 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) : ""
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.
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.
Fix incorporated in "events" branch.
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.