Re:How to read CC data from MagTek reader into web form?
by s1mpl3 on Thursday August 10, 2017 @05:20PM
(#14984411)
Interesting, that's really useful. But, assuming I have MagTek connected via USB to the computer, how does this code "listen" for the swipe? It looks like it can handle parsing the data just fine, but my question is how to get the data from the swipe into the javascript for parsing
[ Parent
| on HN ]
Re:How to read CC data from MagTek reader into web form?
by ryduh on Thursday August 10, 2017 @05:57PM
(#14984714)
The MagTek reader acts as a USB HID (aka a keyboard). When the cursor focus is put on a text field and you swipe a card, the MagTek device acts as if someone typed each character into the field. Then the javascript detects that and parses it out