Last active
May 28, 2024 18:32
-
-
Save BroFox86/9297341dd4a955ae4be45b6c2ab3894e to your computer and use it in GitHub Desktop.
[Conditions for checking some CC cards] #forms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (value.startsWith('34') || value.startsWith('37')) { | |
return 'americanExpress' | |
} | |
if (value.startsWith('62')) { | |
return 'chinaUnionPay' | |
} | |
if (value.startsWith('6011') || value.startsWith('65')) { | |
return 'DiscoverCard' | |
} | |
if (Number(value.slice(0, 3)) >= 644 && Number(value.slice(0, 3)) <= 649) { | |
return 'DiscoverCard' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment