View file public_html/vipadz/money/verifytransfer.php

File size: 2.15Kb
<?php

include '../../db.php';
include '../../functions.php';

headtag("$SiteName - Verify Transfer");

if($adminlog==1){
$tnxid=formget("tnxid");

echo '<div class="title">Verify Transfer <font color="red">'.$tnxid.'</font></div>';
 {
 if(isset($_POST["otp"])){

$otp=formpost("otp");

$errors=array();

if(strlen($otp)<1){
  $errors[]='Please Enter OTP.';
 }

if(empty($errors)){
$fetch=mysql_fetch_array(mysql_query("SELECT * FROM transfers WHERE tnxid='$tnxid'"));
$sender=$fetch["sender"];
$receiver=$fetch["receiver"];
$payid=$fetch["payid"];
$amount=$fetch["amount"];
$ufetch=mysql_fetch_array(mysql_query("SELECT * FROM receivers WHERE receiverid='$receiver'"));
$name=$ufetch["name"];
$ifsc=$ufetch["ifsc"];
$accountno=$ufetch["accountno"];

$set = mysql_query("SELECT * FROM moneyconfig");
$ing = mysql_fetch_array($set);
$pin=$ing["pin"];
$authkey=$ing["authkey"];

$url='https://www.pay2all.in/moneyapi/pay/sendnow?pin='.$pin.'&authkey='.$authkey.'&senderid='.$sender.'&receiverid='.$receiver.'&txnid='.$tnxid.'&payid='.$payid.'&otp='.$otp.'';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FAILONERROR, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 9);
$transfer_contents = curl_exec($ch);
$transfer_decode=json_decode($transfer_contents);
$status=$transfer_decode->status;
$message=$transfer_decode->message;
curl_close($ch);

if($status=='Success')
{
$doit=mysql_query("UPDATE transfers SET otp='$otp',status='Success' WHERE tnxid='$tnxid'");
}

  if($doit){
   echo '<div class="success">'.$amount.' Rs Has Been Successfully Sent To '.$name.' '.$ifsc.' '.$accountno.' .</div>';
  }
  else {
   echo '<div class="error">'.$message.'</div>';
}

}
else {

dump_error($errors);

}
}

echo '<div class="form"><form method="post">Please Enter OTP Sent To Your Mobile | <a href="resendotp.php?act=transfer">Resend OTP</a><br/><input type="text" name="otp""/><br/><input type="submit" value="Verify Transfer"/></form></div>';

}

 echo '<a href="transfers.php"><div class="ua">Transfers</div></a>';
 include '../../foot.php';
 }
 else {
 header('Location:login.php');
 }
 ?>