CCAvenue错误代码:10001无效的请求-本地上的加密请求无效/不存在 [英] CCAvenue Error Code: 10001 Invalid Request - Encrypted request invalid/not present, on localhost

查看:177
本文介绍了CCAvenue错误代码:10001无效的请求-本地上的加密请求无效/不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我尝试将数据发布到本地主机上的CCAvenue进行测试时,都会收到错误消息。我正在关注该网站 http://www.phpzag.com/ ccavenue-pay-gateway-integration-in-php / 。我有我们需要的每张证书。

I am getting error whenever I am trying to post data to CCAvenue on localhost for testing purpose. I am following this website http://www.phpzag.com/ccavenue-payment-gateway-integration-in-php/. I have every credential what we need.

index.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; ?>">





Success.php



Success.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

Error Code: 10001

PHP Mcrypt模块已用于将客户和商家数据加密到支付网关,因此它已被禁用,或者您有一些禁用的功能阻止了mcrypt。在您的PHP配置中,仅设置disable_functions = show_source,system,passthru,popen,proc_open。如果您位于共享主机上,请与您的主机提供商联系以启用并允许PHP mcrypt。

PHP Mcrypt module has been used to encrypt customers and merchant data to the payment gateway so either it is disabled or you have some disabled functions which is blocking mcrypt. In your PHP Configurations set only disable_functions = show_source, system, passthru, popen, proc_open. If you are on a shared hosting then contact your hosting provider to enable and allow PHP mcrypt.

在服务器端安装mcrypt模块。

at server side install mcrypt module.

sudo apt-get install php7.0-mcrypt

sudo apt-get install php7.0-mcrypt

然后重试。

该链接可能会有所帮助。
https://www.acewebworld.com/blog/whmcs -ccavenue-mcpg-module /

This link may helpful. https://www.acewebworld.com/blog/whmcs-ccavenue-m-c-p-g-module/

这篇关于CCAvenue错误代码:10001无效的请求-本地上的加密请求无效/不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆