php通过判断非法访问,安全错误.在php中使用ccavenue检测到非法访问

我成功地重定向到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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值