我需要将sagepay基础设施方法集成到我的项目中。我可以把sagepay表单放到我自己的页面上。虽然我不知道在哪里设置了返回的url。所以这里显示的错误如下
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.这是我的代码。在这段代码中,我可以在哪里设置returnurl?
if($_POST['submit']=="submit")
{
//Test authorize url
//$url="https://live.sagepay.com/gateway/service/authorise.vsp";
//Test purchase url
$url = 'https://test.sagepay.com/gateway/service/vspserver-register.vsp';
//Live
//$url = 'https://live.sagepay.com/gateway/service/vspserver-register.vsp';
$params = array();
$params['VPSProtocol'] = '2.23';
$params['TxType'] = 'PAYMENT';
$params['Vendor'] = 'vendorname';
$params['VendorTxCode'] = 'Txn-ab34qcd1';
$params['Currency'] = 'GBP';
$params['Amount'] = 50;
$params['description'] = 'hello test';
$params['NotificationURL'] = 'http://exapmle.co.uk/payment-return.php';
$params['BillingSurname'] = 'Bobby';
$params['BillingFirstnames'] = 'Bobbysfsf';
$params['BillingAddress1'] = '14 Tottenham Court Road';
$params['BillingCity'] = 'London';
$params['BillingPostCode'] = 'W1T 1JY';
$params['BillingCountry'] = 'GB';
$params['billingPhone'] = '555 123-4567';
$params['DeliverySurname'] = '123 Shipping St';
$params['DeliveryFirstnames'] = 'Shipsville';
$params['DeliveryAddress1'] = 'London';
$params['DeliveryCity'] = 'London';
$params['DeliveryPostCode'] = '54321';
$params['DeliveryCountry'] = 'GB';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, $curlTimeout);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = explode(chr(10), curl_exec($ch));
echo "<pre>";
print_r($response);
echo "</pre>";
echo $posturl = $response[5];
$posturlex=explode("L=",$posturl);
print_r($posturlex);
$nexturl = $posturlex[1];
}
?>
<html>
<head>
</head>
<body>
<iframe src="<?=$nexturl?>" id="sageFrame" style="width:100%;height:500px;border:none"></iframe>
</body>
</html>发布于 2014-02-11 03:15:45
通过您的NotificationURL确认Sage Pay响应时会提供RedirectURL。
Sage Pay服务器希望"Status=“是响应中的第一个字符。如果您在此之前有任何HTML、注释或标题代码,请将其删除,否则Sage Pay Server会将响应视为错误并导致交易失败。
您是否将以下内容在您的致谢信中发送给Sage Pay帖子,并发送到您的通知URL,您是否做到了这一点?Status=、RedirectURL=、StatusDetail=
https://stackoverflow.com/questions/21646394
复制相似问题