Automating the card reader

I am working on Point of sale application in andriod and iOS.There is a scenario in which data in the credit card fields like credit card number,expiry,cvv …etc is getting entered after swiping the card.is it possible to automate this scenario?need suggestions on this case.anyone please help