I want to integrate card swipe feature 开发者_JS百科in my application using unimag card reader device provided by ID Tech. It provides name, account number and expiry date in a single string. But no information about the card type. Is there a way to retrieve the information about the "The type of Card" user hols. Like visa, master, etc.
Card type is determine from first couple of digits
example code here http://cuinl.tripod.com/Tips/o-1.htm
a quick google for implementations :-)
The cliff notes version:
If card starts with:
3 - Amex (15 digits)
4 - Visa (13-19 digits, usually 16)
5 - Mastercard (16 digits)
6 - Discover (16 digits)
There are some other more rare card types like JCB and Diners which you might need to account for if your solution has to deal with those.
精彩评论