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.117.119.34


Current Path : /proc/thread-self/root/var/www/html/convocation/nehu/hdfc/
Upload File :
Current File : //proc/thread-self/root/var/www/html/convocation/nehu/hdfc/hdfc_order_api.php

<?php
/**
* import checksum generation utility
* You can get this utility from https://developer.paytm.com/docs/checksum/
*/
        ini_set('display_errors', 'On');
        error_reporting(E_ALL);
        ini_set('max_execution_time', 300);
        ini_set("memory_limit","500M");
        include('HDFCAPI.php');
        include ("/var/www/config.php");

        $servername = SERVERNAME;
        $username = USERNAME;
        $password = PASSWORD;
        $dbname = 'logisys3_sikkim';

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

        $query = "select p.ftype, p.appno, p.fregno, p.forderid, p.fstatus, p.fpaygateway, p.fcreatedate, DATE_SUB(now(), interval 10 MINUTE) from
        (select distinct fappno from studadm where ifnull(fpaymentstatus,'') <> 'success') a inner join pgdet p on a.fappno = p.appno 
        and ifnull(p.fstatus,'') = '' and ifnull(p.fstatus,'') <> 'SHIPPED'
        and fpaygateway = 'HDFC' 
		and ftype = 'ADM'
        and p.fcreatedate < DATE_SUB(now(), interval '15:0' MINUTE_SECOND)";
        $res_rv=$pconn->query($query);
        
        if (mysqli_num_rows($res_rv) > 0) 
        {
            while (@ob_end_flush());
            while($txn = mysqli_fetch_assoc($res_rv)) 
            {
                $forderid = $txn['forderid'];
                $productinfo = '';
                $status = '';

                $resfinal = getAPIRes("A09AC9FE6C4F6291596D0195E51A0556","AVQP87GI58AJ95PQJA",$forderid);
                $b = json_decode($resfinal,true);
                
                $productinfo = $b['param_value3'];
                $regno = $b['param_value2'];
                $txnid = $b['reference_no'];
                $date = $b['order_date_time'];
                $status = $b['order_status'];
               
                $update_pg="update pgdet set ftxnid = '{$txnid}', fstatus = '{$status}', fupddate = now() 
                    where appno = '{$productinfo}' 
                    and forderid = '{$forderid}'
                    and ftype = 'ADM'";
                $result_pg=$pconn->query($update_pg);

                if(strtoupper($status) == 'SHIPPED') {

                    $firstname = "HDFC_Order_API";

                    $update="update studadm set FPAYMENTREMARKS='{$txnid}', FPAYMENTSTATUS='success',
                    fpaymentdate='{$date}', FPAYMENTTYPE = '{$firstname}'
                    where fappno = '{$productinfo}'";
                    //var_dump($update);
                    $result=$pconn->query($update);

                }
                echo "ADM :- AppNo: $productinfo ---OrderID: $forderid ---Status: $status --Reason : $status<br/>";
                flush();
            }    
     
        }

   
?>