Zen cart occasionally returns PayPal Pro code 7 error for Maestro payments. This indicates either an issue number or start date is required. Often customers are unable to enter a start date and if the issue number is left blank the payment will fail.
Switch is now known as Maestro yet banks issue cards in both the old format (long number and issue number) and the new format (credit card style 16 digits and start date) that can lead to confusion when processing payments.
One fix supplied on the Zen Cart forums was to combine the processing of Switch and Maestro together. Unfortunately it only allows customers to enter the old format as the valid from form is greyed out. If customers with a new maestro card pay without providing a start date the payment will fail. I have modified the paypaldp.php (located in /includes/modules/payment) as suggested in the forums above and made a small change which provides both start date and issue number field for the customer to fill out.
Line 249-260 now reads:
‘var value = document.checkout_payment.paypalwpp_cc_type.value;’ .
‘if (value == “Solo”) {’ .
‘ document.checkout_payment.paypalwpp_cc_issue_month.disabled = false;’ .
‘ document.checkout_payment.paypalwpp_cc_issue_year.disabled = false;’ .
‘ document.checkout_payment.paypalwpp_cc_checkcode.disabled = true;’ .
‘ if (document.checkout_payment.paypalwpp_cc_issuenumber) document.checkout_payment.paypalwpp_cc_issuenumber.disabled = true;’ .
‘} else if (value == “Switch” || value == “Maestro”) {’ .
‘ document.checkout_payment.paypalwpp_cc_issuenumber.disabled = false;’ .
‘ if (document.checkout_payment.paypalwpp_cc_issue_month) document.checkout_payment.paypalwpp_cc_issue_month.disabled = false;’ .
‘ if (document.checkout_payment.paypalwpp_cc_issue_year) document.checkout_payment.paypalwpp_cc_issue_year.disabled = false;’ .
‘ document.checkout_payment.paypalwpp_cc_checkcode.disabled = false;’ .
‘} else {’ .
My changes from those suggesting in the forum are in red - this turns on the card issue date. Please don’t miss the second change in this file as mentioned in the forum. I copied the same code as described.
I also modified the languages file to provide a short explanation for the customer.
Includes/languages/english/modules/payment/paypaldp.php I changed the definition (around line 30) to:
define(’MODULE_PAYMENT_PAYPALDP_TEXT_CREDIT_CARD_MAESTRO_ISSUENUMBER’, ‘Maestro/Switch Issue No.:<br/>NB: If your Switch/Maestro card does not have an issue number please provide a card issue date.’);
I have tested it with a 16 digit Maestro card using a start date and it works fine.
Tags: error code 7, maestro, payment module, paypal pro, switch, uk, Zen Cart
Leave a Reply