Tony Malone Posted March 29, 2007 Posted March 29, 2007 (edited) Apologies if this has been posted elsewhere, but I just popped on to share the fix and don't have time to read the 100+ pages in the WPP thread! I am running the wpp uk 0.9 contribution but was having problems with failed transactions from solo & switch cards. Looking through the error dumps generated, the transactions were failing for two main reasons - the start year and the issue number. The problem with the start year was being caused because the year was for some reason being sent as a 2 digit code rather than a 4 digit one, so as a quick and dirty fix here's what I did: OPEN /includes/modules/payment/paypal_wpp.php FIND: //Include UK-specific fields if (MODULE_PAYMENT_PAYPAL_DP_UK_ENABLED == 'Yes') { $process_button_string .= tep_draw_hidden_field('wpp_cc_start_month', $HTTP_POST_VARS['paypalwpp_cc_start_month']) . tep_draw_hidden_field('wpp_cc_start_year', $HTTP_POST_VARS['paypalwpp_cc_start_year']) . tep_draw_hidden_field('wpp_cc_issue_number', $HTTP_POST_VARS['paypalwpp_cc_issue_number']); } REPLACE WITH: //Include UK-specific fields if (MODULE_PAYMENT_PAYPAL_DP_UK_ENABLED == 'Yes') { $syear = "20" . $HTTP_POST_VARS['paypalwpp_cc_start_year']; $process_button_string .= tep_draw_hidden_field('wpp_cc_start_month', $HTTP_POST_VARS['paypalwpp_cc_start_month']) . tep_draw_hidden_field('wpp_cc_start_year', $syear) . tep_draw_hidden_field('wpp_cc_issue_number', $HTTP_POST_VARS['paypalwpp_cc_issue_number']); } The problem with the issue number was because not all solo/switch cards HAVE an issue number and users that didn't have an issue number were leaving them blank. However Paypal seem to require an issue number regardless. so I just did the following: OPEN /includes/languages/english/modules/payment/paypal_wpp.php FIND: define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_ISSUE_NUMBER', 'Solo/Switch Issue Number:'); REPLACE WITH: define('MODULE_PAYMENT_PAYPAL_DP_TEXT_CREDIT_CARD_ISSUE_NUMBER', 'Solo/Switch Issue Number: <font color="red">(if you have a solo/switch card but it has no issue number, enter 0)</font>'); Now my solo/switch transactions go through fine... Like I say, quick & dirty fixes, but they worked. Hope this helps anyone with the same problem. :thumbsup: Edited March 29, 2007 by Tony Malone Quote
Tony Malone Posted March 29, 2007 Author Posted March 29, 2007 WTF?? Have realised the there is an error in my code, but the board won't let me edit my post ?! anyway, the first code change should be: OPEN /includes/modules/payment/paypal_wpp.php FIND: //Include UK-specific fields if (MODULE_PAYMENT_PAYPAL_DP_UK_ENABLED == 'Yes') { $process_button_string .= tep_draw_hidden_field('wpp_cc_start_month', $HTTP_POST_VARS['paypalwpp_cc_start_month']) . tep_draw_hidden_field('wpp_cc_start_year', $HTTP_POST_VARS['paypalwpp_cc_start_year']) . tep_draw_hidden_field('wpp_cc_issue_number', $HTTP_POST_VARS['paypalwpp_cc_issue_number']); } REPLACE WITH: //Include UK-specific fields if (MODULE_PAYMENT_PAYPAL_DP_UK_ENABLED == 'Yes') { if ($HTTP_POST_VARS['paypalwpp_cc_start_year'] > 0) { $syear = "20" . $HTTP_POST_VARS['paypalwpp_cc_start_year']; } else { $syear = ""; } $process_button_string .= tep_draw_hidden_field('wpp_cc_start_month', $HTTP_POST_VARS['paypalwpp_cc_start_month']) . tep_draw_hidden_field('wpp_cc_start_year', $syear) . tep_draw_hidden_field('wpp_cc_issue_number', $HTTP_POST_VARS['paypalwpp_cc_issue_number']); } Otherwise you will bugger up other payment types! Quote
eustonstation Posted May 17, 2007 Posted May 17, 2007 Still got a problem with Switch as from what I can see on cards there IS NOT a start date but now is an Issue Number - WPP contrib from paypal still asks for start date - which of course there will not be - Any Ideas or who has this working - Thanks WTF?? Have realised the there is an error in my code, but the board won't let me edit my post ?! anyway, the first code change should be: OPEN /includes/modules/payment/paypal_wpp.php FIND: //Include UK-specific fields if (MODULE_PAYMENT_PAYPAL_DP_UK_ENABLED == 'Yes') { $process_button_string .= tep_draw_hidden_field('wpp_cc_start_month', $HTTP_POST_VARS['paypalwpp_cc_start_month']) . tep_draw_hidden_field('wpp_cc_start_year', $HTTP_POST_VARS['paypalwpp_cc_start_year']) . tep_draw_hidden_field('wpp_cc_issue_number', $HTTP_POST_VARS['paypalwpp_cc_issue_number']); } REPLACE WITH: //Include UK-specific fields if (MODULE_PAYMENT_PAYPAL_DP_UK_ENABLED == 'Yes') { if ($HTTP_POST_VARS['paypalwpp_cc_start_year'] > 0) { $syear = "20" . $HTTP_POST_VARS['paypalwpp_cc_start_year']; } else { $syear = ""; } $process_button_string .= tep_draw_hidden_field('wpp_cc_start_month', $HTTP_POST_VARS['paypalwpp_cc_start_month']) . tep_draw_hidden_field('wpp_cc_start_year', $syear) . tep_draw_hidden_field('wpp_cc_issue_number', $HTTP_POST_VARS['paypalwpp_cc_issue_number']); } Otherwise you will bugger up other payment types! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.