error code 108 ccavenue

i am integrating ccavenue with my ecommerce site. in some cases, i am getting this error: Error Code: 108 Error Description: Checksum+mismatch.

How to rectify this one?Can anybody help me

Answers


I solved this problem.. The checksum was indeed incorrect. I was hard coding at the last instant the amount to be Rs. 10 to test the integration.. but the checksum I calculated with the actual amount. Hence the incorrect checksum! Hope this helps someone.


check your merchant key of ccavenue, it changes every time you regenerate and also check your algo for checksum calculation


if you are using the free code provided for integrating ccavenues with joomla, in the file ps_ccavenues_info_part.php the amount is rounded off after calculating the checksum.

I modified the code so the amount is rounded off before calculating the checksum and this fixed it for me.


Try replacing your function file provided in the CCAvenue kit with this one:

<?php

function getchecksum($MerchantId,$Amount,$OrderId ,$URL,$WorkingKey)
{
    $str ="$MerchantId|$OrderId|$Amount|$URL|$WorkingKey";
    $adler = 1;
    $adler = adler32($adler,$str);
    return $adler;
}

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 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 ;
            //echo "s1 : $s1 <BR> s2 : $s2 <BR>";

    }
    return leftshift($s2 , 16) + $s1;
}

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 ) ;
        //echo "str : $str <BR>";
    }
    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;
}
?>

I have found the issue and that is the URL. It will work, If your Redirect URL will not have any params.

For solving this issue. You will have to encode your URL via urlencode function in PHP.

$url= urlencode($url);

Need Your Help

ggplot axis does not conform to numeric data

r ggplot2 axis-labels

I am making a stacked bar chart (goodbye pie chart) and I noticed that my numeric values are converted. The x-axis in the data are not followed.

Linkedin Integration with Meteor

javascript meteor oauth-2.0 linkedin linkedin-api

I am working on Meteor trying to implement linkedin oauth. I have a button, when user clicks it, a window appears asking the user to allow access, when the user allows, the profile info of the user...