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

bojanz created an issue. See original summary.

  • bojanz committed f2d287a on 8.x-2.x
    Issue #2781287 by bojanz: Create CreditCard and CreditCardType classes
    
bojanz’s picture

Status: Active » Fixed

Done. Also added the ability for gateways to declare which credit card types they support.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.