Skip to content

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: 'American Express Corporate',
bins: /^378(2[8-9]|3[0-9]|4[0-9]|5[0-9])\d{12}$/,
codeLength: 4,
},
{
name: 'Bankcard',
bins: /^(5610|560221|560222|560223|560224|560225|560226|560227|5602[89])\d{8}$/,
codeLength: 3,
},
{
name: 'China UnionPay',
bins: /^(62[0-9]{14,17})$/,
codeLength: 3,
},
{
name: 'Maestro',
bins: /^(50|5[6-9]|6[0-9])\d{12,17}$/,
codeLength: 3,
},
{
name: 'Switch',
bins: /^(4903|4905|4911|4936|6333|6759)\d{12}$/,
codeLength: 3,
},
{
name: 'Solo',
bins: /^(6334|6767)\d{12}$/,
codeLength: 3,
},
{
name: 'RuPay',
bins: /^(60|6521|6522)\d{14}$/,
codeLength: 3,
},
{
name: 'Mir',
bins: /^(2200|2204)\d{12}$/,
codeLength: 3,
},
{
name: 'NPS Pridnestrovie',
bins: /^605474\d{10}$/,
codeLength: 3,
},
{
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.

@cirocfc cirocfc force-pushed the master branch 2 times, most recently from 9fa329b to 7ac6e0e Compare September 10, 2025 20:39
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