paymentRequest API documentation tells that a merchant can provide details to browser of what all kinds of card it supports. My question is how does browser knows the card types stored by the user and filter it.
How does paymentRequest API distinguish between debit, credit and other categories cards?
87 views Asked by Jagajit Prusty At
1
Let me talk about Chrome in particular. Chrome's credit card autofill storage sources from 2 places:
For 2, Google server knows type of cards from their numbers. So they can be filtered. For 1, Chrome does not have a way to distinguish them so all available cards will be exposed without being filtered.
It may depend on implementations, but payment gateways should be able to handle card numbers gracefully without knowing their types. I've confirmed Stripe does at least.
If you do need to check the type of cards, there are online services like https://binlist.net/ which tells you meta information about a card from its first few digits.