0

I'm getting the following error:

HTTP Status Code:   500
HTTP Status Message:    The request was unsuccessful due to an unexpected condition encountered by the server.
Error Code :    5006
Error Description : Unable to redirect to Vendor's web site. The Vendor failed to provide a RedirectionURL.

I've looked at the help offered on this page: Sagepay 5006 error code fix

but the problem is that the response is never reaching my Notification page, which I have checked is reachable, so I can't proceed to check many of the suggestions as I have no idea what the Sage Pay post contains.

here's the data i'm posting (I'm posting without the line breaks, and with a realVendor name!)

VPSProtocol=3.00&
TxType=PAYMENT&
Vendor=name&
VendorTxCode=2a5e86f2a8609ff996e6&
Amount=50&
Currency=GBP&
Description=Something about stuff&
NotificationURL=https%3A%2F%2Four-site.co.uk%2Fecodes%2Forder-confirmation.php&
BillingFirstnames=sdsdsd&
BillingSurname=sdsdsd&
BillingAddress1=sdsds&
BillingAddress2=sdsds&
BillingCity=sdsdsd&
BillingPostCode=dsdsdd&
BillingCountry=GB&
BillingEMail=sdfsf@adsad.com&
BillingPhone=12112121211&
DeliveryFirstnames=sdsdsd&
DeliverySurname=sdsdsd&
DeliveryAddress1=sdsds&
DeliveryAddress2=sdsds&
DeliveryCity=sdsdsd&
DeliveryPostCode=dsdsdd&
DeliveryCountry=GB

I'm posting this using code lifted from the Sage Pay exmaple:

set_time_limit(60);
$output = array();
$curlSession = curl_init();

curl_setopt($curlSession, CURLOPT_URL, $url);
curl_setopt($curlSession, CURLOPT_HEADER, 0);
curl_setopt($curlSession, CURLOPT_POST, 1);
curl_setopt($curlSession, CURLOPT_RETURNTRANSFER, 1);
//curl_setopt($curlSession, CURLOPT_TIMEOUT, $ttl);
curl_setopt($curlSession, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($curlSession, CURLOPT_POSTFIELDS, arrayToQueryString($data));

if (!empty($caCertPath))
{
    curl_setopt($curlSession, CURLOPT_SSL_VERIFYPEER, 1);
    curl_setopt($curlSession, CURLOPT_CAINFO, $caCertPath);
} 
else
{
    curl_setopt($curlSession, CURLOPT_SSL_VERIFYPEER, 0);
}

$rawresponse = curl_exec($curlSession);
$response = queryStringToArray($rawresponse, "\r\n");

header('Location: '. $response['NextURL']]);

Community
  • 1
  • 1
joobe
  • 1
  • 2
  • SagePay errors are occasionally terrible. Are you sure you have provided all the fields required and in the correct format? – DavidG Jul 12 '16 at 16:12
  • I believe so, I think I would get a different error if a field was required, and the registration is ok. – joobe Jul 12 '16 at 16:14
  • No, I have had this error when not sending the correct info. Can you show your code for posting this? – DavidG Jul 12 '16 at 16:15
  • I updated the question with the curl code – joobe Jul 12 '16 at 16:19

0 Answers0