| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/b2bzend/ |
Upload File : |
<?php
require_once __DIR__ . '/library/RazorPay/Razorpay.php';
use Razorpay\Api\Api;
if ($_SERVER['HTTP_HOST'] == 'local.b2bzend.com') {
$baseUrl = 'http://local.b2bzend.com/';
} else if ($_SERVER['HTTP_HOST'] == 'crm.ineedtrip.com') {
$baseUrl = 'https://crm.ineedtrip.com/';
} else if ($_SERVER['HTTP_HOST'] == 'st.globaltravelexchange.com') {
$baseUrl = 'http://st.globaltravelexchange.com/';
} else {
$baseUrl = 'https://globaltravelexchange.com/';
}
require_once 'cronjob/init.php';
error_reporting(E_ALL);
$TblAgency = new Travel_Model_TblAgency();
$crmcustomerObj = new Travel_Model_CRM_Customer();
$crmagencyleadaccountObj = new Travel_Model_CRM_AgencyLeadAccount();
$agencycustomerObj = new Travel_Model_CRM_AgencyCustomer();
$paymentMdl = new Payment_Model_Payment();
$resultArr = array();
if ($_POST) {
$AgencySysId = (int) $_POST['AgencySysId'];
$ru = $baseUrl . "gtxPayReturn.php";
$checkPaymentSetting = $paymentMdl->checkPaymentgatewaySetting($AgencySysId);
if (!empty($checkPaymentSetting) && $checkPaymentSetting['IsPaymentGateway'] == true) {
$CrPartyAccSysId = $AgencySysId;
$CrPartyName = $checkPaymentSetting['DisplayName'];
$ATOMPAYMENTURL = trim($checkPaymentSetting['PaymentUrl']);
$ATOMLOGIN = trim($checkPaymentSetting['PaymentMerchantId']);
$ATOMPASS = trim($checkPaymentSetting['PaymentSecretPwd']);
$ATOMPRODID = trim($checkPaymentSetting['ProdId']);
$REQHASHKEY = trim($checkPaymentSetting['ReqHashKey']);
$RESPHASHKEY = trim($checkPaymentSetting['RespHashKey']);
$AESREQUESTKEY = trim($checkPaymentSetting['ReqAESKey']);
$AESREQUESTIV = trim($checkPaymentSetting['ReqAESSaltKey']);
$AESRESPONSEKEY = trim($checkPaymentSetting['ResAESKey']);
$AESRESPONSEIV = trim($checkPaymentSetting['ResAESSaltKey']);
} else {
$ATOMPAYMENTURL = "https://payment.atomtech.in/paynetz/epi/fts";
$ATOMLOGIN = "23860";
$ATOMPASS = "CATABATIC@123";
$ATOMPRODID = "CATABATIC";
$REQHASHKEY = "5a1507a1ad2b194e5b";
$RESPHASHKEY = "0d3c1adc88d7f02ca6";
$AESREQUESTKEY = "83D1E1EC3DEE483BB698935F9B323860";
$AESREQUESTIV = "83D1E1EC3DEE483BB698935F9B323860";
$AESRESPONSEKEY = "19DE2650AF672D308C508346BDD23860";
$AESRESPONSEIV = "19DE2650AF672D308C508346BDD23860";
}
function GUIDD() {
if (function_exists('com_create_guid') === true) {
return trim(com_create_guid(), '{}');
}
return sprintf('%04X%04X%04X%04X%04X%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535));
}
$paymentMdl = new Payment_Model_Payment();
$txnid = GUIDD();
$amount = isset($_POST['Amount']) ? (float) $_POST['Amount'] : '';
$txncurr = trim("INR");
$fullName = (isset($_POST['FullName']) && $_POST['FullName'] != '') ? trim($_POST['FullName']) : '';
$EmailId = isset($_POST['Email']) ? trim($_POST['Email']) : '';
$MobileNo = isset($_POST['Phone']) ? trim($_POST['Phone']) : '';
$companyName = $AgencySysId;
if (trim($checkPaymentSetting['Title']) == 'Razorpay') {
$keyId = $ATOMLOGIN;
$AESRESPONSEKEY = "19DE2650AF672D308C508346BDD23860";
$transactionResponse = new Travel_Model_AtomAES();
$returnPerameter = $transactionResponse->encrypt($keyId, $AESRESPONSEKEY, $AESRESPONSEKEY);
$amount = $amount * 100;
$api = new Api($keyId, $ATOMPASS);
$orderData = [
'receipt' => time(),
'amount' => $amount, // 39900 rupees in paise
'currency' => $txncurr,
];
$razorpayOrder = $api->order->create($orderData);
$razorpayOrderId = $razorpayOrder->id;
$data = [
"key" => $keyId,
"amount" => $amount,
"name" => trim($checkPaymentSetting["AgencyDisplayName"]),
"description" => trim($checkPaymentSetting["AgencyDisplayName"]),
"image" => $baseUrl . "public/upload/media/agency/" . $AgencySysId . "/" . trim($checkPaymentSetting["Logo"]),
"prefill" =>
[
"name" => $fullName,
"email" => $EmailId,
"contact" => $MobileNo
],
"notes" =>
[
"address" => "India",
"merchant_order_id" => $txnid,
],
"theme" =>
[
"color" => "#FC9F84"
],
"order_id" => $razorpayOrderId,
];
?>
<script src="https://checkout.razorpay.com/v1/checkout.js"></script>
<form name='razorpayform' action="<?php echo $ru; ?>?razor=<?php echo $returnPerameter; ?>" method="POST">
<input type="hidden" name="razorpay_order_id" id="razorpay_order_id">
<input type="hidden" name="razorpay_payment_id" id="razorpay_payment_id">
<input type="hidden" name="razorpay_signature" id="razorpay_signature" >
</form>
<script>
var options = <?php echo json_encode($data); ?>;
options.handler = function (response) {
//console.log(response)
document.getElementById('razorpay_payment_id').value = response.razorpay_payment_id;
document.getElementById('razorpay_signature').value = response.razorpay_signature;
document.getElementById('razorpay_order_id').value = response.razorpay_order_id;
document.razorpayform.submit();
};
options.theme.image_padding = false;
var rzp = new Razorpay(options);
rzp.open();
e.preventDefault();
</script>
<?php
} else if (trim($checkPaymentSetting['Title']) == 'CASHFEE') {
extract($_POST);
$secretKey = $ATOMPASS;
$cashfeeru = $ru . '?login=' . $ATOMLOGIN;
$postData = array(
"appId" => $ATOMLOGIN,
"orderId" => $txnid,
"orderAmount" => $amount,
"orderCurrency" => $txncurr,
"orderNote" => $companyName,
"customerName" => $fullName,
"customerPhone" => $MobileNo,
"customerEmail" => $EmailId,
"returnUrl" => $cashfeeru,
"notifyUrl" => $cashfeeru,
);
ksort($postData);
$signatureData = "";
foreach ($postData as $key => $value) {
$signatureData .= $key . $value;
}
$signature = hash_hmac('sha256', $signatureData, $secretKey, true);
$signature = base64_encode($signature);
?>
<!DOCTYPE html>
<html>
<head>
<title>Cashfree - Signature Generator</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body onload="document.frm1.submit()">
<form action="<?php echo $ATOMPAYMENTURL; ?>" name="frm1" method="post">
<input type="hidden" name="signature" value='<?php echo $signature; ?>'/>
<input type="hidden" name="orderNote" value='<?php echo $companyName; ?>'/>
<input type="hidden" name="orderCurrency" value='<?php echo $txncurr; ?>'/>
<input type="hidden" name="customerName" value='<?php echo $fullName; ?>'/>
<input type="hidden" name="customerEmail" value='<?php echo $EmailId; ?>'/>
<input type="hidden" name="customerPhone" value='<?php echo $MobileNo; ?>'/>
<input type="hidden" name="orderAmount" value='<?php echo $amount; ?>'/>
<input type ="hidden" name="notifyUrl" value='<?php echo $cashfeeru; ?>'/>
<input type ="hidden" name="returnUrl" value='<?php echo $cashfeeru; ?>'/>
<input type="hidden" name="appId" value='<?php echo $ATOMLOGIN; ?>'/>
<input type="hidden" name="orderId" value='<?php echo $txnid; ?>'/>
</form>
</body>
</html>
<?php
} else if (trim($checkPaymentSetting['Title']) == 'Nestpay 3D Pay') {
// echo "<pre>";print_r($_POST);exit;
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Pay Online</title>
<link rel="stylesheet" href="<?php echo $baseUrl; ?>public/feedback/feedback-form/css/bootstrap.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<link href="<?php echo $baseUrl; ?>public/feedback/feedback-form/font-awesome-4.7.0/css/font-awesome.min.css"
rel="stylesheet" type="text/css">
<link rel="stylesheet" href="<?php echo $baseUrl; ?>public/feedback/feedback-form/css/feedback.css">
<link rel="stylesheet" href="<?php echo $baseUrl; ?>public/countrycode/style.css">
<style>
.txtfield.country_code {
border: 1px solid #ddd;
height: 45px;
}
.country_details {
height: 45px;
}
</style>
</head>
<body>
<div class="feedback_wrapper FeedBackFormHtml" id="feedback_wrapperMain">
<div class="container">
<div class="<?php if ($source != 'Website') { ?>imagebg<?php } ?>"></div>
<div class="row top-space">
<div class="col-md-8 col-md-offset-2 form-container">
<div class="feedbacklogo">
<p> </p>
<h1>Please Enter All The Following Information And Click The "Pay" Button</h1>
<div class="clearfix"></div>
</div>
<?php
$clientId = $ATOMLOGIN;
$amount = $amount;
$oid = time();
$okUrl = "https://globaltravelexchange.com/albanian/return.php";
$failUrl = "https://globaltravelexchange.com/albanian/return.php";
$rnd = microtime();
$instalment = "1";
$trantype = $ATOMPRODID;
$storekey = $ATOMPASS;
$hashstr = $clientId . $oid . $amount . $okUrl . $failUrl . $trantype . $instalment . $rnd . $storekey;
$hash = base64_encode(pack('H*', sha1($hashstr)));
?>
<center>
<form method="post" action="<?php echo $ATOMPAYMENTURL; ?>">
<div class="form-group">
<div class="row">
<label for="name" class="col-sm-4 control-label hidden-xs">Credit Card Number<span style="color:red;font-weight:300;">*</span>:</label>
<div class="col-sm-8">
<input type="text" class="form-control commanClass" id="pan" value="" name="pan" size="20">
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<label for="name" class="col-sm-4 control-label hidden-xs">CVV<span style="color:red;font-weight:300;">*</span>:</label>
<div class="col-sm-8">
<input type="text" class="form-control commanClass" id="cv2" value="" name="cv2" size="4">
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<label for="name" class="col-sm-4 control-label hidden-xs">Expiration Date Year/ Month<span style="color:red;font-weight:300;">*</span>:</label>
<div class="col-sm-4">
<input type="text" placeholder="Year" class="form-control commanClass" id="Ecom_Payment_Card_ExpDate_Year" value="" name="Ecom_Payment_Card_ExpDate_Year">
</div>
<div class="col-sm-4">
<input type="text" placeholder="Month" class="form-control commanClass" id="Ecom_Payment_Card_ExpDate_Month" value="" name="Ecom_Payment_Card_ExpDate_Month">
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<label for="name" class="col-sm-4 control-label hidden-xs">Choosing Visa Master Card</label>
<div class="col-sm-8"><select name="cardType" class="Country form-control commanClass" id="cardType">
<option value="1" selected="selected">Visa</option>
<option value="2">MasterCard</option>
</select>
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div align="center" colspan="2">
<input class="btn btn-feedbacksubmit payFormSubmitBtn" type="submit" value="Complete Payment"/>
</div>
</div>
</div>
<input type="hidden" name="clientid" value="<?php echo $clientId ?>">
<input type="hidden" name="amount" value="<?php echo $amount ?>">
<input type="hidden" name="oid" value="<?php echo $oid ?>">
<input type="hidden" name="okUrl" value="<?php echo $okUrl ?>">
<input type="hidden" name="failUrl" value="<?php echo $failUrl ?>">
<input type="hidden" name="rnd" value="<?php echo $rnd ?>" >
<input type="hidden" name="hash" value="<?php echo $hash ?>" >
<input type="hidden" name="trantype" value="<?php echo $trantype ?>" >
<input type="hidden" name="instalment" value="<?php echo $instalment ?>" >
<input type="hidden" name="storetype" value="3D_PAY_HOSTING" >
<input type="hidden" name="lang" value="en">
<input type="hidden" name="currency" value="008">
<input type="hidden" name="BillToCompany" value="My Company Name">
<input type="hidden" name="Fismi" value="">
<input type="hidden" name="BillToName" value="<?php echo $fullName; ?>">
<input type="hidden" name="BillToStreet1" value="">
<input type="hidden" name="BillToStreet2" value="">
<input type="hidden" name="BillToStateProv" value="">
<input type="hidden" name="BillToCity" value="<?php echo $fullName; ?>">
<input type="hidden" name="BillToPostalCode" value="">
<input type="hidden" name="tel" value="<?php echo isset($_POST['CountryCode']) ? $_POST['CountryCode'] : '' . '-' . isset($_POST['Phone']) ? $_POST['Phone'] : ''; ?>">
<input type="hidden" name="fulkekod" value="">
<input type="hidden" name="ShipToCompany" value="">
<input type="hidden" name="ShipToName" value="">
<input type="hidden" name="ShipToStreet1" value="">
<input type="hidden" name="ShipToStreet2" value="">
<input type="hidden" name="ShipToStateProv" value="">
<input type="hidden" name="ShipToCity" value="">
<input type="hidden" name="ShipToPostalCode" value="">
<input type="hidden" name="ShipToCountry" value="">
<input type="hidden" name="itemnumber1" value="">
<input type="hidden" name="productcode1" value="">
<input type="hidden" name="qty1" value="">
<input type="hidden" name="desc1" value="">
<input type="hidden" name="id1" value="">
<input type="hidden" name="price1" value="">
<input type="hidden" name="total1" value="">
</form>
</center>
</div>
</div>
</div>
</div>
</body>
</html>
<?php
} else {
$login = trim($ATOMLOGIN);
$pass = trim($ATOMPASS);
$ttype = trim("NBFundTransfer");
$prodid = trim($ATOMPRODID);
$signatureVal = $login . $pass . $ttype . $prodid . $txnid . $amount . $txncurr;
$signature = hash_hmac("sha512", $signatureVal, $REQHASHKEY, false);
$datenow = date("d/m/Y h:m:s");
$modifiedDate = str_replace(" ", "%20", $datenow);
$City = isset($_POST['City']) ? $_POST['City'] : '';
$Pincode = isset($_POST['Pincode']) ? $_POST['Pincode'] : '';
$websiteURL = isset($_POST['NameonBill']) && $_POST['NameonBill'] != '' ? $_POST['NameonBill'] : 'NO Web site';
$Address = isset($_POST['Address']) ? $_POST['Address'] : '';
$postFields = "";
$postFields .= "&login=$login";
$postFields .= "&pass=$pass";
$postFields .= "&ttype=$ttype";
$postFields .= "&prodid=$prodid";
$postFields .= "&amt=$amount";
$postFields .= "&txncurr=$txncurr";
$postFields .= "&txnscamt=0";
$postFields .= "&signature=$signature";
$postFields .= "&clientcode=" . urlencode(base64_encode($AgencySysId));
$postFields .= "&txnid=" . $txnid;
$postFields .= "&date=" . $modifiedDate;
$postFields .= "&custacc=123456789";
$postFields .= "&udf1=$fullName";
$postFields .= "&udf2=$EmailId";
$postFields .= "&udf3=$MobileNo";
$postFields .= "&udf8=$Pincode";
$postFields .= "&udf4=$City";
$postFields .= "&udf9=$websiteURL";
$postFields .= "&ru=$ru";
$postString = substr($postFields, 1);
$encryptedData = new Travel_Model_AtomAES();
$encryptedVal = strtoupper($encryptedData->encrypt($postString, $AESREQUESTKEY, $AESREQUESTIV));
$sendUrl = $ATOMPAYMENTURL . "?login=$login&encdata=" . $encryptedVal . "\n";
header("Location: " . $sendUrl);
exit;
}
}
function sanitize_data($input_data) {
$searchArr = array("document", "write", "alert", "%", "$", ";", "+", "|", "#", "<", ">", "\'");
$input_data = str_replace("script", "", $input_data);
$input_data = str_replace("iframe", "", $input_data);
$input_data = str_replace($searchArr, "", $input_data);
return htmlentities(stripslashes($input_data), ENT_QUOTES);
}