Open uPaymeiFixit opened 2 years ago
👋 @uPaymeiFixit thanks for the PR! We'll take a look and provide feedback or merge, unfortunately I can't provide an ETA. For internal reference, ticket 1890
In case it helps, this is the code I'm currently using as a workaround. When this type definition is fixed the as any
should be able to be removed. Please reach out if I can provide any more context.
CardValidator.creditCardType.addCard({
niceType: 'Deprecated 13 Digit Visa',
type: 'visa-deprecated',
// eslint-disable-next-line @typescript-eslint/no-explicit-any
patterns: [41111, [44, 47]] as any, // Required until this gets merged: https://github.com/braintree/credit-card-type/pull/147
gaps: [4, 8, 12],
lengths: [13, 16, 19], // add support for old, deprecated 13 digit visas
code: {
name: 'CVV',
size: 3,
},
});
Any updates on this?
The README shows an
addCard
example that uses a pattern not currently valid with theCreditCardType.patterns
type.[number[]]
should benumber[][]
This accurately represents credit-card-type's pattern functionality and allows the README example to work: