我成功地重定向到ccavenue支付网关但是在点击取消按钮时,它在重定向网页中显示错误“安全错误.检测到非法访问”.
这是我的重定向页面:
$workingKey='myWorkingKey'; //Working Key should be provided here.
$encResponse=$_POST["encResponse"]; //This is the response sent by the CCAvenue Server
$rcvdString=decrypt($encResponse,$workingKey);
$AuthDesc="";
$MerchantId="";
$OrderId="";
$Amount=0;
$Checksum=0;
$veriChecksum=false;
$decryptValues=explode('&', $rcvdString);
$dataSize=sizeof($decryptValues);
echo "
for($i = 0; $i < $dataSize; $i++)
{
$information=explode('=',$decryptValues[$i]);
if($i==0) $MerchantId=$information[1];
if($i==1) $OrderId=$information[1];
if($i==2) $Amount=$information[1];
if($i==3) $AuthDesc=$information[1];
if($i==4) $Checksum=$information[1];
}
$rcvdString=$MerchantId.'|'.$OrderId.'|'.$Amount.'|'.$AuthDesc.'|'.$workingKey;
$veriChecksum=verifyChecksum(genchecksum($rcvdString), $Checksum);
if($veriChecksum==TRUE && $AuthDesc==="Y")
{
echo "
Thank you for shopping with us. Your credit card has been charged and your transaction is successful. We will be shipping your order to you soon.";
}
else if($veriChecksum==TRUE && $AuthDesc==="B")
{
echo "
Thank you for shopping with us.We will keep you posted regarding the status of your order through e-mail";
}
else if($veriChecksum==TRUE && $AuthDesc==="N")
{
echo "
Thank you for shopping with us.However,the transaction has been declined.";
}
else
{
echo "
Security Error. Illegal access detected";
}
echo "
";
echo "
for($i = 0; $i < $dataSize; $i++)
{
$information=explode('=',$decryptValues[$i]);
echo '
'.$information[0].''.$information[1].'';}
echo "
";
echo "
?>
我搜索了这个问题,但无法得到任何解决方案.如何解决这个错误..请给出一些相同的建议?
解决方法:
我从文档中发现(可能已经过时但我找不到更新的文档)您需要传递一个名为cancel_url的参数,如果客户在结算页面上取消了该交易,CCAvenue会将客户重定向到此URL.
因此,在您创建付款的页面中,您需要向表单添加类似的内容
您必须已经拥有与redirect_url类似的东西
标签:php,aes,payment-gateway,ccavenue,adler32
来源: https://codeday.me/bug/20190827/1744583.html