I've implemented this by overriding CRM/Core/BillingBlock.tpl and inserting a "CC swipe data" field just before the card number field. That field has an onkeypress attribute set which calls some javascript at the end of the template to parse the CC track data and insert the values into the appropriate fields on the form. This part works very well. Just position your cursor in the "swipe data" field, swipe the card in the USB reader, and voila! CC fields all filled out with data.
The javascript also takes some other actions like:
- set the participant role to "Attendee"
- set participant status to "Attended"
- set the source field to "Walk-up ticket sale"
- insert the cardholder name into the contact field
I've been testing this custom template with this URL path:
civicrm/participant/add?reset=1&action=add&context=standalone&mode=live&eid=[eventID]
Appending the "eid" param loads the form with a specific event already selected.
With the custom template and the mode and eid params appended to the URL, I am getting pretty close to a decent live POS screen for credit card payments.
My customized BillingBlock.tpl is attached. The javascript that actually parses the CC track data is from here:
http://www.acmetech.com/blog/magnetic-track-data-parsers/