How to tell credit card's country of origin by its number?
-
18-06-2021 - |
Question
I'm trying to develop an application, which would give access to different services for people from different regions of the world.
Let's say, someone enters card number 1111-1111-1111-1111 . How do I use it to tell the country of origin?
I know that this is possible, because paypal and apple do it.
Solution
At first, I questioned whether this information could be gleened from the credit card number alone.
Then I found it here:
http://en.wikipedia.org/wiki/List_of_Bank_Identification_Numbers
Edit - Don't forget about PCI Compliance if you are taking credit card numbers for payment.
Edit - Apparently the previous wikipedia page has been deleted. This appears to have similar information.
OTHER TIPS
Use BinList. It simply tells you the country of origin by checking the first 6 digits of the card number. It has a neat Json based API as well.
checkout https://binlist.io/ opensource and it looks like they have a maintained csv file on their github page: https://github.com/iannuttall/binlist-data