| 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/ |
Upload File : |
<?php
$txnid = isset($_GET['txnid']) ? filter_var($_GET['txnid'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH) : '';
$token = isset($_GET['token']) ? filter_var($_GET['token'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH) : '';
if ($txnid && $token) {
// $mysqli = new mysqli('localhost', 'root', '', 'akiniktransactions', 3307);
$mysqli = new mysqli('localhost', 'akiniktransactions', '.3[HO07+LWo{', 'akiniktransactions');
$stmt = $mysqli->prepare("SELECT name FROM gateways WHERE is_default = 1 LIMIT 1");
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($gatewayName);
$stmt->fetch();
$stmt->close();
$stmt = $mysqli->prepare("SELECT COUNT(*), name, email, phone, currency, amount, payment_mode FROM transactions WHERE (txnid = ? AND token = ?)");
$stmt->bind_param('ss', $txnid, $token);
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($count, $name, $email, $phone, $currency, $amount, $payment_mode);
$stmt->fetch();
$stmt->close();
if ($count == 1) {
if ($currency === 'INR') {
$gateway = $gatewayName;
$stmt = $mysqli->prepare("UPDATE transactions SET payment_mode = ? WHERE (txnid = ? AND token = ?)");
$stmt->bind_param('sss', $gateway, $txnid, $token);
$stmt->execute();
$stmt->close();
} else {
$gateway = strtolower($payment_mode);
}
$surl = 'https://www.akinik.com/paymentcallback/' . $txnid . '/' . $token . '/success';
$furl = 'https://www.akinik.com/paymentcallback/' . $txnid . '/' . $token . '/failed';
if ($gateway === 'icici') {
date_default_timezone_set('Asia/Kolkata');
$isInr = $currency === 'INR';
$storeName = $isInr ? '3396068416' : '3396068424';
$currencyCode = $isInr ? '356' : '840';
$sharedSecret = $isInr ? '[?]@q]jnv11vM' : 'whq5A>yk@1HR';
$dateTime = date("Y:m:d-H:i:s");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Please wait...</title>
</head>
<body style="margin: 0;padding: 0;box-sizing: border-box;display: flex;align-items: center;justify-content: center;flex-direction: column;row-gap: 20px;height: 100vh;">
<form action="https://www4.ipg-online.com/connect/gateway/processing" method="post" name="gatewayform" id="iciciform">
<input type="hidden" name="hash_algorithm" value="HMACSHA256" />
<input type="hidden" name="checkoutoption" value="combinedpage" />
<input type="hidden" name="language" value="en_US" />
<input type="hidden" name="hashExtended" value="" />
<input type="hidden" name="storename" value="<?php echo $storeName; ?>" />
<input type="hidden" name="timezone" value="Asia/Kolkata" />
<input type="hidden" name="txndatetime" value="<?php echo $dateTime; ?>" />
<input type="hidden" name="txntype" value="sale" />
<input type="hidden" name="chargetotal" value="<?php echo $amount; ?>" />
<input type="hidden" name="currency" value="<?php echo $currencyCode; ?>" />
<input type="hidden" name="customerid" value="<?php echo $txnid; ?>" readonly />
<input type="hidden" name="email" value="<?php echo $email; ?>" readonly />
<input type="hidden" name="authenticateTransaction" value="true" />
<input type="hidden" name="responseFailURL" value="<?php echo $furl; ?>" />
<input type="hidden" name="responseSuccessURL" value="<?php echo $surl; ?>" />
<input type="hidden" name="transactionNotificationURL" value="https://www.akinik.com/transactions/listener/icici" />
<input type="submit" value="Click Here" style="display:none" />
</form>
<img src="https://www.akinik.com/images/paymentloading.gif" alt="Loading" width="48" />
<b>Please don't refresh or press back button.</b>
<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>
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 = "<?php echo $sharedSecret; ?>";
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.gatewayform.submit();
</script>
</body>
</html>
<?php
} elseif ($gateway === 'paypal') {
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Please wait...</title>
</head>
<body style="margin: 0;padding: 0;box-sizing: border-box;display: flex;align-items: center;justify-content: center;flex-direction: column;row-gap: 20px;height: 100vh;">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="gatewayform">
<input type="hidden" name="business" value="jpbr.delhi@gmail.com">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="Transaction">
<input type="hidden" name="item_number" value="<?php echo $txnid; ?>">
<input type="hidden" name="amount" value="<?php echo $amount; ?>">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="notify_url" value="https://www.akinik.com/transactions/listener/paypal">
<input type="hidden" name="cancel_return" value="<?php echo $furl; ?>">
<input type="hidden" name="return" value="<?php echo $surl; ?>">
<input type="submit" value="Click Here" style="display:none" />
</form>
<img src="https://www.akinik.com/images/paymentloading.gif" alt="Loading" width="48" />
<b>Please don't refresh or press back button.</b>
<script>
document.gatewayform.submit();
</script>
</body>
</html>
<?php
} elseif ($gateway === 'payumoney') {
$posted = array('key' => 'EPAfC8', 'txnid' => $txnid, 'amount' => $amount, 'productinfo' => 'Transaction', 'firstname' => $name, 'email' => $email, 'phone' => $phone);
$salt = '2eQBk83X';
$hash = '';
$hash_sequence = 'key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5|udf6|udf7|udf8|udf9|udf10';
if (sizeof($posted) > 0) {
$hash_vars_seq = explode('|', $hash_sequence);
$hash_string = '';
foreach ($hash_vars_seq as $hash_var) {
$hash_string .= isset($posted[$hash_var]) ? $posted[$hash_var] : '';
$hash_string .= '|';
}
$hash_string .= $salt;
$hash = strtolower(hash('sha512', $hash_string));
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Please wait...</title>
</head>
<body style="margin: 0;padding: 0;box-sizing: border-box;display: flex;align-items: center;justify-content: center;flex-direction: column;row-gap: 20px;height: 100vh;">
<form action="https://secure.payu.in/_payment" method="post" name="gatewayform">
<input type="hidden" name="key" value="EPAfC8" />
<input type="hidden" name="txnid" value="<?php echo $txnid; ?>" />
<input type="hidden" name="amount" value="<?php echo $amount; ?>" />
<input type="hidden" name="productinfo" value="Transaction" />
<input type="hidden" name="firstname" value="<?php echo $name; ?>" />
<input type="hidden" name="email" value="<?php echo $email; ?>" />
<input type="hidden" name="phone" value="<?php echo $phone; ?>" />
<input type="hidden" name="surl" value="<?php echo $surl; ?>" />
<input type="hidden" name="furl" value="<?php echo $furl; ?>" />
<input type="hidden" name="hash" value="<?php echo $hash; ?>" />
<input type="hidden" name="service_provider" value="payu_paisa" />
<input type="submit" value="Click Here" style="display:none" />
</form>
<img src="https://www.akinik.com/images/paymentloading.gif" alt="Loading" width="48" />
<b>Please don't refresh or press back button.</b>
<script>
document.gatewayform.submit();
</script>
</body>
</html>
<?php
} elseif ($gateway === 'phonepe') {
$apiKey = 'ae8b6576-27d2-4553-b670-bb8a0a6d1e6e';
$paymentData = array(
'merchantId' => 'AKINIKONLINE',
'merchantTransactionId' => $txnid,
'merchantUserId' => 'MUID' . $txnid,
'amount' => $amount * 100,
'redirectUrl' => 'https://www.akinik.com/transactions/phoneperesponse/' . $txnid . '/' . $token,
'redirectMode' => 'POST',
'callbackUrl' => 'https://www.akinik.com/transactions/listener/phonepe',
'mobileNumber' => $phone,
'paymentInstrument' => array(
'type' => 'PAY_PAGE',
)
);
$jsonencode = json_encode($paymentData);
$payloadMain = base64_encode($jsonencode);
$salt_index = 1;
$payload = $payloadMain . '/pg/v1/pay' . $apiKey;
$sha256 = hash('sha256', $payload);
$final_x_header = $sha256 . '###' . $salt_index;
$request = json_encode(array('request' => $payloadMain));
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.phonepe.com/apis/hermes/pg/v1/pay',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => $request,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-VERIFY: ' . $final_x_header,
'accept: application/json'
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
$res = json_decode($response);
if (isset($res->success) && $res->success == '1') {
$payUrl = $res->data->instrumentResponse->redirectInfo->url;
// header('Referrer-Policy: no-referrer');
// header('Location:' . $payUrl);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="refresh" content="0;url=<?php echo htmlspecialchars($payUrl); ?>">
<title>Please wait...</title>
</head>
<body style="margin: 0;padding: 0;box-sizing: border-box;display: flex;align-items: center;justify-content: center;flex-direction: column;row-gap: 20px;height: 100vh;">
<img src="https://www.akinik.com/images/paymentloading.gif" alt="Loading" width="48" />
<b>Please don't refresh or press back button.</b>
<script>
window.location.href = "<?php echo htmlspecialchars($payUrl); ?>";
</script>
</body>
</html>
<?php
exit();
} else {
header('Location:https://www.akinik.com');
exit();
}
} else {
header('Location:https://www.akinik.com');
exit();
}
} else {
header('Location:https://www.akinik.com');
exit();
}
} else {
header('Location:https://www.akinik.com');
exit();
}
?>