簡體   English   中英

CCAvenue 錯誤代碼:10001 無效請求 - 加密請求無效/不存在,在 localhost

[英]CCAvenue Error Code: 10001 Invalid Request - Encrypted request invalid/not present, on localhost

每當我嘗試將數據發布到本地主機上的 CCAvenue 以進行測試時,我都會收到錯誤消息。 我正在關注這個網站http://www.phpzag.com/ccavenue-payment-gateway-integration-in-php/ 我有我們需要的所有證件。

索引.php

<?php
include_once 'success.php';
// Merchant id provided by CCAvenue
// Item amount for which transaction perform
$Merchant_Id = 44071;
$Amount = 1000;
// Unique OrderId that should be passed to payment gateway
$Order_Id = "ORDER10203040";
// Unique Key provided by CCAvenue
$WorkingKey= "43E2EC833610E0295FCDEA09DB039382";
// Success page URL
$Redirect_Url="success.php";
//$Redirect_Url="http://watersportssimple.com/";
$Checksum = getCheckSum($Merchant_Id,$Amount,$Order_Id ,$Redirect_Url,$WorkingKey);

?>
<html>
    <head>
        <title>CCAvenue</title>
    </head>
    <body>
<!--    <form id="ccavenue" method="post" action="https://world.ccavenue.com/servlet/ccw.CCAvenueController">-->
    <form id="ccavenu" method="post" action="https://test.ccavenue.com/transaction/transaction.do?command=initiateTransaction">
        <input type="text" name="Merchant_Id" value="<?php echo $Merchant_Id; ?>">
        <input type="text" name="Amount" value="<?php echo $Amount; ?>">
        <input type="text" name="Order_Id" value="<?php echo $Order_Id; ?>">
        <input type="text" name="Redirect_Url" value="<?php echo $Redirect_Url; ?>">
        <input type="text" name="TxnType" value="A">
        <input type="text" name="actionID" value="TXN">
        <input type="text" name="Checksum" value="<?php echo $Checksum; ?>">

成功.php

<?php
// Get the checksum
function getchecksum($MerchantId,$Amount,$OrderId ,$URL,$WorkingKey)
{
    $str ="$MerchantId|$OrderId|$Amount|$URL|$WorkingKey";
    $adler = 1;
    $adler = adler32($adler,$str);
    return $adler;
}

//Verify the the checksum
function verifychecksum($MerchantId,$OrderId,$Amount,$AuthDesc,$CheckSum,$WorkingKey)
{
    $str = "$MerchantId|$OrderId|$Amount|$AuthDesc|$WorkingKey";
    $adler = 1;
    $adler = adler32($adler,$str);
    if($adler == $CheckSum)
        return "true";
    else
        return "false" ;
}

function leftshift($str , $num) {
    $str = DecBin($str);
        for( $i = 0 ; $i < (64-strlen($str)) ; $i++)
$str = "0".$str ;
for($i = 0 ; $i < $num ; $i++) {
    $str = $str."0";
    $str = substr($str , 1 ) ;
}
return cdec($str) ;
}

function cdec($num) {
    for ($n = 0 ; $n < strlen($num) ; $n++) {
        $temp = $num[$n] ;
        $dec = $dec + $temp*pow(2 , strlen($num)-$n-1);
}
    return $dec;
}

function adler32($adler , $str) {
    $BASE = 65521 ;
    $s1 = $adler & 0xffff ;
    $s2 = ($adler >> 16) & 0xffff;
    for($i = 0 ; $i < strlen($str) ; $i++) {
        $s1 = ($s1 + Ord($str[$i])) % $BASE ;
        $s2 = ($s2 + $s1) % $BASE ;
    }
    return leftshift($s2 , 16) + $s1;
}
?>

截屏

錯誤代碼:10001

PHP Mcrypt 模塊已用於將客戶和商家數據加密到支付網關,因此要么它被禁用,要么你有一些禁用的功能阻止 mcrypt。 在您的 PHP 配置中,僅設置 disable_functions = show_source、system、passthru、popen、proc_open。 如果您在共享主機上,請聯系您的主機提供商以啟用並允許 PHP mcrypt。

在服務器端安裝 mcrypt 模塊。

sudo apt-get install php7.0-mcrypt

然后再試一次。

此鏈接可能會有所幫助。 https://www.acewebworld.com/blog/whmcs-ccavenue-mcpg-module/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM