如何区分借记卡和信用卡
如何确定一个人输入的卡是借记卡、支票卡还是信用卡?
我只考虑美国的网络支付。这是用于公用事业计费的。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如何确定一个人输入的卡是借记卡、支票卡还是信用卡?
我只考虑美国的网络支付。这是用于公用事业计费的。
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(9)
我见过的用于检查卡类型的最佳代码是位于 http://www.eflo 的 Javascript 页面。 net/mod10.htm - 可以根据您的要求区分 VISA 借记卡和信用卡,以及许多其他卡的变体。我已经很容易地将这段代码移植到 C# 中。
您的另一种选择是获取 BIN(银行识别号)数据库的副本,该数据库是所有卡前缀、卡发行和卡验证要求(例如到期日期、发行编号、开始日期)的列表。一些BIN源;
The best code I've seen for checking a card type is a Javascript page at http://www.eflo.net/mod10.htm - can differentiate between a VISA Debit and Credit card as you requested, a long with many other variations of cards. I've ported this code to C# very easily.
Your other alternative is to acquire a copy of the BIN (Bank Identification Number) database, which is a list of all card prefixes, the card issue, and the card validation requirements (e.g. Expiry Date, Issue No, Start Date). Some BIN sources;
不知道你需要它做什么,但我知道的所有 POS 系统都要求用户指定卡的类型。
您可以将借记卡作为贷记卡运行 - 无需密码
您可以将贷方作为借方运行 - 输入您的密码,交易将计为现金预支
not sure what you need that for, but all POS systems i'm aware of ASK THE USER to specify the type of the card.
you can run Debit as Credit - no need for pin number
you can run Credit as Debit - enter in your pin, and transaction will count as cash advance
Wiki 列出了信用卡和借记卡前缀
但是,IIRC 某些卡可能同时用作信用卡并根据具体情况借记。
Wiki has lists of credit vs. debit prefixes
However, IIRC some cards may be used as both credit and debit depending on context.
您可能已经通过支付网关发现了这一点,但是如果没有一些帮助,卡(借记卡、信用卡、自定义[例如商店卡])很难区分。
通常,您可以将卡号发送到支付网关,他们会为您提供此详细信息,但您可以从简单的前缀表中计算出来。
简而言之,每个银行/组织都有权访问一组特定的前缀[开头的数字],并且根据您想要的详细程度,您可以使用前缀将任何卡号与组织相匹配。令人高兴的是,即使来自同一家银行,借记卡和信用卡也使用不同的前缀。
从网络网关的角度来看,您通常并不关心,因为支付网关会自动告诉您他们是否接受该卡,为您进行热卡检查并验证输入的其他信息。
关于不必在借记卡上输入密码的评论(上/下)是错误的。这不是借记卡,有时被称为车库/燃料卡(我来自哪里),它们仅适用于某些“燃料类型交易”,以加快前院的处理速度。
You've probably found this out already through your payment gateway but cards (debit, credit, custom [e.g store cards] are not easily distinguishable without a bit of help.
Usually you can send the card number to the payment gateway and they'll give you this detail but you can work it out from a simple prefix table.
Simply put each bank/organisation is given access to a certain set of prefixes [numbers at the start] and depending on the level of detail you want you can match any card number to an organisation using the prefix. What is nice is that Debit Cards and Credit Cards use different prefixes even from the same bank.
From a web gateway point of view you don't typically care as the payment gateway will automatically tell you if they accept the card, do hotcard checks for you and validate the other information entered.
The comment (above/below) about not having to enter your pin on a debit card is wrong. That is not a debit card, sometimes referred to as Garage/Fuel Cards (where I come from) they only work for certain "fuel type transactions" to speed up processing at the forecourt.
我认为您感到困惑的是,当您在商店刷卡时,机器知道您拥有哪种卡。虽然我的荷兰借记卡总是可以选择。
但我猜磁条存储的不仅仅是号码,读卡器用它来确定您的卡类型。
您只需加入其他应用程序/网站并询问用户:)
I'm thinking you are getting confused that when you swipe the card in a store the machine knows which kind of card you've got. Although with my Dutch debit card I always got the option to choose..
But I'm guessing the magnetic strip stores more than just the number, and the card readers use that to determine your type of card.
You'll just have to join the other applications/sites and ask the user :)
数字范围。这是我曾经拥有的旧规范的一小段摘录。
注明为商业借记卡)
高级产品 - 美国) - 40
高级产品 – LAC) – 15
Premium Prodct - SAMEA) - 15
现在可能还有其他方法,例如在处理器的返回消息中,但我已经很长时间没有处理这个问题了。我们将一切视为信用卡处理,如果该卡严格来说是借记卡,银行只会处理它。
Number ranges. Here is a small excerpt of an old specification I had once.
noted as business debit)
Premium Product – U.S.) – 40
Premium Product – LAC) – 15
Premium Prodct - SAMEA) - 15
There may well be other methods by now for instance in the return message from the processor, but I have not had to deal with this for a long time. We process everything as a credit card and if the card is strictly a debit card the bank just takes care of it.
https://binlist.net/
提供免费(速率受限)的 API。您只需输入卡号的前 6 或 8 位数字,即发卡机构识别号 (IIN),以前称为银行识别号 (BIN)。
curl -H“接受版本:3”“https://lookup.binlist.net/45717360”
https://binlist.net/
offers a free (rate-limited) API. You only need to enter the first 6 or 8 digits of the card number - i.e. the Issuer Identification Numbers (IIN), previously known as Bank Identification Number (BIN).
curl -H "Accept-Version: 3" "https://lookup.binlist.net/45717360"
Binbase 会根据卡号的前六位数字告诉您该卡是借记卡还是信用卡。您每天可以进行 10 次手动查找,也可以付费购买整个数据库。
www.binbase.com/search.html
返回的信息格式如下:
Binbase will tell you whether card is debit or credit based on the first six digits of the card number. You can do 10 manual lookups per day or you can pay to buy the whole database.
www.binbase.com/search.html
The information returned is in this format:
我找到了一个免费的 BIN 检查器 json API。
https://api.freebinchecker.com/bin/{bin}
用于检查单个 BIN 编号。它接受长度为 6 的数字,即任何支付卡的起始数字。该应用程序将执行数据库查找,以返回为 BIN 存储的所有相关信息和大约 350,000 多条记录。
还有高级功能。
示例:
了解更多信息:Freebinchecker
I found a Free BIN checker json API.
https://api.freebinchecker.com/bin/{bin}
for checking a single BIN number. It accepts a number of length six, the initial digits of any payment card. The app will perform database lookup to return all the relevant information stored for the BIN and about 350,000+ records.
There also have premium feature.
Example:
For more info: Freebinchecker