 
 <?php 	include_once('../../config.php');   	
		include_once(ABS_PATH.'/admin/login_check.php');    
 
                 
                            
                            $stmt=$conn->prepare("select  * from  UI__UPreqst where  status=0  and id=:PyId order by id desc");  
                            $stmt->bindValue(':PyId', $_REQUEST['PyId'] , PDO::PARAM_STR);
                            $stmt->execute(); 
                            $AllUsers = $stmt->fetch(PDO::FETCH_OBJ); 
                            
                            
                			if($_REQUEST['NPSID']=="BSJOLEDPFEIFMELFFF475f")
                			{     
                			    /*$rewq      = $AllUsers->upr;   
        			            $baSE =  base64_encode($rewq);      
								$Hash = base64_encode('3aab1ba9369138e54e9bb571f92f5736');      
								$digits = 16;
								$se16digit = rand(pow(10, $digits-1), pow(10, $digits)-1);    

								$Form1 = '{
								"base64encodedata": "'.$baSE.'",
								"mid": "3aab1ba9369138e54e9bb571f92f5736",
								"iv": "9999888888878890"
								}';


								$ch = curl_init('https://indicpay.in/api/encryption');                                             
								curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
								curl_setopt($ch, CURLOPT_POSTFIELDS, $Form1);                                                                  
								curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
								curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
								'X-VERIFY: '.$CheckSom, 
								'Content-Type: application/json', 
								'Content-Length: '.strlen($Form1))                                                                       
								);       																		 
								$responseDp = curl_exec($ch);   

								$url = "https://indicpay.in/api/payout/upi/dopayout";
								$curl = curl_init();
								curl_setopt($curl, CURLOPT_URL, $url);
								curl_setopt($curl, CURLOPT_HTTPHEADER, array('Accept: application/json','Content-Type: application/json','token: 3aab1ba9369138e54e9bb571f92f5736','iv: 9999888888878890','mid: IN2663117010'));
								curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

								$data ='{
								"body": "'.$responseDp.'",
								"hash": "'.$Hash.'"
								}';

								curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
								$resp = curl_exec($curl); 
								curl_close($curl);    */
								
								$access_token = $AllUsers->upr;    
                                $ch = curl_init('https://pay2kar.in/api/upi-transfer/v1/transfer-now');                                             
                                curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
                                curl_setopt($ch, CURLOPT_POSTFIELDS, $access_token);                                                                  
                                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
                                curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
                                'x-tera-tenant-region: IN', 
                                'Content-Type: application/json', 
                                'Content-Length: ' . strlen($access_token))                                                                       
                                );       																		 
                                $response = curl_exec($ch);    
								
                                $stmt=$conn->prepare("update  UI__UPreqst  set  status=1  where  id=:PyId ");  
                                $stmt->bindValue(':PyId', $_REQUEST['PyId'] , PDO::PARAM_STR);
                                $stmt->execute(); 
        			        }
                            header("Location: UPIManage.php");   
                            die;  
?>

