"{$MID}" , "ORDERID" => "{$orderid}", "MERC_UNQ_REF" => "{$productinfo}");
$checkSum = getChecksumFromArray($requestParamList,'0Iujr3nOUrFiNc6n');
$requestParamList['CHECKSUMHASH'] = urlencode($checkSum);
$data_string = "JsonData=".json_encode($requestParamList);
$ch = curl_init(); // initiate curl
//$url = "https://securegw-stage.paytm.in/merchant-status/getTxnStatus";
// where you want to post data
$url = "https://securegw.paytm.in/merchant-status/getTxnStatus";
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, true); // tell curl you want to post something
curl_setopt($ch, CURLOPT_POSTFIELDS,$data_string); // define what you want to post
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return the output in string format
$headers = array();
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$output = curl_exec($ch); // execute
$info = curl_getinfo($ch);
$data = json_decode($output, true);
if ($data["STATUS"] == "TXN_SUCCESS")
{
$status = $data["STATUS"];
$ORDERID = $data["ORDERID"];
$productinfo = $data["MERC_UNQ_REF"];
$txnid = $data["TXNID"];
$MID = $data["MID"];
//$CHECKSUMHASH = $data["CHECKSUMHASH"];
$txnid = $data['TXNID'];
$firstname = 'Paytm';
echo "
"; } /* if (isset($_POST) && count($_POST)>0 ) { foreach($_POST as $paramName => $paramValue) { echo "
" . $paramName . " = " . $paramValue; } } */ } /* else { echo "Checksum mismatched."; //Process transaction as suspicious. } */ ?>
Thank You. Your order status is success
"; echo "Your Transaction ID for this transaction is ".$data['TXNID'].".
"; echo "We have received a payment of Rs. " . $data['TXNAMOUNT'] ."
"; $html = "
Click here to take a PrintOut
";
echo $html;
$update = "update res_stud set FPAYMENTREMARKS='{$txnid}',FPAYMENTSTATUS='success',
FPAYMENTCONFIRM='success', fackdate = current_date(), funivrecdate = current_date(),
fackuser = '{$firstname}', FCHALLANNO = '{$ORDERID}'
where APPNO='{$productinfo}'";
$result = $conn->query($update);
/* $get_app_cand_det="SELECT a.FDEGREE,a.FEXAMNO,a.FCOLLCODE,c.funivcode,
a.FREGNO,CONCAT('Message from ',c.funivname,' : ',
' Dear ',s.fname,' (Reg. no. : ',s.fregno,' , Stud. id. : ',IFNULL(s.fstudid,''),'),',
' Rs.',FLOOR(a.FTOTAL),'/- is received at university. Your application no. is ',a.appno,
'. keep this information for future reference.',' Sent Time: ',TIME(NOW())) as message
FROM res_stud a inner join student s on
a.fregno = s.fregno inner join control c
WHERE a.APPNO='{$productinfo}'";
$result = $conn->query($get_app_cand_det);
if (mysqli_num_rows($result) > 0)
{
while($row = mysqli_fetch_assoc($result))
{
$collcode = $row['FCOLLCODE'];
$degree = $row['FDEGREE'];
$regno = $row['FREGNO'];
$text = $row['message'];
$funivcode = $row['funivcode'];
}
}*/
$servername = "97.74.228.93";
$username = "logisys3_logu";
$password = "Logisys@2106";
/* $servername = "localhost";
$username = "root";
$password = "";*/
/* $dbname = "logisys3_comexam";
$conn = new mysqli($servername, $username, $password, $dbname);
$get_data = "select fmobileno from masuser where fregno = '{$regno}'
and funivcode = '{$payment->notes->univcode}'";
$result1=$conn->query($get_data);
if (mysqli_num_rows($result1) > 0)
{
// output data of each row
$dbnames = array();
while($row = mysqli_fetch_assoc($result1))
{
$to = $row['fmobileno'];
}
}
$username = 'logisyhttp';
$password = 'Logis986';
$from = 'UNISOL';
$category = '';
//$smsresp = sendsmaapi($username,$password,$from,$to,$text,$category);
$strInsertQuery = "insert into smslog(funivcode, fregno,fmobileno, freasoncode, fguid, fenttype, fstatus,fackdate, facktime,fremarks) values('{$funivcode}','{$regno}','{$to}','PG','{$smsresp}','PG','{$smsresp}',now(),now(),'paytm')";*/
//$result1=$conn->query($strInsertQuery);
mysqli_close($conn);
}
else
{
echo "Transaction status is failure" . ""; } /* if (isset($_POST) && count($_POST)>0 ) { foreach($_POST as $paramName => $paramValue) { echo "
" . $paramName . " = " . $paramValue; } } */ } /* else { echo "Checksum mismatched."; //Process transaction as suspicious. } */ ?>