DamanC Posted May 26, 2011 Share Posted May 26, 2011 Sorry to post this in here but hopefully this may give me something more to play with. I'm having issues integrating sage pay server into OSC and have hit a brick wall : http://www.oscommerce.com/forums/topic/375636-sage-pay-server-error-5006/ This issue is sage pay rejects an order because it receives no response from the 'notifcation URL'. The URL is notificationurl=https://www.mydomain.co.uk/checkout_process.php?check=SERVER&osCsid=07859e3396eba48a966ab5164f53296a and is generated from a bit of code in the sage_pay_server.php file; if ( MODULE_PAYMENT_SAGE_PAY_SERVER_PROFILE_PAGE == 'Normal' ) { $error_url = tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . (tep_not_null($error) ? '&error=' . $error : '') . '&' . tep_session_name() . '=' . tep_session_id(), 'SSL', false); } else { $error_url = tep_href_link('ext/modules/payment/sage_pay/redirect.php', 'payment_error=' . $this->code . (tep_not_null($error) ? '&error=' . $error : '') . '&' . tep_session_name() . '=' . tep_session_id(), 'SSL', false); } $result = 'Status=OK' . chr(13) . chr(10) . 'RedirectURL=' . $error_url; } else { $result = 'Status=OK' . chr(13) . chr(10) . 'RedirectURL=' . tep_href_link(FILENAME_CHECKOUT_PROCESS, 'check=PROCESS&key=' . md5($sage_pay_server_securitykey) . '&VPSTxId=' . $HTTP_POST_VARS['VPSTxId'] . '&' . tep_session_name() . '=' . tep_session_id(), 'SSL', false); } } else { tep_session_unregister('sage_pay_server_securitykey'); tep_session_unregister('sage_pay_server_nexturl'); $error = $this->getErrorMessageNumber($HTTP_POST_VARS['StatusDetail']); if ( MODULE_PAYMENT_SAGE_PAY_SERVER_PROFILE_PAGE == 'Normal' ) { $error_url = tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . (tep_not_null($error) ? '&error=' . $error : '') . '&' . tep_session_name() . '=' . tep_session_id(), 'SSL', false); } else { $error_url = tep_href_link('ext/modules/payment/sage_pay/redirect.php', 'payment_error=' . $this->code . (tep_not_null($error) ? '&error=' . $error : '') . '&' . tep_session_name() . '=' . tep_session_id(), 'SSL', false); } $result = 'Status=INVALID' . chr(13) . chr(10) . 'RedirectURL=' . $error_url; } echo $result; with particular attention to 'RedirectURL=' . tep_href_link(FILENAME_CHECKOUT_PROCESS, 'check=PROCESS&key=' . md5($sage_pay_server_securitykey) . '&VPSTxId=' . $HTTP_POST_VARS['VPSTxId'] . '&' . tep_session_name() . '=' . tep_session_id(), 'SSL', false); I'm not entirely convinced my notification URL should contain amp; can anyone see or think why it might be? Also, is there anything I can change to perhaps make the redirect/notification url static such as 'checkout_success.php? I'm no Guru but have fuffed about with it for ages but don't know the correct syntax. Appreciate your time :) Link to comment Share on other sites More sharing options...
achieve Posted December 10, 2011 Share Posted December 10, 2011 Did you ever get anywhere with this? I am having similar problem. Being trying to resolve for days but no success yet. Lots of post on the forum but no real solution yet. Link to comment Share on other sites More sharing options...
Guest Posted December 11, 2011 Share Posted December 11, 2011 I think that a temporary solution to this may be to go to the html_output file and change: $link = str_replace('&', '&', $link); to $link = str_replace('&', '&', $link); Be aware that this is hardly ideal as it invalidates the code, (& did not start a character reference (& probably should have been escaped as &). I'm hoping that someone will have a better solution though, as this is not the best way to do this. Link to comment Share on other sites More sharing options...
Guest Posted December 11, 2011 Share Posted December 11, 2011 I have been searching online for some info on "PHP backspace" and this seems the way to remove the & from what I can find out. However, I am no great PHP programmer, and don't know how to implement this to get it to work. Link to comment Share on other sites More sharing options...
achieve Posted December 11, 2011 Share Posted December 11, 2011 I'm using Ultimate SEO URLs v2.2d , so that particular piece of code doesn't exist in includes/functions/html_output.php Link to comment Share on other sites More sharing options...
achieve Posted December 11, 2011 Share Posted December 11, 2011 Although no solution yet, I have just now completed a new clean install of OSC 2.3.1 and am still receing the 5006 error. Will I ever get this sorted? Link to comment Share on other sites More sharing options...
Guest Posted December 16, 2011 Share Posted December 16, 2011 You can use the .htaccess file to change the the url from& to & which should solve your problem. Add this to your .htaccess file: RewriteCond %{QUERY_STRING} ^(.*)&(.*)$ RewriteRule ^(.*)$ /$1?%1&%2 [L,R=301] I hope this helps. Best regards, Ian Link to comment Share on other sites More sharing options...
achieve Posted December 16, 2011 Share Posted December 16, 2011 No joy with that either I'm afraid, but thanks for the suggestion. THink I will just use a different payment processor. Too many problems with Sagepay. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.