<?php
error_reporting(0);
require_once('lib/AhkWeb_Config.php');
require_once('lib/AhkWebCheckSum.php');

$checkSum = "";
$upiuid = "paytmqr2810050501014ffnhthkzu7m@paytm";
$paramList = array();
$gateway_type = "Paytm";
$cust_Mobile = "8709566166";
$cust_Email = "ak7258251@gmail.com";
$orderId = "TEST".time();
$txnAmount = $_POST['amount'];
$txnNote = $_POST['userid'];

$callback_url = "https://fairbattle.earnmoreapp.in/fairb/pay/sucess.php";

if($gateway_type=="Paytm"){
    
$AHKWEB_TXN_URL='https://upi.clusterwebsolution.com/order/payment';

$upiuid = 'paytmqr2810050501014ffnhthkzu7m@paytm'; // Its Your Self UPI ID.

}else if($gateway_type=="Phone Pe"){

$AHKWEB_TXN_URL='https://upi.clusterwebsolution.com/order/paytm';

$upiuid = 'paytmqr2810050501014ffnhthkzu7m@paytm'; // Its Paytm Business UPI Unique ID.



}else if($gateway_type=="Google Pay"){
    
$AHKWEB_TXN_URL='https://upi.clusterwebsolution.com/order/process';   

$upiuid = 'paytmqr2810050501014ffnhthkzu7m@paytm';  // Its UPI Unique ID, (Url:http://example.com/UPIsAccounts).

}

// Create an array having all required parameters for creating checksum.
$paramList["upiuid"] = $upiuid;
$paramList["token"] = $token;
$paramList["orderId"] = $orderId ;
$paramList["txnAmount"] = $txnAmount;
$paramList["txnNote"] = $txnNote;
$paramList["callback_url"] = $callback_url;
$paramList["cust_Mobile"] = $cust_Mobile;
$paramList["cust_Email"] = $cust_Email;
$checkSum = AhkWebCheckSum::generateSignature($paramList,$secret);
?>
<html>
<head>
<title>Gateway Check Out Page</title>
</head>
<body>
	<center><h1>Please do not refresh this page...</h1></center>
		<form method="post" action="<?php echo $AHKWEB_TXN_URL ?>" name="f1">
		<table border="1">
			<tbody>
			<?php
			foreach($paramList as $name => $value) {
				echo '<input type="hidden" name="' . $name .'" value="' . $value . '">';
			}
			?>
			<input type="hidden" name="checksum" value="<?php echo $checkSum ?>">
			</tbody>
		</table>
		<script type="text/javascript">
			document.f1.submit();
		</script>
	</form>
</body>
</html>
