iPhone app: integrating a Mag Strip Reader

curiouswebster used Ask the Experts™
I know someone who publishes an iPhone app which currently has an input field for the credit card number. But, this means the user must type it in, which is error prone and slow. So, I hope to reconfigure without even any coding changes to the app.

This is the kind of device I need to use...





My question is...

Can one of these be used along with the app, on an iPhone, to get that credit card number into that field, but do so without  requiring any modifications to the app?

I see that some require a merchant account, and those will not work. The app I am describing must run and communicate with the server. It can not use an existing app to transmit the information.

All I need is a way to automate the manual key entry of the credit card #. So, can any of these readers be configured to insert the credit card # into that field?

I suppose, worst case, if the card reader inserted the CC# into a note, so it could be copied and pasted, that might be better.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016
normally they act like a keyboard so you need an open text box waiting for input
curiouswebsterSoftware Engineer


That may work fine, then. There is an open text field, expecting 16 digits, 0-9.
Developer & EE Moderator
Fellow 2018
Most Valuable Expert 2013
There are going to a couple of types of readers.  The "old" way was as David suggests.  They are simply a keyboard emulator where a swipe will read 1 to 3 tracks of data to the device and your coding has to extract the data required for the individual processor.

With these types of readers, the data goes from the reader to the device to the processor in clear text.  You can accept the data to a form field or submit automatically. Either way, it is going to be treated as card not present (the same as typing it to a form) in most cases. The card not present discount rate is higher meaning it will cost more.  This method also requires the device to be PCI compliant and for that reason was typically used only for machines that you have control of such as a POS or computer at your retail store or office.  

You can not make a phone or device that you do not have control over pci compliant on your own and therefore, it is likely that your credit card processor will allow these devices to be used.

Instead, the processor will typically have a pre-approved list of readers that you can use. Some processors may require you purchase through them.  The types of card readers that will be approved will not allow to send clear text through the device. Instead, the card reader will encrypt the credit card data before you "get access" to it (passing through the phone).  The reader's device may have to have it's own app installed or be part of your own app where the reader's app sends the data to the gateway and you do not have access to what is sent, only the returned data.  

The returned data is typically  a reason code for being denied or an approval where the approval also returns additional data about the card that you will be allowed to store in your database.

Before spending money on these, the first place to start is your credit card processor and get their specs.
curiouswebsterSoftware Engineer



Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial