File: /var/www/html/sarvodayahospital/public/mapp/paymentgatway/ccavRequestHandler.php
<html>
<head>
<title> Custom Form Kit </title>
</head>
<body>
<center>
<?php include('Crypto.php')?>
<?php
include '../dbConnection.php';
$payment_id = $_GET["payment_id"];
$sql = "SELECT a.* , b.* from video_patient_transaction a
INNER JOIN video_patient b ON b.id = a.patient_id where a.id = '".$payment_id."'";
$run = mysqli_query($conn,$sql);
$row = mysqli_fetch_assoc($run);
$time = round(microtime(true) * 1000);
if($row["booking_type"] == "1"){
$service = "Video";
}else if($row["booking_type"] == "2"){
$service = "In Person";
}
echo "<pre>";
$payment_data = array(
"tid" => $time
,"merchant_id" => '224898'
,"order_id" => "V".$payment_id
,"amount" => number_format((float)$row["amount"], 2, '.', '')
,"currency" => "INR"
,"redirect_url" => "https://sarvodayahospital.com/paymentgatway_physical/ccavResponseHandler.php"
,"cancel_url" => "https://sarvodayahospital.com/paymentgatway_physical/ccavResponseHandler.php"
,"language" => "EN"
,"billing_name" => $row["patient_name"]
,"billing_address" => $row["address"]
,"service_service_type" => $row["interest"]
,"billing_country" => 'India'
,"billing_tel" =>$row["mobile"]
);
error_reporting(0);
$merchant_data='';
$working_key='608934FAD8273DAB1C11371AEE32C597';//Shared by CCAVENUES
$access_code='AVNJ86GG43AS62JNSA';//Shared by CCAVENUES
$time = round(microtime(true) * 1000);
foreach ($payment_data as $key => $value){
$merchant_data.=$key.'='.urlencode($value).'&';
}
$encrypted_data=encrypt($merchant_data,$working_key); // Method for encrypting the data.
?>
<form method="post" name="redirect" action="https://secure.ccavenue.com/transaction/transaction.do?command=initiateTransaction">
<?php
echo "<input type=hidden name=encRequest value=$encrypted_data>";
echo "<input type=hidden name=access_code value=$access_code>";
?>
</form>
</center>
<script language='javascript'>document.redirect.submit();</script>
</body>
</html>