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

Let extend card types #46

Open
liverday opened this issue Mar 19, 2019 · 1 comment
Open

Let extend card types #46

liverday opened this issue Mar 19, 2019 · 1 comment
Milestone

Comments

@liverday
Copy link

Hi, i'm Vitor and i'm from Brazil.
We have some credit cards that doesn't exist in this library.
There is a way to extend the actual cardTypes array?
This will help me a lot.

Thanks!

@charlesartbr
Copy link

charlesartbr commented Mar 4, 2022

This worked for me as a workaround to include Hipercard:

import { CreditCard } from 'angular-cc-library';

const cards = CreditCard.cards();

cards.unshift({
  type: 'hipercard',
  patterns: [606282],
  format: /(\d{1,4})/g,
  length: [16],
  cvvLength: [3],
  luhn: true,
})

CreditCard.cards = () => cards;

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

No branches or pull requests

3 participants