简体   繁体   中英

How to check whether a card is a credit card or debit card

我正在构建一个我正在使用条纹付款的android应用程序,所以在我的应用程序中我只想接受借记卡。所以在android应用程序中创建令牌时,有什么方法可以检查它是信用卡还是借记卡。

When you tokenize a credit card in Stripe, your get a Token object back as documented here . It has a card hash that contains the funding property documented here :

Card funding type. Can be credit, debit, prepaid, or unknown

You can use this parameter to know what type of cards the customer is using and react accordingly.

The magnetic strips on the card have more information than just numbers. And coming to your problem, the user always knows what card he has , so you can directly ask the user and store that information in your database.

Some info about magnetic strips https://en.wikipedia.org/wiki/Magnetic_stripe_card

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM