不需要连接到金融机构的信用卡校验和和验证

发布于 2024-10-09 04:27:23 字数 262 浏览 1 评论 0原文

我所知道的验证是:

  • 整个卡号的校验和应为零。 (范围是 0-9)
  • 根据卡类型检查第一位数字 根据卡类型
  • 检查长度 根据卡类型
  • 检查 CCV 长度(我认为所有主要类型都是 3)
  • 当然要确保它是接受的卡类型以及未过期的卡类型。

是否还有其他验证:)(我希望很多人都不知道所有这些)

我问的原因是因为我无意中听说有一个针对过期或 CCV 的校验和号码。我只是想检查一下。

The validations I know of are:

  • Checksum the whole card number should add up to zero. (range is 0-9)
  • Check the first digit(s) against the card type
  • Check the length against the card type
  • Check the CCV length against the card type (I think all the major types are 3 anyway)
  • Of course make sure it is accepted card type as well as non expired.

Are there any other validations :) (I expect many folks did not know about all of these)

The reason I ask is because I overheard there was one to checksum number against expiration or CCV.. I just wanted to check.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

第几種人 2024-10-16 04:27:23
  • 卡号(又名 PAN,主帐号)
    不要把任何建议当作福音。卡号由 6 位发卡机构识别码 (IIN)、帐号和 luhn 校验位组成。 IIN 范围不断变化,依赖此信息的行业部门(例如支付处理商)通常会随着变化的发生而更新。可以相当安全地假设卡号应在 16 到 19 位数字之间,并以 3、4、5 或 6 开头。除此之外,尝试从 IIN 识别卡类型很容易出错,除非您经常更新。< /p>

  • Luhn / Mod10 校验位
    卡号的最后一位数字是校验位,用于检测操作员键入卡号时可能发生的换位错误。 维基百科文章是获取更多信息和代码示例的良好来源。

  • 磁条
    如果您可以物理访问该卡和磁条阅读器,则磁道 2 包含银行卡信息。详细信息包括卡号、有效期、LRC(校验位)和服务代码。服务代码(仅在磁条上可用)告知如何使用该卡,例如仅用于国内支付、仅在 ATM 上使用(不是支付卡)、是否应提供现金返还等。

  • < strong>CCV / CSC / CV2
    安全数字绝不会压印在卡上或记录在磁条上。除了 Amex(始终为 4 位)之外,其他所有卡均应为三位数

  • 发行日期
    仅用于手动(健全性)检查。授权请求期间未发送

  • 到期日期
    一个常见的误解是过期的卡不能使用。他们通常可以,但必须先进行在线授权(以便收单银行最终决定是否允许)。到期日最长可达未来 20 年(在极少数情况下甚至更久)

  • 问题编号
    仅适用于某些卡类型。应在授权请求中捕获并使用。

  • Card Number (aka PAN, Primary Account Number)
    Don't take any advice as gospel. The card number is comprised of a 6 digit Issuer Identification Number (IIN), an account number and a luhn check digit. The IIN ranges are constantly changing and industry sectors that rely on this information (such as Payment Processors) will generally be updated as changes occur. It's reasonably safe to assume that the card number should be between 16 and 19 digits, and start with 3, 4, 5 or 6. Beyond that trying to identify the card type from the IIN is prone to error unless you are frequently updated.

  • Luhn / Mod10 check digit.
    The last digit of the card number is a check digit to pick up transposition errors which may have occured when an operator has keyed in the card number. The wikipedia article is a good source for more info and code samples.

  • Magnetic stripe
    If you have physical access to the card, and a magstripe reader, then track 2 contains banking card info. Amongst the details are card number, expiry date, LRC (check digit) and a Service Code. The service code (only available on mag stripe) informs how the card may be used, eg only for national payments, only for use at an ATM (not as a payment card), whether cash back should be offered etc.

  • CCV / CSC / CV2
    Security digits are never embossed onto the card, or recorded on the magstripe. Should be three digits on all except Amex (always 4 digits)

  • Issue date
    Used for manual (sanity) check only. Not sent during the authorization request

  • Expiry date
    A common misconception is that expired cards cannot be used. They frequently can, but they must go through online authorization first (so that the acquiring bank has final say on whether it is permitted or not). Expiry dates can be up to 20 years in the future (and even further in some rare cases)

  • Issue number
    Only available on certain card types. Should be captured and used in the authorization request.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文