【发布时间】:2016-06-06 07:55:14
【问题描述】:
我已经完成了一个支付网关项目,它运行良好。付款从用户帐户中正确扣除并记入公司帐户。但它不会重定向到文件 ccavResponseHandler.php 中提到的商家网站中的页面。相反,它会重定向到商家网站的主页。我想将其重定向到success.php,并在同一页面中,我将从数据库中编写订单详细信息并将邮件发送给客户和公司。这是来自 CC Avenue 的代码。我从中删除了一些机密细节,但我的文件中也有相同的内容。
<?php include('Crypto.php')?>
<?php
error_reporting(0);
$workingKey='';
$encResponse=$_POST[""];
$rcvdString=decrypt($encResponse,$workingKey);
$order_status="";
$decryptValues=explode('&', $rcvdString);
$dataSize=sizeof($decryptValues);
for($i = 0; $i < $dataSize; $i++)
{
$information=explode('=',$decryptValues[$i]);
if($i==3) $order_status=$information[1];
}
if($order_status==="Success")
{
header('Location:success.php');
}
else if($order_status==="Aborted")
{
header('Location:abort.php');
}
else if($order_status==="Failure")
{
header('Location:failure.php');
}
else
{
echo "<br>Security Error. Illegal access detected";
}
echo "<br><br>";
echo "<table cellspacing=4 cellpadding=4>";
for($i = 0; $i < $dataSize; $i++)
{
$information=explode('=',$decryptValues[$i]);
echo '<tr><td>'.$information[0].'</td><td>'.urldecode($information[1]).'</td></tr>';
}
echo "</table><br>";
?>
这是登陆页面
<html>
<head>
</head>
<?php
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";
?>
【问题讨论】:
标签: php payment gateway ccavenue