【发布时间】:2019-07-24 15:55:58
【问题描述】:
我在我的 Codeigniter 项目中使用 Paytm 支付网关,我正在根据 Paytm 发送参数并且一切正常,但是在付款后,当 Paytm 重定向回我的回调 URL(这是我的家庭控制器中的一个函数)时响应我收到“不允许执行您请求的操作。”错误。我还尝试将 csrf 令牌的参数发送到 paytm,但他们拒绝了。
请帮助我如何获得 paytm 响应。
{
header("Pragma: no-cache");
header("Cache-Control: no-cache");
header("Expires: 0");
// following files need to be included
require_once(APPPATH . "/libraries/config_paytm.php");
require_once(APPPATH . "/libraries/encdec_paytm.php");
$checkSum = "";
$paramList = array();
$ORDER_ID = time().mt_rand().$this->session->userdata('inf_ses_id');
$CUST_ID = $this->session->userdata('inf_ses_id')."_thebell";
$INDUSTRY_TYPE_ID = "Retail"; //$_POST["INDUSTRY_TYPE_ID"];
$CHANNEL_ID = "WEB"; //$_POST["CHANNEL_ID"];
$TXN_AMOUNT = $this->session->userdata('plan_price');
// Create an array having all required parameters for creating checksum.
$paramList["MID"] = PAYTM_MERCHANT_MID;
$paramList["ORDER_ID"] = $ORDER_ID;
$paramList["CUST_ID"] = $CUST_ID;
$paramList["INDUSTRY_TYPE_ID"] = $INDUSTRY_TYPE_ID;
$paramList["CHANNEL_ID"] = $CHANNEL_ID;
$paramList["TXN_AMOUNT"] = $TXN_AMOUNT;
$paramList["WEBSITE"] = PAYTM_MERCHANT_WEBSITE;
$paramList["CALLBACK_URL"] = "http://localhost/my_project/home/paytm_response";
//Here checksum string will return by getChecksumFromArray() function.
$checkSum = getChecksumFromArray($paramList,PAYTM_MERCHANT_KEY);
echo "<html>
<head>
<title>Merchant Check Out Page</title>
</head>
<body>
<center><h1>Please do not refresh this page...</h1></center>
<form method='post' action='".PAYTM_TXN_URL."' name='f1'>
<table border='1'>
<tbody>";
foreach($paramList as $name => $value) {
echo '<input type="hidden" name="' . $name .'" value="' . $value . '">';
}
echo "<input type='hidden' name='CHECKSUMHASH' value='". $checkSum . "'>
</tbody>
</table>
<script type='text/javascript'>
document.f1.submit();
</script>
</form>
</body>
</html>";
}
这是我在同一个控制器中的回调函数
public function paytm_response(){
var_dump($_POST); }
遇到错误 您请求的操作不被允许。
【问题讨论】:
标签: codeigniter paytm