0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.188.165.21


Current Path : /var/www/html/vskub/adm_stop/
Upload File :
Current File : /var/www/html/vskub/adm_stop/pgResponse.php

<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"
      integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">

<?php

// following files need to be included
require_once("Paytm/lib/config_paytm.php");
require_once("Paytm/lib/encdec_paytm.php");
include("/var/www/config.php");


$paytmChecksum = "";
$paramList = array();
$isValidChecksum = "FALSE";


$servername = SERVERNAME;
$username   = USERNAME;
$password  = PASSWORD;
$databse = 'logisys3_comexam';

$conn = new  mysqli($servername,$username,$password,$databse);
if(!$conn) 
{
	die("Connection failed: " . mysqli_connect_error());
}


$paytmChecksum = "";
$paramList = array();
$isValidChecksum = "FALSE";

$paramList = $_POST;

$univcode = '026';




$servername = SERVERNAME;
$username   = USERNAME;
$password  = PASSWORD;
$databse ="logisys3_vku";

$conn = new  mysqli($servername,$username,$password,$databse);
if(!$conn) 
{
	die("Connection failed: " . mysqli_connect_error());
}




$get_data = "select * from maspg where fbank = 'Paytm' and funivcode = '{$univcode}' and FENTTYPE = 'adm'";
    //var_dump($get_data);
$result=$conn->query($get_data); 

if (mysqli_num_rows($result) > 0) 
{
	while($row = mysqli_fetch_assoc($result)) 
	{
		$key    =    $row['fkey'];
		$mid    =    $row['fmid'];
		$fworkingid =    $row['fworkingid'];
		$fmode      =    $row['fmode'];
		$freturnurl =    $row['freturnurl'];
	}
}


$paytmChecksum = isset($_POST["CHECKSUMHASH"]) ? $_POST["CHECKSUMHASH"] : ""; //Sent by Paytm pg
//var_dump($paytmChecksum);
//Verify all parameters received from Paytm pg to your application. Like MID received from paytm pg is same as your application�s MID, TXN_AMOUNT and ORDER_ID are same as what was sent by you to Paytm PG for initiating transaction etc.
$isValidChecksum = verifychecksum_e($paramList, $key, $paytmChecksum); //will return TRUE or FALSE string.
// echo $isValidChecksum;

if($isValidChecksum == "TRUE") 
{
		$status = $_POST["STATUS"];
	  //echo $status;
		$orderid = $_POST["ORDERID"];
		$productinfo = $_POST["MERC_UNQ_REF"];
		
		$txnid = $_POST["TXNID"];
		$MID = $_POST["MID"];
		$CHECKSUMHASH = $_POST["CHECKSUMHASH"];
		// echo $productinfo;
		//$productinfo = '103E3050155';
		//$MID = $mid;
		$requestParamList = array();
		$responseParamList = array();
		
		$requestParamList = array("MID" => "{$MID}" , "ORDERID" => "{$orderid}", "MERC_UNQ_REF" => "{$productinfo}");  

		$checkSum = getChecksumFromArray($requestParamList,PAYTM_MERCHANT_KEY);
		$requestParamList['CHECKSUMHASH'] = urlencode($checkSum);

		$data_string = "JsonData=".json_encode($requestParamList);
		$ch = curl_init();                    // initiate curl
		
		//$url = "https://securegw-stage.paytm.in/merchant-status/getTxnStatus"; 
		$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);
    
    // var_dump($data);

    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 "<center><h1 >VIJAYANAGARA SRI KRISHNADEVARAYA UNIVERSITY</h1></center>";
			echo "<div style = 'width:50%; margin:10% auto'>
			<h4 style='color:green;'>Thank You. Your Payment is success</h4>";
        echo "<h2>Your Transaction ID for this transaction is ".$data['TXNID'].".</h2>";
        echo "<h3>We have received a payment of Rs. " . $data['TXNAMOUNT']  ."</h3>";

      
          $update="update eligfee set FPAYREMARKS = '{$txnid}',FPAYID = '{$txnid}', 
                FPAYSTATUS = 'success', FPAYDATE = now()
                where FAPPNO ='{$productinfo}'";
          $result=$conn->query($update);
          $html="
          <div class='m-l-10 btn btn-primary waves-effect btn' >
          <span onclick=\"PrintApplication('{$productinfo}','{$univcode}');\" style='float:left;margin-left:8px;cursor: pointer; line-height: 19px;font-size:14px;font-weight:bold;'>Click here to take a PrintOut</span>
          </div>";
          echo $html;
    }  
	}
	else 
	{
		echo "<b>Transaction status is failure</b>" . "<br/>";
	}


?>
<script>
  function PrintApplication(appno,univcode)
  {
    //var $host_url = `https://${window.location.host}/app.php?a=`;
    //window.location.href=$host_url+"PrintApplicationFormNETBANKING&app_no="+appno+"&univcode="+univcode;
    window.location.href = "https://universitysolutions.in/vskub/adm/app.php?a=appPrint&fappno="+appno;
  }
</script>