php - 仅 Chrome 浏览器中 Paytm Gateway PHP 中的校验和不匹配错误
问题描述
我已经下载了 Paytm Web 示例工具包 php 并在我的网站中集成了网关,但我在 chrome 浏览器中遇到了一个问题,即校验和不匹配。在其他浏览器中它工作正常。我使用以下代码生成校验和
header("Pragma: no-cache");
header("Cache-Control: no-cache");
header("Expires: 0");
// following files need to be included
require_once("./lib/config_paytm.php");
require_once("./lib/encdec_paytm.php");
$checkSum = "";
$paramList = array();
$ORDER_ID = $_POST["ORDER_ID"];
$CUST_ID = $_POST["CUST_ID"];
$INDUSTRY_TYPE_ID = $_POST["INDUSTRY_TYPE_ID"];
$CHANNEL_ID = $_POST["CHANNEL_ID"];
$TXN_AMOUNT = $_POST["TXN_AMOUNT"];
// 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/Paytm_Payment_Gateway-PHP/pgResponse.php";
/*
$paramList["CALLBACK_URL"] = "http://localhost/PaytmKit/pgResponse.php";
$paramList["MSISDN"] = $MSISDN; //Mobile number of customer
$paramList["EMAIL"] = $EMAIL; //Email ID of customer
$paramList["VERIFIED_BY"] = "EMAIL"; //
$paramList["IS_USER_VERIFIED"] = "YES"; //
*/
//Here checksum string will return by getChecksumFromArray() function.
$checkSum = getChecksumFromArray($paramList,PAYTM_MERCHANT_KEY);
?>
并遵循以验证校验和
header("Pragma: no-cache");
header("Cache-Control: no-cache");
header("Expires: 0");
// following files need to be included
require_once("./lib/config_paytm.php");
require_once("./lib/encdec_paytm.php");
$paytmChecksum = "";
$paramList = array();
$isValidChecksum = "FALSE";
$paramList = $_POST;
$paytmChecksum = isset($_POST["CHECKSUMHASH"]) ? $_POST["CHECKSUMHASH"] : ""; //Sent by Paytm pg
//Verify all parameters received from Paytm pg to your application. Like MID received from paytm pg is same as your application�s MID, TXN_AMOUNT and ORDER_ID are same as what was sent by you to Paytm PG for initiating transaction etc.
$isValidChecksum = verifychecksum_e($paramList, PAYTM_MERCHANT_KEY, $paytmChecksum); //will return TRUE or FALSE string.
if ($isValidChecksum == "TRUE") {
echo "<b>Checksum matched and following are the transaction details:</b>" . "<br/>";
帮我看看
解决方案
推荐阅读
- .htaccess - htaccess | 没有在正确的位置寻找 js
- inno-setup - 带大括号的 INNO 设置注册表项
- javascript - 无法为树胡须 reactjs 创建 JSON 结构
- matrix - 带有矩阵起始向量的 sympy nsolve typeError
- r - 将标签(即“A”、“B”)添加到 facet wrap ggplot
- ruby-on-rails - 如何使用 ruby 和 parslet 解析 rtf 文本?
- java - 用于递归搜索路径并列出以特定字符串开头的所有目录的 Java 代码
- c# - 在 WPF MediaElement 中播放 HTTPS 视频 URL 的解决方法
- android - 在 Google Play 中,它显示“您需要为此应用程序上传 APK 或 Android App Bundle”
- php - 从数据 php regx 中删除一些内容