Support (offered by community volunteers) > Community Sponsored Improvements
USB card swiper support
jcm55:
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/
Donald Lobo:
very cool indeed :)
thanx for sharing
lobo
kmarkley:
This is really awesome. I can't wait to try it out.
How/where do I need to install the javascript?
jcm55:
Sorry if I wasn't clear -- you don't need to download the code from the acmetech.com link. It's already included in the modified BillingBlock.tpl I attached to the original post.
The link is just for full disclosure about where the included swipeParser code originated from.
-j
kmarkley:
Just to double check, this needs a keyboard-emulator-type reader and not a HID-type reader, correct?
Navigation
[0] Message Index
[#] Next page
Go to full version