Connect a credit card reader to web application?

ajsie picture ajsie · Mar 9, 2011 · Viewed 22k times · Source

Is there a way to connect a card reader to my web application (javascript) so that the user don't have to manually type in the credit card information?

This web app is for buying products on a store. The user clicks on what items he want to purchase and then he swipes the credit card in the reader and he will get a receipt.

Answer

AngeloS picture AngeloS · Mar 13, 2012

Actually, it is possible due to the fact that simple USB card readers act as keyboard input devices. Since it acts as a keyboard input, once an inputbox is in focus you could swipe the card, push it to a hidden field using some nifty jQuery etc and then process it from there.

Please see my answer on that question that Maris linked to.

EDIT: 2/2016

I created a GitHub Gist with a very simple jQuery implementation.