73 строки
2.8 KiB
HTML
73 строки
2.8 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/aes.js"></script>
|
|
<style type="text/css">
|
|
.PaymentRequest {
|
|
display: none
|
|
}
|
|
</style>
|
|
</head>
|
|
<body class="PaymentRequest">
|
|
<h2>Axis Integration:</h2>
|
|
<form id="form1" method="post" action="https://uat-etendering.axisbank.co.in/easypay2.0/frontend/index.php/api/payment"
|
|
enctype="application/x-www-form-urlencoded">
|
|
<div>
|
|
<b>Payment Request</b><br />
|
|
|
|
<label for="i">Enter Payment Request:</label>
|
|
|
|
<input name="i" type="text" id="paymentRequestInput" />
|
|
|
|
<input id="btnpayment" type="submit" value="PaymentRequest" /><br /><br />
|
|
|
|
</div>
|
|
</form>
|
|
<script type="text/javascript">
|
|
|
|
$("#form1").submit(function () {
|
|
var jqxhr = $.post('https://uat-etendering.axisbank.co.in/easypay2.0/frontend/index.php/api/payment', $('#form1').serialize())
|
|
.success(function () {
|
|
debugger;
|
|
var loc = jqxhr.getResponseHeader('Location');
|
|
var a = $('<a/>', { href: loc, text: loc });
|
|
$('#message').html(a);
|
|
})
|
|
.error(function () {
|
|
$('#message').html("Error posting the update.");
|
|
});
|
|
return false;
|
|
});
|
|
function readCookie(name) {
|
|
var nameEQ = name + "=";
|
|
var ca = document.cookie.split(';');
|
|
for (var i = 0; i < ca.length; i++) {
|
|
var c = ca[i];
|
|
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
|
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
|
}
|
|
return null;
|
|
}
|
|
var cookie = readCookie("12345");
|
|
var bytes = CryptoJS.AES.decrypt(cookie, 'unibase');
|
|
var plaintext = bytes.toString(CryptoJS.enc.Utf8);
|
|
$('#paymentRequestInput').val(plaintext);
|
|
function setCookie(cname, cvalue, exdays) {
|
|
|
|
let _cookievalue = "";
|
|
if (cvalue != null && cvalue != "")
|
|
_cookievalue = window['CryptoJS'].AES.encrypt(cvalue, "unibase").toString();
|
|
|
|
var d = new Date();
|
|
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
|
|
var expires = "expires=" + d.toUTCString();
|
|
document.cookie = cname + "=" + _cookievalue + ";" + expires + ";path=/;samesite=none;secure=true";
|
|
}
|
|
var clearCookie = setCookie("12345", plaintext, 1);
|
|
$('#btnpayment').trigger('click');
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|