braintree / credit-card-type

A library for determining credit card type
MIT License
980 stars 154 forks source link

Remove spaces to accurately match a unionpay card type #164

Open radar opened 1 month ago

radar commented 1 month ago

I noticed an issue today where a card entered with the prefix 6222 8212, that is including spaces, matched as a maestro card, but should've instead matched as a union pay card. I suspect this might be a wider issue than just these two types. I think to accurately match the types we should be removing the spaces, as they have no bearing on card type.