DeepankarSaha
DeepankarSaha

Reputation: 3

Cannot carry specific values to success page after redirection from CCAvenue

I am integrating CCAvenue to an online movie booking website which is developed in PHP. I need to carry specific values like Theater Name, Movie Name, Seat Number, etc to the redirection page after succesful payment as the data is required for ticket generation. I am using the below code in Checkout.php page of ccavenue but the values are not carried. Please help.

<html>
<head>
<title> Checkout</title>
</head>
<body>
<center>
<?php include('adler32.php')?>
<?php include('Aes.php')?>
<?php 

error_reporting(0);

$merchant_id="xxxxxxxx";  // Merchant id(also User_Id) 
$amount="1";          // your script should substitute the amount here in the quotes    provided here
$order_id=uniqid();       //your script should substitute the order description here in  the quotes provided here
$url="xxx.com/files/redirecturl.php";         //your redirect URL where your customer  will be redirected after authorisation from CCAvenue
$billing_cust_name=$_POST['uname'];
$billing_cust_address=$_REQUEST['location'];
$billing_cust_tel=$_POST['mobno'];
$billing_cust_email=$_POST['email'];

$date=$_REQUEST['date'];
$seatno=$_REQUEST['seatno'];
$moviename=$_REQUEST['moviename'];
$theatre=$_REQUEST['theatre'];
$cost=$_REQUEST['cost'];



$working_key='xxxxxxxx';    //Put in the 32 bit alphanumeric key in the quotes provided here.


$checksum=getchecksum($merchant_id,$amount,$order_id,$url,$working_key); // Method to generate checksum

$merchant_data= 'Merchant_Id='.$merchant_id.'&Amount='.$amount.'&Order_Id='.$order_id.'&Redirect_Url='.$url.'&billing_cust_name='.$billing_cust_name.'&billing_cust_address='.$billing_cust_address.'&billing_cust_tel='.$billing_cust_tel.'&billing_cust_email='.$billing_cust_email.'&Checksum='.$checksum; // This value is carried forward to to the redirecturl.php page

$user_data='date='.$date.'&moviename='.$moviename.'&theatre='.$theatre.'&cost='.$cost; // This value is not carried forward to the redirecturl.php page


$encrypted_data=encrypt($merchant_data,$working_key); // Method for encrypting the data.

?>

<form method="post" name="redirect" action="http://www.ccavenue.com/shopzone/cc_details.jsp"> 
<?php
echo "<input type=hidden name=encRequest value=$encrypted_data>";
echo "<input type=hidden name=Merchant_Id value=$merchant_id>";
echo "<input type=hidden name=user_data value=$user_data>";
?>
</form>

</center>
<script language='javascript'>document.redirect.submit();</script>
</body>
</html>

Upvotes: 0

Views: 2834

Answers (1)

Mayank Raichura
Mayank Raichura

Reputation: 381

You can pass custom data using merchant_param1,merchant_param2,merchant_param3....merchant_param5 parameters with maximum 100 alphanumeric characters per parameter. PG will echo it back after processing.

Source: https://login.ccavenue.com/resources/integrationKit.do?command=navigateIntegrationKit

You'll need login credentials to access this section.

Upvotes: 1

Related Questions