0

Trying out Carl Raymond's jquery.cardswipe plugin, but having difficulties with the demo-simple.html. jquery.cardswipe

It is configured to do a callback to a success() function that simply writes the resulting data set (parsed from the input of a magnetic stripe card reader) and display it on the webpage. I've verified the card reader by itself is reading data successfully from some custom ID badges into Notepad. When using the demo-simple.html example with the debug parameter set, the console displays the array of chars that were read in from the card (which indicates the plugin is getting data). BUT the success() function never gets called and never generates the display text it should. To troubleshoot it, I added a console.log in the success function, but it never gets called. I've tried it with the generic parser, as well as a custom one that I based off the help example.

Anyone that has experience with this plugin have ideas of what I'm missing?

1 Answers1

1

After looking closer at the jquery.cardswipe.js code and checking the console in debug mode, I found two mistakes I had made.

First: This plugin expect the card data to be encoded to contain a letter for the second character (mine had a digit).

Second: The RegExp expression syntax used in my custom parser was incorrect.

Hopefully, this may help others that are new to using card scanners with custom magnetic stripe encoding.