Skip to content

Union pay cards with 81 range fails isCreditCard check #1680

@darrell-roberts

Description

@darrell-roberts

Describe the bug
Using the 81* range UNION Pay card numbers does not pass isCreditCard check

Examples
Sample Test Cards: https://docs.adyen.com/development-resources/test-cards/test-card-numbers#china-unionpay

validator.isCreditCard('8171999900000000021')
false

The problem is the initial regex in https://github.com/validatorjs/validator.js/blob/master/src/lib/isCreditCard.js#L4

Additional context
Validator.js version: 13.6.0
Node.js version: 14
OS platform:l inux

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions