2014-02-08 26 views
0

我需要将sagepay底框方法集成到我的项目中。我可以将sagepay表单抓到我的页面。虽然我不知道我在哪里设置了返回网址。所以有显示错误,如为sagepay设置ReturnURL

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> 

回答

0

的承认的redirectUrl通过您NotificationURL贤者收费反应时提供。

Sage Pay Server期待“Status =”成为响应中的第一个字符。如果您之前有任何HTML,注释或标题代码,请将其删除,否则Sage Pay Server会将响应视为错误并使交易失败。

您是否在您的确认中将以下内容发送至您的通知网址的Sage Pays帖子,您是否了解了这一点?状态=,RedirectURL =,StatusDetail =

+0

现在我得到了良好的流动与您的答案..测试环境工作正常...现在我的问题是现场环境...只有显示付款信息,没有卡选择选项该页面将客户信息发送到sagepay.if您可以请参阅此图像http://www.sendspace.com/file/2dyt7p。我该如何解决这个问题...? – kalyan

+0

如果您的TEST账户上的商户号码是Ecom和MOTO(邮购电话订单),但您的LIVE账户中的MID仅为MOTO,您将收到错误信息,确认通过您的网站不可用的卡类型。如果想处理电子商务交易,请联系Sage Pay支持部门0845 111 44​​55,以便向供应商帐户添加电子商务商家编号。 –

+0

嗨@kalyan&sage支付支持我无法完全理解notificationURL的概念。它是否包含另一组代码,并设置了重定向规则? –