CCavenue is most popular Payment gateway for online Shopping. It provide payment through using International credit card as well using your Bank (who have bond with CCavenue) online Account or using it's debit card(ATM card). It is one of the most secure place for given your money to online shop.
For Integrate it with your website you should have ccavenue account and they give you a merchant id and a unique key for your site that is most important for money transaction.
Creat a validCCAvenueparam.php for server side generate valid checksum param
----------------------------------------------------------------------------------------
<?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;
}
?>
-------------------------------------------------------------------------------------------------------------------------------
Step -2
create cat page form cart.php
<?php
$Merchant_Id = "M_apa18528_18528";//This id(also User Id) available at "Generate Working Key" of "Settings & Options"
$Amount = 900;;//your script should substitute the amount in the quotes provided here
$Order_Id = 689663;//your script should substitute the order description in the quotes provided here
$WorkingKey = "";//Note : if you empty the working value then CCavenue "return
because CCavenue security key providing to merchant .
"
$Redirect_Url ="http://www.englishleap.com/users/payment/";
$Checksum = getCheckSum($Merchant_Id,$Amount,$Order_Id ,$Redirect_Url,$WorkingKey); // Validate All value
?>
<form action="https://www.ccavenue.com/shopzone/cc_details.jsp" method="post">
<!--<br/>Merchant_Id:
--><input type="hidden" value="<?php echo $Merchant_Id; ?>" name="Merchant_Id">
<!--<br/>Amount:
--><input type="hidden" value="<?php echo $Amount; ?>" name="Amount">
<!--<br/>Order_Id:
--><input type="hidden" value="<?php echo $Order_Id; ?>" name="Order_Id">
<!--<br/>Redirect_Url:
--><input type="hidden" value="<?php echo $Redirect_Url; ?>" name="Redirect_Url">
<!--<br/>Checksum:
--><input type="hidden" value="<?php echo $Checksum; ?>" name="Checksum">
<!--<br/>billing_cust_name:
--><input type="hidden" value="bp.nayak20000" name="billing_cust_name">
<!--<br/>billing_cust_address:
--><input type="hidden" value="" name="billing_cust_address">
<!--<br/>billing_cust_country:
--><input type="hidden" value="" name="billing_cust_country">
<!--<br/>billing_cust_state:
--><input type="hidden" value="" name="billing_cust_state">
<!--<br/>billing_zip:
--><input type="hidden" value="" name="billing_zip">
<!--<br/>billing_cust_tel:
--><input type="hidden" value="" name="billing_cust_tel">
<!--<br/>billing_cust_email:
--><input type="hidden" value="bp.nayak20000@gmail.com" name="billing_cust_email">
<!--<br/>delivery_cust_name:
--><input type="hidden" value="bp.nayak20000" name="delivery_cust_name">
<!--<br/>delivery_cust_address:
--><input type="hidden" value="" name="delivery_cust_address">
<!--<br/>delivery_cust_country:
--><input type="hidden" value="" name="delivery_cust_country">
<!--<br/>delivery_cust_state:
--><input type="hidden" value="" name="delivery_cust_state">
<!--<br/>delivery_cust_tel:
--><input type="hidden" value="" name="delivery_cust_tel">
<!--<br/>delivery_cust_notes:
--><input type="hidden" value="" name="delivery_cust_notes">
<!--<br/>Merchant_Param:
--><input type="hidden" value="" name="Merchant_Param">
<!--<br/>billing_cust_city:
--><input type="hidden" value="" name="billing_cust_city">
<!--<br/>billing_zip_code:
--><input type="hidden" value="" name="billing_zip_code">
<!--<br/>delivery_cust_city:
--><input type="hidden" value="" name="delivery_cust_city">
<!--<br/>delivery_zip_code:
--><input type="hidden" value="" name="delivery_zip_code">
<input type="submit" class="button-placeorder" value="Pay by CCavenue ">
</form>
For Integrate it with your website you should have ccavenue account and they give you a merchant id and a unique key for your site that is most important for money transaction.
Creat a validCCAvenueparam.php for server side generate valid checksum param
----------------------------------------------------------------------------------------
<?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;
}
?>
-------------------------------------------------------------------------------------------------------------------------------
Step -2
create cat page form cart.php
<?php
$Merchant_Id = "M_apa18528_18528";//This id(also User Id) available at "Generate Working Key" of "Settings & Options"
$Amount = 900;;//your script should substitute the amount in the quotes provided here
$Order_Id = 689663;//your script should substitute the order description in the quotes provided here
$WorkingKey = "";//Note : if you empty the working value then CCavenue "return
Error Code: | 108 |
Error Description: | Checksum+mismatch |
"
$Redirect_Url ="http://www.englishleap.com/users/payment/";
$Checksum = getCheckSum($Merchant_Id,$Amount,$Order_Id ,$Redirect_Url,$WorkingKey); // Validate All value
?>
<form action="https://www.ccavenue.com/shopzone/cc_details.jsp" method="post">
<!--<br/>Merchant_Id:
--><input type="hidden" value="<?php echo $Merchant_Id; ?>" name="Merchant_Id">
<!--<br/>Amount:
--><input type="hidden" value="<?php echo $Amount; ?>" name="Amount">
<!--<br/>Order_Id:
--><input type="hidden" value="<?php echo $Order_Id; ?>" name="Order_Id">
<!--<br/>Redirect_Url:
--><input type="hidden" value="<?php echo $Redirect_Url; ?>" name="Redirect_Url">
<!--<br/>Checksum:
--><input type="hidden" value="<?php echo $Checksum; ?>" name="Checksum">
<!--<br/>billing_cust_name:
--><input type="hidden" value="bp.nayak20000" name="billing_cust_name">
<!--<br/>billing_cust_address:
--><input type="hidden" value="" name="billing_cust_address">
<!--<br/>billing_cust_country:
--><input type="hidden" value="" name="billing_cust_country">
<!--<br/>billing_cust_state:
--><input type="hidden" value="" name="billing_cust_state">
<!--<br/>billing_zip:
--><input type="hidden" value="" name="billing_zip">
<!--<br/>billing_cust_tel:
--><input type="hidden" value="" name="billing_cust_tel">
<!--<br/>billing_cust_email:
--><input type="hidden" value="bp.nayak20000@gmail.com" name="billing_cust_email">
<!--<br/>delivery_cust_name:
--><input type="hidden" value="bp.nayak20000" name="delivery_cust_name">
<!--<br/>delivery_cust_address:
--><input type="hidden" value="" name="delivery_cust_address">
<!--<br/>delivery_cust_country:
--><input type="hidden" value="" name="delivery_cust_country">
<!--<br/>delivery_cust_state:
--><input type="hidden" value="" name="delivery_cust_state">
<!--<br/>delivery_cust_tel:
--><input type="hidden" value="" name="delivery_cust_tel">
<!--<br/>delivery_cust_notes:
--><input type="hidden" value="" name="delivery_cust_notes">
<!--<br/>Merchant_Param:
--><input type="hidden" value="" name="Merchant_Param">
<!--<br/>billing_cust_city:
--><input type="hidden" value="" name="billing_cust_city">
<!--<br/>billing_zip_code:
--><input type="hidden" value="" name="billing_zip_code">
<!--<br/>delivery_cust_city:
--><input type="hidden" value="" name="delivery_cust_city">
<!--<br/>delivery_zip_code:
--><input type="hidden" value="" name="delivery_zip_code">
<input type="submit" class="button-placeorder" value="Pay by CCavenue ">
</form>
Gr8 help dude :) appreciated
ReplyDeleteHello I m not getting anything in response please help me...however when some one make payment correctly with correct details payments is successfully deposited in account ..but how to check if payment is failed or success i m using bellow code for checking response please check it and help me to get out of this..
ReplyDeleteHi Dear,
ReplyDeleteyou can chech your payment status by
if($Checksum=="true" && $AuthDesc=="Y") {
return 'success';
}
For more info visit the below url link:-
http://subversion.assembla.com/svn/katalog/trunk/html/scripts/modules/payment/class.ccavenue.php
Hi Dear,
DeleteFirst of all thanks for this. But Still I m not getting anything in response. I m using this this code on my redirect url page .
Thank you for shopping with us. Your credit card has been charged and your transaction is successful. We will be shipping your order to you soon.";
}
else if($Checksum=="true" && $AuthDesc=="Y")
{
echo "
Thank you for shopping with us.We will keep you posted regarding the status of your order through e-mail";
}
else if($Checksum=="true" && $AuthDesc=="Y")
{
echo "
Thank you for shopping with us.However,the transaction has been declined.";
}
else
{
echo "
Thank you for shopping with us.";
}
?>
Please Healp me to get out of this.
DeleteThank you for shopping with us. Your credit card has been charged and your transaction is successful. We will be shipping your order to you soon.";
}
else if($Checksum=="true" && $AuthDesc=="Y")
{
echo "
Thank you for shopping with us.We will keep you posted regarding the status of your order through e-mail";
}
else if($Checksum=="true" && $AuthDesc=="Y")
{
echo "
Thank you for shopping with us.However,the transaction has been declined.";
}
else
{
echo "
Thank you for shopping with us.";
}
?>
Hi Dsear,
DeleteYou have to configure to get response from CCavnue step->follow this link
http://stackoverflow.com/questions/20612483/cc-avenue-payment-gateway-not-return-value-in-to-redirect-url
I'm facing the same problem here. There is no response. I think it can,t find the redirecturl page.
ReplyDeletePlease help
CCAvenue payment integration php
ReplyDeleteIntegrating CCavenue payment gateway is simple
We need a merchant id and working for implementing payment gateway
check link
http://www.codingprogrammer.com/tutorialdemo/php-tutorial/ccavenue-payment-integration-php/
where to add the account number of customer. I can't find the fields like accnt number and cvv fields in the form fields hidden....
Delete112 Don't worry... It happens to the best of us.
ReplyDeletePlease provide any help for this.
Hi
ReplyDeleteI am getting an error when i reached this url :-https://secure.ccavenue.com/transaction/transaction.do?command=initiateTransaction
Something went wrong while processing your request.
Don't worry... It happens to the best of us.
Hi,
ReplyDeleteCould you assist me in getting transaction id of ccavenue
OMG!!!! CC AVENUE INTEGRATION WAS VERY SIMPLE...
ReplyDelete1)log in to ccavenue account
2)click on resources->integration kit
3)You will be redirected to a page. then click on download integration kits.
4)choose the appropriate platform like php or asp.net or python. download the kit.
5)extract it and you willl find three folders,(you can choose any folder).
let us suppose select custom checkout formkit folder.
6)Open dataFrom_EMI.htm
7)Open ccavRequestHandler.php and paste the access code, working key over that page and save the page.
8)open ccavResponseHandler.php and paste the working key on that page and save the page.
9) go to form page and type in your merchant id. then blindly scroll down and click on submit, without filling bank details or any stuff, click on submit. you will be redirected to payment gateway to fill choose the card number and cvv.etc....
You willl understand what to do once you view that page....
Hope that helps.......
Thanks @Amardeep, its really helps me.
DeleteYou are welcome... Good to hear that.
Deletevery very thanks dear,,,,,
DeleteThanks..
DeleteIts Not Working Localhost??
Thanks for your post Amardeep. It is very helpfull to mee.
Deletewhat ccavenue not work localhost.
DeleteThank you so much Amardeep for replying with absolute solution for ccavenue payment gateway integration. Your reply helped me do the ccavenue integration. I request you to kindly help me on how transaction details are captured from ccavenue back in application. Thanks.
Deletehi
ReplyDeletei downloaded the PHP kit and used non seamless and added the working key and access code. it shows error
We will help you http://infotwistsolutions.blogspot.com/
Deletewhat error???/
ReplyDeleteplease let me know ccavenue & paypal integrate same website (Joomla)
ReplyDeleteHello Admin
ReplyDeleteWe exchange Backlink
My Website is
www.twinkyphone.com
If intrusted Then Msg Me on WhatsApp to 7503583831
Hey there!! It was of great help. Thanks for sharing it with us
ReplyDeleteWeb Design Company in Bangalore | Website Development Services in Bangalore
Error Code: 21002 currency: Required paramter missing
ReplyDeleteDon't worry... It happens to the best of us.
where to pass currency parameter please any one help.......Thanks
Given error
ReplyDeleteError Code: 94
Error Description: Amount+Invalid
how to solve.
Jain Technosoft has an expert team of PHP Programmers, which have good knowledge in Linux, Apache, MySQL, PHP (LAMP) and AJAX. We provide flexible, efficient and affordable PHP Application Development Services in the areas of dynamic web application development. Our PHP developers are proficient in developing web applications using Core PHP as well as experts in products like Joomla, WordPress, Drupal, Magento, Virtuemart and OsCommerce.
ReplyDeleteWebsite Development Company in Bangalore | SEO Services in Bangalore
i used same code but did not successes.
ReplyDeleteit redirect me to
https://www.ccavenue.com/errorPages/Error.jsp?errorCode=0&processingFileName=ccavenue.txn.DoTransServlet&errorMessage=&cid=114381-689663
I am facing same problem
DeleteAs far as i saw, CCAvenue changed their system and API recently. Please use latest api.
DeleteBest and to the point explanation in just 3 minutes.watch the video on the below link.
ReplyDeletehttps://www.youtube.com/watch?v=2V11Aih2luU
g
ReplyDeleteAm getting 403 or 10001 error for cc avenue integration on India currency with php. can any one send the code related encryption from UI or index end
ReplyDeleteHi Pravalika,
DeletePlease follow below instruction . hope you will resolve your 10001 encryption error.
OMG!!!! CC AVENUE INTEGRATION WAS VERY SIMPLE...
1)log in to ccavenue account
2)click on resources->integration kit
3)You will be redirected to a page. then click on download integration kits.
4)choose the appropriate platform like php or asp.net or python. download the kit.
5)extract it and you willl find three folders,(you can choose any folder).
let us suppose select custom checkout formkit folder.
6)Open dataFrom_EMI.htm
7)Open ccavRequestHandler.php and paste the access code, working key over that page and save the page.
8)open ccavResponseHandler.php and paste the working key on that page and save the page.
9) go to form page and type in your merchant id. then blindly scroll down and click on submit, without filling bank details or any stuff, click on submit. you will be redirected to payment gateway to fill choose the card number and cvv.etc....
example page :
http://www.freelancephpdevelopment.com/php-script-for-ccavenue-and-ccavenue-payment-gateway-integration-in-php/
This comment has been removed by the author.
ReplyDeleteYa i have done the total part well but getting the same error 10001. Is there any thing needed to connect from our end between the kit(using php non seemless kit) our code. We have just given direct link to checkout button i..e https://secure.ccavenue.com/transaction/transaction.do?command=initiateTransaction. Can you please help me in that how to retrieve data of cart item which is selected.
DeleteCC Avenue Payment working on 000Webhost?
ReplyDeleteNo
DeleteI am getting this error through my website. Any clue?
ReplyDelete-------------------
This site can’t be reached
The webpage at https://secure.ccavenue.com/transaction/transaction.do?command=initiateTransaction might be temporarily down or it may have moved permanently to a new web address.
ERR_CONNECTION_ABORTED
Hello,
ReplyDeletePlease help me i want to send more than 5 custom perameters in my form but ccavenue give me only 5 custom fields (merchant_param5) if i send our custom veriable with delimiter (|) its showing on ccavenue page.so, what is right way to do this
can you please provide your code?
Deletenice information bro plz checkout my website how's it
ReplyDeletewww.gajabwap.blogspot.in
Best Ecommerce Platforms Lucknow India,
ReplyDeleteOnline Shopping Cart Development India,
B2C Marketplace Software USA,
Online Store Software Development UK,
Online Shopping Cart Software Services HongKong
Hi i have downloaded CC-Avenue integartion kit for PHP and I have integrated cc avenue in my website. Payment is done successfully and amount is credited in my merchant account. but I want to know how to get the payment status response. I found redirect.php file.
ReplyDeleteI have certain doubts
/*********code in redirect.php*********/
error_reporting(0);
$workingKey='MyWorkingKey';
$encResponse=$_POST["encResponse"];
$rcvdString=decrypt($encResponse,$workingKey);
$AuthDesc="";
$MerchantId="MymerchantId";
$OrderId=$_GET['link'];
$Amount=0;
$Checksum=0;
$veriChecksum=false;
$decryptValues=explode('&', $rcvdString);
$dataSize=sizeof($decryptValues);
/**********end*************/
What is this $AuthDesc?
Should I kept It as Null value?
Here $Amount given as zero. Should i keep It as Zero or use the dynamic value?
the same for checksum also?
please help
It is really helpful I really like this post. This blog is so informative for providing a valuable information about bulk sms api php integration.
ReplyDeleteReally nice post.Thanks for the sharing.Please keep position about such articles the really spread useful information.I hope it stays updated ..
ReplyDeleteAccept Online Payments in Qatar
Hi,
ReplyDeleteThanks for sharing a very interesting article about Easy way to integration of ccavenue payment gateway using php. This is very useful information for online blog review readers. Keep it up such a nice posting like this.
Regards,
WondersMind,
Web Design Company Bangalore
This comment has been removed by the author.
ReplyDeleteSuperb article. It's very informative and useful for merchants who are looking for Apparel Merchant Account or want to know more about Merchant Account.
ReplyDeleteSomething went wrong while processing your request. issue is still there. pls help if anyone have solution.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteCCavenue is most popular Payment gateway for online Shopping. If you are looking for other advanced Online Payments, you should check out PaymentsMe.
ReplyDeleteReally good post. Thanks for sharing this wonderful informative article.
ReplyDeleteBest Bill payment app in india
Broadband postpaid bill payment
Pay Electricity Bill Online and Offline
TV Recharge Online
payment gateway
ReplyDeleteMerchant Services - Ziegal.co.uk is one of the best payment gateway service providers to online payment systems for your e-commerce business. Our payment gateway is 99.9% secure, now take card payments with us.
to get more - https://www.ziegal.co.uk/pages/payment-gateway-service-provider
Thanks for your interesting ideas.the information's in this blog is very much useful for me to improve my knowledge.More PHP Development Services in Chennai Web Data Extraction Services | Digital Payment Platform | Green Pen
ReplyDeleteGreat info!
ReplyDeleteHave a look at Credit Card Bill Payment Services
Nice information. Thanks for sharing this info. Bulk SMS API Integration
ReplyDeleteInteresting blog! keep sharing blogs with us
ReplyDeleteThank you,
ecommerce development company
Ecommerce Services in Chennai
best online payment gateway
Digital Payment Platform
Thanks for sharing this article...this application provide the number of services such as online transactions, easy billing, and many kinds of facilities that accept wallets, credit or debit card transactions over the internet in a safe manner. The Paylo is the best payment gateway in India.
ReplyDeleteThanks to share the information by this article. The post is unique and very useful. Continue to write this type of post in future. Best Mobile Wallet Apps For Online Payments
ReplyDeleteThanks a lot for sharing this amazing knowledge with us. This site is fantastic. I always find great knowledge from it. Contact Vapulus team
ReplyDeleteNice articel, This article help me very well. Thank you. Also please check my article on my site ccavenue integration.
ReplyDelete