Card Swipe to populate text field.

Hello Everyone,

I have currently been working on a POS app for a client using Corona SDK. As of right now it’s pretty much complete and it works great.  I have one last question/problem however. 

My client wants people to type in their credit card info but not be charged until their product ships. They will take care of it on there end, so basically they just want to store peoples credit info and then bill to it once they ship the order. Currently I have a system in place where people type in their credit card info and hit submit and the info is saved to a database which is then exported to a secure location at the end of the day. This works perfect, however the client wants the process to be quicker. Rather then typing in all of the credit card info manually, ideally we would have a card reader that would read the card then populate those fields automatically. 

So basically I was wondering if there is a specific card reader that could integrate with Corona to save/write the cards info directly to specific text boxes/ fields. This way rather then manually typing in the info each time it would just be a quick swipe of a card. I’m not sure if this is possible or if there is any utility out there that allows me to just take the data scanned and place it in the app rather then using some external service to charge the card. 

The app is only for my client and will be on an Android tablet so I do NOT need a solution for IOS or something that complies with app store policy. 

Thank you!

-B

Hi @bkove12.

Corona’s API’s for the simulator doesn’t include anything to read a card swiper. If your swiper is attached via bluetooth, there are various Marketplace plugins that will let you read bluetooth. I’m unaware of any plugins that will read from a swiper attached to the headphone port.  Clearly card readers work, so there is a way from native code to make that happen.

This is where Corona Native comes in, you can use Android Studio to build in features we don’t support. There is probably existing code that can be found in Java that will read the headphone port for data. You could then use it directly or make you’re own plugin to read the data and return it to Corona/Lua and once you have it, populate your text fields.

You didn’t say if you’re using the Square reader or the Paypal reader or something else. You may be able to find existing SDK’s for your specific reader that might make it easier than reading the headphone port and manually parsing the data coming from it.

Rob

Hello Rob,

Thanks for the reply. Currently I don’t have either paypal or square as I didn’t want to purchase anything until I knew it would work. If I found a bluetooth card reader do you think I could read the data from that? I have limited time to finish this so I’m not entirely sure if I could use the other options you have listed. 

Thanks!

-B

Wouldn’t the client’s credit card processing service have their own reader requirements?  You can’t get a square reader or paypal reader without having them as your provider.

You would have to buy the blue tooth reader, and test it against the plugins that are in the Marketplace and then convince your client that’s the reader they need to use.  

Rob

I’m not sure. Originally I was going to use the Paypal service and reader however now my client just wants the info stored so the customer isn’t charged right away. I’ll look into the marketplace plugins.

Thank you for your help.

-B

Storing credit card info in the app? I hope you have a strong contract with them that indemnifies you when they get hacked.

On the non-scary side of things, interesting problem. If you find a solution I hope you post it here. :slight_smile:

 Jay

Hi @bkove12.

Corona’s API’s for the simulator doesn’t include anything to read a card swiper. If your swiper is attached via bluetooth, there are various Marketplace plugins that will let you read bluetooth. I’m unaware of any plugins that will read from a swiper attached to the headphone port.  Clearly card readers work, so there is a way from native code to make that happen.

This is where Corona Native comes in, you can use Android Studio to build in features we don’t support. There is probably existing code that can be found in Java that will read the headphone port for data. You could then use it directly or make you’re own plugin to read the data and return it to Corona/Lua and once you have it, populate your text fields.

You didn’t say if you’re using the Square reader or the Paypal reader or something else. You may be able to find existing SDK’s for your specific reader that might make it easier than reading the headphone port and manually parsing the data coming from it.

Rob

Hello Rob,

Thanks for the reply. Currently I don’t have either paypal or square as I didn’t want to purchase anything until I knew it would work. If I found a bluetooth card reader do you think I could read the data from that? I have limited time to finish this so I’m not entirely sure if I could use the other options you have listed. 

Thanks!

-B

Wouldn’t the client’s credit card processing service have their own reader requirements?  You can’t get a square reader or paypal reader without having them as your provider.

You would have to buy the blue tooth reader, and test it against the plugins that are in the Marketplace and then convince your client that’s the reader they need to use.  

Rob

I’m not sure. Originally I was going to use the Paypal service and reader however now my client just wants the info stored so the customer isn’t charged right away. I’ll look into the marketplace plugins.

Thank you for your help.

-B

Storing credit card info in the app? I hope you have a strong contract with them that indemnifies you when they get hacked.

On the non-scary side of things, interesting problem. If you find a solution I hope you post it here. :slight_smile:

 Jay