This runs a node child_process that executes a python program which
listens in on a magtek card reader and returns the raw track data
Added support for Synchronous and Asynchronous calls
In order to make this work we need 3 things
- MagTek Card Swiper
- at least Python 2.7 installed with python libraries installed as well
- this npm package
$ sudo apt-get install libusb-1.0-0 $ sudo -H pip install pyusb --pre --upgrade $ npm install node-card-capture varcardCapture=require('node-card-capture').cardCapturevarcardCaptureSync=require('node-card-capture').cardCaptureSync// Synchronous call aka Stops everything until it's donevartrackdata=cardCaptureSync()console.log(trackdata)// Asynchronous call aka will return when done and is non blockingcardCapture(function(trackdata){console.log(trackdata)})