|
|
@ -11,6 +11,16 @@ $("#payment-popup").on("popup:close", function () {
|
|
|
|
stopPaymentCheck = true;
|
|
|
|
stopPaymentCheck = true;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(".numpad-button").on("click", function () {
|
|
|
|
|
|
|
|
var val = $(this).data("value");
|
|
|
|
|
|
|
|
if (val == "C") {
|
|
|
|
|
|
|
|
$("#amount-box").val("");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#amount-box").val($("#amount-box").val() + val);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$("#showcodebtn").click(function () {
|
|
|
|
$("#showcodebtn").click(function () {
|
|
|
|
var amount = $("#amount-box").val() * 1.0;
|
|
|
|
var amount = $("#amount-box").val() * 1.0;
|
|
|
|
if (amount <= 0) {
|
|
|
|
if (amount <= 0) {
|
|
|
@ -47,8 +57,8 @@ function makeQrCode(amount, callback) {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
var base64 = window.btoa(svg);
|
|
|
|
var base64 = window.btoa(svg);
|
|
|
|
$("#qrcode").attr("src", 'data:image/svg+xml;base64,' + base64);
|
|
|
|
$("#qrcode").attr("src", 'data:image/svg+xml;base64,' + base64);
|
|
|
|
$("#pay-amount").text(data.amount);
|
|
|
|
$("#pay-amount").text(data.amount.toFixed(2));
|
|
|
|
$("#paid-amount").text(data.amount);
|
|
|
|
$("#paid-amount").text(data.amount.toFixed(2));
|
|
|
|
app.preloader.hide();
|
|
|
|
app.preloader.hide();
|
|
|
|
checkPaymentStatus(data.txcode);
|
|
|
|
checkPaymentStatus(data.txcode);
|
|
|
|
callback(true);
|
|
|
|
callback(true);
|
|
|
@ -69,6 +79,7 @@ function checkPaymentStatus(txcode) {
|
|
|
|
if (data.complete == true) {
|
|
|
|
if (data.complete == true) {
|
|
|
|
app.popup.close($("#payment-popup"));
|
|
|
|
app.popup.close($("#payment-popup"));
|
|
|
|
app.popup.open($("#paid-popup"));
|
|
|
|
app.popup.open($("#paid-popup"));
|
|
|
|
|
|
|
|
$("#amount-box").val("");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
setTimeout(function () {
|
|
|
|
setTimeout(function () {
|
|
|
|
checkPaymentStatus(txcode);
|
|
|
|
checkPaymentStatus(txcode);
|
|
|
|