| Server IP : 192.169.170.185 / Your IP : 216.73.216.97 Web Server : Apache System : Linux p3plmcpnl495852.prod.phx3.secureserver.net 4.18.0-553.52.1.lve.el8.x86_64 #1 SMP Wed May 21 15:31:29 UTC 2025 x86_64 User : akhilnew ( 1712764) PHP Version : 5.6.40 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/akhilnew/public_html/orthopaper/payment/ |
Upload File : |
<?php
require_once('../inc/config.php');
$stmt = $mysqli->prepare("SELECT websitename, websiteemail, fromname, fromemail, replyname, replyemail FROM settings ORDER BY settingsid DESC LIMIT 1") or die('An error occurred. Please try after some time.');
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($websitename, $websiteemail, $fromname, $fromemail, $replyname, $replyemail);
$stmt->fetch();
$stmt->close();
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$name = $mysqli->real_escape_string($_POST['name']);
$email = $mysqli->real_escape_string($_POST['email']);
$country = $mysqli->real_escape_string($_POST['country']);
$phonecode = $mysqli->real_escape_string($_POST['phonecode']);
$phone = $mysqli->real_escape_string($_POST['phone']);
$address = $mysqli->real_escape_string($_POST['address']);
$city = $mysqli->real_escape_string($_POST['city']);
$state = $mysqli->real_escape_string($_POST['state']);
$pincode = $mysqli->real_escape_string($_POST['pincode']);
$refnumber = $mysqli->real_escape_string($_POST['refnumber'] ?: null);
$title = $mysqli->real_escape_string($_POST['title'] ?: null);
$currency = $mysqli->real_escape_string($_POST['currency']);
$amount = $mysqli->real_escape_string($_POST['amount']);
$gateway = $mysqli->real_escape_string($_POST['gateway']);
$reCAPTCHA = $_POST['g-recaptcha-response'];
$verifyResponse = json_decode(file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=6Le_OWwjAAAAAJCi-Zat3EZ-uYGVyy743MYMe4tD&response=' . $reCAPTCHA));
if (empty($name)) {
die(json_encode(array('t' => 'The name field is required.')));
} elseif (empty($email)) {
die(json_encode(array('t' => 'The email field is required.')));
} elseif (filter_var($email, FILTER_VALIDATE_EMAIL) === FALSE) {
die(json_encode(array('t' => 'The email field is incorrect.')));
} elseif (empty($country)) {
die(json_encode(array('t' => 'The country field is required.')));
} elseif (empty($phonecode)) {
die(json_encode(array('t' => 'The country field is required.')));
} elseif ($country == 'India' && strlen($phone) !== 10) {
die(json_encode(array('t' => 'The phone field is required 10 digits.')));
} elseif (empty($phone)) {
die(json_encode(array('t' => 'The phone field is required.')));
} elseif (empty($address)) {
die(json_encode(array('t' => 'The address field is required.')));
} elseif (empty($city)) {
die(json_encode(array('t' => 'The city field is required.')));
} elseif (empty($state)) {
die(json_encode(array('t' => 'The state field is required.')));
} elseif (empty($pincode)) {
die(json_encode(array('t' => 'The pincode field is required.')));
} elseif (empty($currency)) {
die(json_encode(array('t' => 'The currency field is required.')));
} elseif (empty($amount)) {
die(json_encode(array('t' => 'The amount field is required.')));
} elseif (is_numeric($amount) === FALSE or $amount <= 0) {
die(json_encode(array('t' => 'The amount field is incorrect.')));
} elseif (!$reCAPTCHA) {
die(json_encode(array('t' => 'Please click on the reCAPTCHA box.')));
} elseif (!$verifyResponse->success) {
die(json_encode(array('t' => 'Robot verification failed, Please try again.')));
} else {
$phoneWithCode = $phonecode . '-' . $phone;
$amount = sprintf("%.2f", $amount);
$txnid = substr(str_shuffle(implode(range('A', 'Z'))), 0, 2) . time() . substr(str_shuffle(implode(range('A', 'Z'))), -2);
$payment_type = 'Publication Charge';
$description = '<b>Publication Charge</b><br><br><b>Journal:</b> ' . $websitename . '<br><b>Title:</b> ' . $title . '<br><b>Ref. No.:</b> ' . $refnumber;
$payment_mode = $currency === 'INR' ? 'phonepe' : $gateway;
$txn_date = date('Y-m-d');
$source = 'AkiNik Publications';
$source_email = 'info@akinik.com';
$source_domain = 'https://www.akinik.com';
$source_from = 'info@akinik.com';
$source_address = 'H.Q.: 3, H-34, Sector 3, Rohini, Delhi-110085, India';
$status = 'pending';
$ip_address = $_SERVER['REMOTE_ADDR'];
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$token = strtoupper(hash('sha256', md5(mt_rand() . time() . uniqid(true))));
$referrer = $websitename;
$surl = $baseurl . 'payment/success/' . $txnid . '/' . $token;
$furl = $baseurl . 'payment/failed/' . $txnid . '/' . $token;
$created_at = date('Y-m-d H:i:s');
$akiniktxn = new mysqli('localhost', 'akiniktransactions', '.3[HO07+LWo{', 'akiniktransactions');
$stmt = $akiniktxn->prepare("INSERT INTO transactions(txnid, name, email, phone, address, city, state, pincode, country, currency, amount, journal, ref_number, title, payment_type, description, payment_mode, txn_date, source, source_email, source_domain, source_from, source_address, status, ip_address, user_agent, token, referrer, success_url, failed_url, created_at) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)") or die(json_encode(array('t' => 'An error occurred. Please try after some time.')));
$stmt->bind_param('ssssssssssdssssssssssssssssssss', $txnid, $name, $email, $phoneWithCode, $address, $city, $state, $pincode, $country, $currency, $amount, $websitename, $refnumber, $title, $payment_type, $description, $payment_mode, $txn_date, $source, $source_email, $source_domain, $source_from, $source_address, $status, $ip_address, $user_agent, $token, $referrer, $surl, $furl, $created_at);
$stmt->execute();
$stmt->close();
$akiniktxn->close();
if ($payment_mode === 'phonepe') {
die(json_encode(array('u' => 'https://www.akinik.com/phoneperedirector/' . $txnid . '/' . $token)));
} else {
die(json_encode(array('u' => 'https://www.akinik.com/paymentredirector/' . $txnid . '/' . $token . '/' . $payment_mode)));
}
// if (file_exists('../../../temp/PaymentGateway.php')) {
// require_once('../../../temp/PaymentGateway.php');
// $pg = new PaymentGateway($payment_mode);
// $pg->set($txnid, $name, $email, $phone, $currency, $amount, $surl, $furl, $country);
// die(json_encode($pg->pay()));
// } else {
// die(json_encode(array('t' => 'Something went wrong.')));
// }
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Make Payment</title>
<link rel="shortcut icon" href="<?php echo $imageurl;?>favicon.ico" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:wght@400;700&display=swap" rel="stylesheet">
<style>
*{outline: none;}
body{font-size: 14px;font-family: 'Roboto Condensed', sans-serif;overflow-y: scroll;}
.form-label{float: left;width: 100%;font-weight: 700;font-size: 12px;text-transform: uppercase;margin-bottom: 0;}
.form-control,.form-select{float: left;font-size: 14px;height: 36px;}
</style>
<script src="https://www.google.com/recaptcha/api.js" defer></script>
</head>
<body>
<div class="bg-primary container-fluid">
<div class="row py-2">
<div class="col"></div>
<div class="col d-flex align-items-center justify-content-center">
<a href="<?php echo $baseurl; ?>">
<img src="<?php echo $baseurl; ?>images/logowhite.png" alt="<?php echo $websitename; ?>" class="float-start d-block" height="36">
</a>
</div>
<div class="col d-flex align-items-center justify-content-end">
<a href="<?php echo $baseurl; ?>" class="nav-link text-white">Home</a>
</div>
</div>
</div>
<div class="container-lg mt-3 mt-lg-4">
<div class="row">
<div class="col-lg-8 mx-auto">
<form action="<?php echo $baseurl; ?>payment/" method="post" name="paymentform" onsubmit="return post(this)">
<div class="card">
<div class="card-header py-3">
<h6 class="mb-0 fw-bold">Make Payment</h6>
</div>
<div class="card-body">
<div class="row">
<div class="col-md-6 mb-3">
<label for="name" class="form-label">Name</label>
<input type="text" name="name" id="name" class="form-control" />
</div>
<div class="col-md-6 mb-3">
<label for="email" class="form-label">Email</label>
<input type="text" name="email" id="email" class="form-control" />
</div>
</div>
<div class="row">
<div class="col-md-6 mb-3">
<label for="email" class="form-label">Country</label>
<select name="country" autocomplete="off" class="form-select" onchange="phonecode.value = this.value ? event.target.options[event.target.selectedIndex].dataset.phonecode : ''; pnvm.hidden = this.value !== 'India';">
<option value="" selected="selected">Select Country</option>
<?php
$stmt = $mysqli->prepare("SELECT nicename, phonecode FROM country WHERE phonecode != '0' ORDER BY nicename");
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($nicename, $phonecode);
while ($stmt->fetch()) {
echo '<option value="' . $nicename . '" data-phonecode="+' . $phonecode . '">' . $nicename . '</option>';
}
$stmt->close();
?>
</select>
</div>
<div class="col-md-6 mb-3">
<label for="phone" class="form-label">whatsapp/mobile number <small class="text-muted">(10 digits phone number for INR)</small><span class="text-danger float-end">*</span></label>
<div class="input-group">
<input type="text" name="phonecode" id="phonecode" class="form-control px-0 text-center" style="max-width: 60px;background: #e5e5e5;" readonly />
<input type="text" name="phone" id="phone" class="form-control" />
</div>
</div>
</div>
<div class="row">
<div class="col mb-3">
<label for="address" class="form-label">address</label>
<input type="text" name="address" id="address" class="form-control" />
</div>
</div>
<div class="row">
<div class="col-md-4 mb-3">
<label for="city" class="form-label">city</label>
<input type="text" name="city" id="city" class="form-control" />
</div>
<div class="col-md-4 mb-3">
<label for="state" class="form-label">state</label>
<input type="text" name="state" id="state" class="form-control" />
</div>
<div class="col-md-4 mb-3">
<label for="pincode" class="form-label">pin code/post box no./zip code</label>
<input type="text" name="pincode" id="pincode" class="form-control" />
</div>
</div>
<div class="row">
<div class="col-lg-3 mb-3">
<label for="refnumber" class="form-label">Ref. Number <span style="color: #999;">(Optional)</span></label>
<input type="text" name="refnumber" id="refnumber" class="form-control" />
</div>
<div class="col-lg-9 mb-3">
<label for="title" class="form-label">Article Title <span style="color: #999;">(Optional)</span></label>
<input type="text" name="title" id="title" class="form-control" />
</div>
</div>
<div class="row">
<div class="col-lg-6 mb-3">
<label for="currency" class="form-label">Currency</label>
<select name="currency" id="currency" class="form-select" onchange="gatewayrow.hidden = this.value !== 'USD';gateway.selectedIndex = 0;">
<option value="INR">INR</option>
<option value="USD">USD</option>
</select>
</div>
<div class="col-lg-6 mb-3">
<label for="amount" class="form-label">Amount</label>
<input type="text" name="amount" id="amount" maxlength="6" class="form-control" />
</div>
</div>
<div class="row" id="gatewayrow" hidden>
<div class="col mb-3">
<label for="gateway" class="form-label">Gateway</label>
<select name="gateway" id="gateway" class="form-select">
<option value="icici" selected="selected">ICICI</option>
<option value="paypal">PayPal</option>
<option value="twocheckout">2Checkout</option>
</select>
</div>
</div>
<div class="row">
<div class="col">
<div class="g-recaptcha" data-sitekey="6Le_OWwjAAAAAF-lSnWcx_tkKMJW7zO55GpMnEjn"></div>
</div>
</div>
</div>
<div class="card-footer">
<button type="submit" id="b" class="btn btn-primary float-end py-2" style="font-size: 14px;">Make Payment</button>
</div>
</div>
</form>
</div>
</div>
</div>
<div id="te" class="toast align-items-center text-white bg-dark border-0 mx-auto mb-4 fixed-bottom" role="alert" aria-live="assertive" aria-atomic="true" data-bs-animation="false" data-bs-delay="15000">
<div id="tb" class="toast-body"></div>
</div>
<br clear="all"><br clear="all">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.0.0/crypto-js.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.33/moment-timezone-with-data-10-year-range.min.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.1/dist/js/bootstrap.bundle.min.js"></script>
<script>
var t = new bootstrap.Toast(te);
post = f => {
b.disabled = true;t.hide();tb.innerHTML = '';
fetch(f.action, { method: 'post', mode: 'same-origin', cache: 'no-cache', headers: { 'Accept': 'application/json' }, body: new FormData(f) })
.then(r => r.json())
.then(r => {
r.t ? (b.disabled = false, t.show(), tb.innerHTML = r.t) : '';
r.u ? location = r.u : '';
if (r.html) {
document.querySelector('body').innerHTML += r.html;
if (typeof r.pg !== 'undefined' && r.pg === 'icici') {
var paymentForm = $("#iciciform");
var paymentParameters = paymentForm.serializeArray().filter(function(item) {
return item.value !== "";
}).reduce(function(obj, item) {
obj[item.name] = item.value;
return obj;
}, {});
const sharedSecret = "whq5A>yk@1HR";
var messageSignatureContent = [];
const ignoreSignatureParameteres = ["hashExtended"];
Object.keys(paymentParameters).filter(key => !ignoreSignatureParameteres.includes(key)).sort().forEach(function(key, index) {
messageSignatureContent.push(paymentParameters[key]);
});
const messageSignature = CryptoJS.HmacSHA256(messageSignatureContent.join("|"), sharedSecret);
const messageSignatureBase64 = CryptoJS.enc.Base64.stringify(messageSignature);
$("input[name='hashExtended']").val(messageSignatureBase64);
}
document.redirect.submit();
}
})
.catch(error => {b.disabled = false;t.show();tb.innerHTML = error;}).finally(() => {});
return false;
}
</script>
</body>
</html>