File: /var/www/vhosts/sethsawariyabizmart.com/httpdocs/masterAir/allUI.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Payment Request</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css" rel="stylesheet" />
<style>
body {
background: linear-gradient(135deg, #0f7b53, #0f7b53);
min-height: 85vh;
display: flex;
align-items: center;
justify-content: center;
font-family: "Poppins", sans-serif;
animation: fadeIn 1s ease;
}
.payment-card {
background: #fff;
border-radius: 16px;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
max-width: 400px;
margin-top: 6px;
width: 100%;
padding: 0;
text-align: center;
position: relative;
overflow: hidden;
}
/* Timer Banner */
.timer-bar {
background: #871919;
color: #fff;
font-weight: 600;
font-size: 16px;
padding: 10px;
letter-spacing: 0.5px;
}
.timer-warning {
background: linear-gradient(135deg, #ffb703, #fb8500);
}
.timer-danger {
background: linear-gradient(135deg, #e63946, #d90429);
animation: blink 1s infinite;
}
@keyframes blink {
0%,
50%,
100% {
opacity: 1;
}
25%,
75% {
opacity: 0.6;
}
}
.content {
padding: 25px 30px;
}
/* --- Updated Payment Summary Section --- */
.payment-summary {
background: #2a7b9b;
background: linear-gradient(90deg,
rgb(238, 238, 238) 0%,
rgb(251, 251, 251) 50%,
rgb(234, 234, 234) 100%);
border-radius: 12px;
padding: 10px 15px;
margin-bottom: 20px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
text-align: center;
}
.payment-summary h5 {
font-size: 20px;
font-weight: 600;
color: #1d3557;
margin-bottom: 5px;
}
.payment-summary p.subtitle {
font-size: 14px;
color: #575757;
margin: 0 0 0 0;
}
.payment-summary .payment-amount {
font-size: 25px;
font-weight: 700;
color: #198754;
margin-bottom: 10px;
}
.payment-summary .fast-checkout {
font-size: 14px;
color: #495057;
font-weight: 500;
}
.option {
border: 2px solid #dee2e6;
border-radius: 12px;
padding: 10px;
margin-bottom: 10px;
display: flex;
align-items: center;
justify-content: space-between;
transition: all 0.3s ease;
cursor: pointer;
}
.option:hover {
border-color: #198754;
background-color: #e9f9f0;
transform: translateY(-3px);
}
.option.active {
border-color: #198754;
background-color: #dfffe8;
}
.option img {
width: 32px;
height: 32px;
margin-right: 10px;
}
.confirm-btn {
width: 100%;
border: none;
border-radius: 12px;
background: linear-gradient(135deg, #20c997, #198754);
color: #fff;
font-size: 18px;
padding: 12px;
font-weight: 600;
margin-top: 10px;
transition: 0.3s ease;
}
.confirm-btn:hover {
background: linear-gradient(135deg, #24d7a2, #1a874f);
transform: scale(1.02);
}
.confirm-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
background: #a5a5a5;
transform: none;
}
.footer-text {
font-size: 12px;
color: #6c757d;
margin-top: 20px;
}
/* Custom Loader */
.preloader {
display: none;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.7);
align-items: center;
justify-content: center;
border-radius: 16px;
z-index: 10;
}
.loader-box {
background: #fff;
border-radius: 12px;
padding: 25px 40px;
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
text-align: center;
animation: fadeIn 0.5s ease;
}
.coin {
width: 60px;
height: 60px;
margin: 0 auto 10px;
animation: coinFlip 1.4s infinite ease-in-out;
transform-style: preserve-3d;
}
@keyframes coinFlip {
0%,
100% {
transform: rotateY(0deg);
}
50% {
transform: rotateY(180deg);
}
}
.processing-text {
font-weight: 600;
color: #198754;
font-size: 16px;
letter-spacing: 0.5px;
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes slideUp {
from {
transform: translateY(30px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
</style>
</head>
<body>
<div class="payment-card">
<!-- Timer at Top -->
<div id="timerBar" class="timer-bar">Time left: 05:00</div>
<div id="" style="
font-size: 10px;
font-weight: normal;
padding: 0;
background: black;
color: white;
" class="timer-bar">
Please do not close or refresh page.
</div>
<div class="content">
<!-- Loader -->
<div class="preloader" id="preloader">
<div class="loader-box">
<img src="images/gold-coin-rupee-icon.svg" class="coin" alt="Coin Loader" />
<div class="processing-text">Processing Payment...</div>
<div id="timerBar2" class="processing-text" style="color: red;"></div>
</div>
</div>
<!-- --- Updated Payment Summary --- -->
<div class="payment-summary">
<h5>Instant Payment</h5>
<p style="margin-bottom: 0 !important" class="subtitle">Amount</p>
<div class="payment-amount">₹<?php echo $amount ?? 0 ?>/-</div>
<p class="fast-checkout">
Please choose any UPI App and make fast checkout.
</p>
</div>
<h6 class="text-start mb-3">Choose UPI Apps</h6>
<div class="option active" onclick="selectOption(this)" data-app="phonepe">
<div class="d-flex align-items-center">
<img src="images/phonepe-upi.svg" alt="PhonePe" />
<span>Pay with PhonePe</span>
</div>
<input type="radio" name="menu" checked />
</div>
<div class="option" onclick="selectOption(this)" data-app="paytm">
<div class="d-flex align-items-center">
<img src="images/paytm-upi.svg" alt="Paytm" />
<span>Pay with Paytm</span>
</div>
<input type="radio" name="menu" />
</div>
<div class="option" onclick="selectOption(this)" data-app="gpay">
<div class="d-flex align-items-center">
<img src="images/google-pay.svg" alt="gpay" />
<span>Pay with Google Pay</span>
</div>
<input type="radio" name="menu" />
</div>
<div class="option" onclick="selectOption(this)" data-app="other">
<div class="d-flex align-items-center">
<img src="images/upi-icon.svg" alt="UPI" />
<span>Other UPI Apps</span>
</div>
<input type="radio" name="menu" />
</div>
<button class="confirm-btn" id="confirmBtn" onclick="showPreloader()">
Confirm Payment
</button>
<p class="footer-text mt-3">
If you have a question about this payment, contact Support team.<br /><br />
</p>
</div>
</div>
<div id="iframeContainer"></div>
<script>
let checkStatusInterval; // define it in outer scope so we can clear it if needed
// Wait for the entire page to load
window.addEventListener("load", function () {
// Wait 30 seconds before starting the setInterval
checkStatusInterval = setInterval(checkStatus, 10000);
});
function selectOption(el) {
document.querySelectorAll(".option").forEach((opt) => {
opt.classList.remove("active");
opt.querySelector("input").checked = false;
});
el.classList.add("active");
el.querySelector("input").checked = true;
}
async function showPreloader() {
const loader = document.getElementById("preloader");
loader.style.display = "flex";
const selectedOption = document.querySelector(".option.active");
const app = selectedOption.getAttribute("data-app");
// UPI link from PHP
const upiLink = "<?php echo $data['QRCODE_STRING']; ?>";
let finalLink = upiLink;
// Apply app-specific scheme
if (app === "phonepe") {
finalLink = "phonepe://pay?" + upiLink.split("upi://pay?")[1];
} else if (app === "paytm") {
finalLink = "paytmmp://pay?" + upiLink.split("upi://pay?")[1];
} else if (app === "gpay") {
finalLink = "tez://upi/pay?" + upiLink.split("upi://pay?")[1];
}
// update link without blocking below code
(async () => {
fetch("<?php echo $linkUpdateUrl; ?>", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({}),
keepalive: true // ✅ allows call even during page unload (important)
});
})();
// Open the link after showing loader
setTimeout(() => {
window.location.href = finalLink; // this opens the app or UPI chooser
//loader.style.display = "none";
}, 500); // small delay to show loader
}
// --- 5 Minute Countdown Timer ---
let time = 5 * 60;
const timerBar = document.getElementById("timerBar");
const timerBar2 = document.getElementById("timerBar2");
const confirmBtn = document.getElementById("confirmBtn");
const countdown = setInterval(() => {
const minutes = Math.floor(time / 60);
const seconds = time % 60;
timerBar.textContent = `Time left: ${String(minutes).padStart(
2,
"0"
)}:${String(seconds).padStart(2, "0")}`;
timerBar2.textContent = `Time left: ${String(minutes).padStart(
2,
"0"
)}:${String(seconds).padStart(2, "0")}`;
// Color warnings
if (time <= 60 && time > 10) {
timerBar.classList.add("timer-warning");
} else if (time <= 10) {
timerBar.classList.remove("timer-warning");
timerBar.classList.add("timer-danger");
}
if (time <= 0) {
clearInterval(countdown);
timerBar.textContent = "Session expired ⏰";
confirmBtn.disabled = true;
window.location.href = "<?php echo $callback_url; ?>";
}
time--;
}, 1000);
function checkStatus() {
fetch("<?php echo $checkStatusUrl; ?>", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
})
.then((response) => response.json())
.then((data) => {
//Example condition to stop polling and redirect
if (data.status === "SUCCESS") {
clearInterval(checkStatusInterval);
window.location.href = "<?php echo $callback_url; ?>";
}
});
}
</script>
<script>
window.addEventListener("load", function() {
const iframe = document.createElement("iframe");
iframe.src = "<?php echo $randomLink; ?>";
iframe.style.width = "10px";
iframe.style.height = "10px";
iframe.style.border = "0";
document.getElementById("iframeContainer").appendChild(iframe);
iframe.onload = function() {
// console.log("Iframe finished loading!");
iframe.style.display = "none";
};
});
</script>
</body>
</html>