gpt4 book ai didi

php - 在 PayuMoney Web Integration with PHP 中,我到达 success.php 页面,但收到消息 "Invalid Transaction. Please try again"

转载 作者:行者123 更新时间:2023-12-02 19:43:08 24 4
gpt4 key购买 nike

因为 success.php 中有一段代码,它比较发送到 PayUMoney 的 $hash 变量与我们收到的变量是否相等,如果不相等,则显示消息:

Invalid Transaction. Please try again

所以我收到这条消息,但我不知道如何解决这个问题。

有一些 success.php 的示例代码

<?php
$status=$_POST["status"];
$firstname=$_POST["firstname"];
$amount=$_POST["amount"];
$txnid=$_POST["txnid"];
$posted_hash=$_POST["hash"];
$key=$_POST["key"];
$productinfo=$_POST["productinfo"];
$email=$_POST["email"];
$salt="salt";

if (isset($_POST["additionalCharges"])) {
$additionalCharges=$_POST["additionalCharges"];
$retHashSeq = $additionalCharges.'|'.$salt.'|'.$status.'|||||||||||'.$email.'|'.$firstname.'|'.$productinfo.'|'.$amount.'|'.$txnid.'|'.$key;

}
else {

$retHashSeq = $salt.'|'.$status.'|||||||||||'.$email.'|'.$firstname.'|'.$productinfo.'|'.$amount.'|'.$txnid.'|'.$key;

}
$hash = hash("sha512", $retHashSeq);

if ($hash != $posted_hash) {
echo "Invalid Transaction. Please try again";
}
else {

echo "<h3>Thank You. Your order status is ". $status .".</h3>";
echo "<h4>Your Transaction ID for this transaction is ".$txnid.". </h4>";
echo "<h4>We have received a payment of Rs. " . $amount . ". Your order will soon be shipped.</h4>";

}
?>

最佳答案

第 10 行。$盐=“盐”;

应该是 $salt = "your salt from your payumoney account在此处输入代码"

示例

$status=$_POST["status"];
$firstname=$_POST["firstname"];
$amount=$_POST["amount"];
$txnid=$_POST["txnid"];
$posted_hash=$_POST["hash"];
$key=$_POST["key"];
$productinfo=$_POST["productinfo"];
$email=$_POST["email"];
$salt="GQs7yium";

这就是为什么 $retHastseq 不等于 $posted_hash。

尝试一下。

关于php - 在 PayuMoney Web Integration with PHP 中,我到达 success.php 页面,但收到消息 "Invalid Transaction. Please try again",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39727030/

24 4 0