Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added more credit cards inside cards.js #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vr-varad
Copy link

@vr-varad vr-varad commented Nov 21, 2023

Added as many cards as I found that are highly used worldwide.

@vr-varad
Copy link
Author

@cacontinuos check it out

Comment on lines +203 to +211
name: 'Santander',
bins: /^4\d{15}$/,
codeLength: 3,
},
{
name: 'Caixa Econômica Federal',
bins: /^627\d{13,16}$/,
codeLength: 3,
},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vr-varad, are all these new registrations card brands? From what I noticed, Santander and Caixa Econômica Federal are banks and not card brands.

Comment on lines +67 to +211
{
name: 'UnionPay International',
bins: /^(62[1-5]|81[0-9])\d{14,17}$/,
codeLength: 3,
},
{
name: 'Carte Blanche',
bins: /^389[0-9]{11}$/,
codeLength: 3,
},
{
name: 'Laser',
bins: /^(6304|6706|6771|6709)\d{8,15}$/,
codeLength: 3,
},
{
name: 'Eurocard',
bins: /^(4596|4312|4317|4388)\d{12}$/,
codeLength: 3,
},
{
name: 'Carta Si',
bins: /^432917\d{10}$/,
codeLength: 3,
},
{
name: 'ECMC',
bins: /^5[45][0-9]{14}$/,
codeLength: 3,
},
{
name: 'Visa Electron',
bins: /^4(026|17500|405|508|844|913|917)\d{10,13}$/,
codeLength: 3,
},
{
name: 'UATP',
bins: /^1\d{14}$/,
codeLength: 4,
},
{
name: 'Banamex',
bins: /^52[2-9]\d{14}$/,
codeLength: 3,
},
{
name: 'Bancomer',
bins: /^53[0-9]\d{14}$/,
codeLength: 3,
},
{
name: 'KoreanCard',
bins: /^9[0-9]{15}$/,
codeLength: 3,
},
{
name: 'N26',
bins: /^5355\d{14}$/,
codeLength: 3,
},
{
name: 'Revolut',
bins: /^5398\d{14}$/,
codeLength: 3,
},
{
name: 'Starbucks Card',
bins: /^62\d{17}$/,
codeLength: 3,
},
{
name: 'Woori Card',
bins: /^6[0-9]{18}$/,
codeLength: 3,
},
{
name: 'Shinhan Card',
bins: /^9[0-9]{16}$/,
codeLength: 3,
},
{
name: 'Sberbank',
bins: /^4276\d{12}$/,
codeLength: 3,
},
{
name: 'Alfa-Bank',
bins: /^4154\d{12}$/,
codeLength: 3,
},
{
name: 'Santander',
bins: /^4\d{15}$/,
codeLength: 3,
},
{
name: 'Caixa Econômica Federal',
bins: /^627\d{13,16}$/,
codeLength: 3,
},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add tests in credicard.test.js file?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests as in can u briefly explain it would be helpful

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you notice file credicard.test.js contains tests to ensure getCreditCardNameByNumber method works correctly. Ideally, tests should be added for each new card.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants