Monday, May 26, 2014

Using Point of Sale Hardware in the Cloud

I recently started a new venture that required the use of a USB Barcode Scanner and Credit Card Reader on a website with only Javascript to process them and found it's much easier to handle than one might think.

The first thing you need to understand is this: these USB devices act exactly like keyboards.

  • They scan your barcode/credit card
  • They transmit the scanned data via `keypress` events
  • Once data is finished and keyCode 13 is sent

Using those rules above I started a simple, yet effective POS plugin built for jQuery, which you are free to use, upgrade for your own needs or contribute to.

Learn more on the gitHub page: http://the-letter-e-production.github.io/jquery-pos/

Known Issues:

  •  Currently the plugin only supports devices which return a keyCode 13 at EOD
  • Currently the barcode scanning plugin by default only supports digit only barcodes, but allows Regular Expression options to support other types, if overridden by you