if($isValidChecksum == "TRUE") {
echo "<b>Checksum matched and following are the transaction details:</b>" . "<br/>";
if ($_POST["STATUS"] == "TXN_SUCCESS") {
echo "<b>Transaction status is success</b>" . "<br/>";
//Process your transaction here as success transaction.
//Verify amount & order id received from Payment gateway with your application's order id and amount.
}
else {
echo "<b>Transaction status is failure</b>" . "<br/>";
}
if (isset($_POST) && count($_POST)>0 )
{
$ORDERID = $_POST['ORDERID'];
$MID = $_POST['MID'];
$TXNID = $_POST['TXNID'];
$TXNAMOUNT = $_POST['TXNAMOUNT'];
$PAYMENTMODE = $_POST['PAYMENTMODE'];
$CURRENCY = $_POST['CURRENCY'];
$TXNDATE = $_POST['TXNDATE'];
$STATUS = $_POST['STATUS'];
$RESPCODE = $_POST['RESPCODE'];
$RESPMSG = $_POST['RESPMSG'];
$GATEWAYNAME = $_POST['GATEWAYNAME'];
$BANKTXNID = $_POST['BANKTXNID'];
$BANKNAME = $_POST['BANKNAME'];
$CHECKSUMHASH =$_POST['CHECKSUMHASH'];
$query = "INSERT into transaction (`ORDERID`,`MID`,`TXNID`,`TXNAMOUNT`,`PAYMENTMODE`,`CURRENCY`,`TXNDATE`,`STATUS`,`RESPCODE`,`RESPMSG`,`GATEWAYNAME`,`BANKTXNID`,`BANKNAME`,`CHECKSUMHASH`)
VALUES ('$ORDERID','$MID','$TXNID','$TXNAMOUNT','$PAYMENTMODE','$CURRENCY','$TXNDATE','$STATUS','$RESPCODE','$RESPMSG','$GATEWAYNAME','$BANKTXNID','$BANKNAME','$CHECKSUMHASH')";
$result = mysqli_query($connection, $query) or die(mysqli_error($connection));
}
}