Another split from #2711013: Implement the initial payment functionality, the payment branch is approaching 6 thousand lines of code and is unreviewable.
We want a CreditCard class (static, for easier usage) that contains the definitions of known credit card types.
Our initial list: Visa, Mastercard, Maestro, Amex, Diners, Discover, JCB, UnionPay.
More to come (Elo, Dankort).
Needs an up to date list of prefixes, used for detecting the card type based on a number.
Also needs information on number length, and security code length, used in validation.
The CreditCard class will return CreditCardType value objects constructed from the definition (id, label, etc).
It will also have methods for detecting a card type, validating a number, expiration date, security code.
Comments
Comment #3
bojanz commentedDone. Also added the ability for gateways to declare which credit card types they support.