Just been doing some trial test and the UK Maestro card number on the SagePay test card doesn't work.
http://www.sagepay.com/help/faq/how_can_i_test_the_different_card_types
Visa, Mastercard and International Maestro work.
I am also wondering if there are any switch cards with the shorter number now?
Comments
Comment #1
kingandyCard number validation is carried out by the Commerce module, in the function commerce_payment_validate_credit_card_type(). In particular, the 'Maestro' block checks for numbers beginning with 5018, 5020, or 5038, which does not include the UK Maestro number given on the SagePay site (5641820000000005).
Similarly, I've experienced a failure with the listed Visa number (4929000000006), as Commerce believes all Visa numbers are 16 digits long.
I'm reluctant to ask Commerce to change its validation rules to allow these test numbers. Is there any way the SagePay module can subvert the validation with its own while it's in test mode?
Running through that table I find:
Comment #2
ikos commentedHi
We can either not use the credit card validation in Commerce at all or we can submit a patch to Commerce.
I think I'll add it as a config option in the gateway and then submit a patch to Ryan - best of both worlds.
kind regards
Richard
Comment #3
kingandyI don't know that it's a problem with the card validation per se, just that these test numbers don't conform to their expectations...
Rather than adding a new setting to disable card validation, it would probably be easier to work with the existing txn_mode setting and only invoke Commerce's validation when in live mode?
I was going to suggest the Sagepay module could maybe use its own validation while in test mode, to ensure that the card number is one of the ten on that list. Then I realised that this would prevent us from testing failure behaviour. (Then I realised that it's currently impossible to test failure behaviour when in test mode, as it substitutes in valid test behaviour before it submits to SagePay. But that's another issue, really.)
Comment #4
ikos commentedCommitted changes today for this issue.
Now both these behaviours are controlled by settings in the payment method.
Comment #5
ikos commented