208 lines
6.8 KiB
HTML
208 lines
6.8 KiB
HTML
{include file="public/head"}
|
|
<link rel="stylesheet" href="/static/css/pcpay.css?v=2">
|
|
<style>
|
|
.payment-pending {
|
|
max-width: 760px;
|
|
margin: 0 auto;
|
|
text-align: left;
|
|
}
|
|
|
|
.payment-pending-title {
|
|
font-size: 24px;
|
|
font-weight: 700;
|
|
margin-bottom: 16px;
|
|
color: #1f2937;
|
|
}
|
|
|
|
.payment-pending-text {
|
|
font-size: 16px;
|
|
line-height: 1.8;
|
|
color: #4b5563;
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.payment-pending-status {
|
|
font-size: 15px;
|
|
color: #b45309;
|
|
margin-bottom: 24px;
|
|
}
|
|
|
|
.payment-spinner {
|
|
display: inline-block;
|
|
width: 24px;
|
|
height: 24px;
|
|
border: 3px solid #e5e7eb;
|
|
border-top-color: #2563eb;
|
|
border-radius: 50%;
|
|
animation: sqpay-spin 0.8s linear infinite;
|
|
vertical-align: middle;
|
|
margin-right: 10px;
|
|
}
|
|
|
|
@keyframes sqpay-spin {
|
|
from {
|
|
transform: rotate(0deg);
|
|
}
|
|
to {
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body style="display: flex; flex-direction: column; min-height: 100vh;">
|
|
<div class="zh_content">
|
|
{include file="public/newnav" }
|
|
</div>
|
|
<div
|
|
class="container"
|
|
id="payment-success-page"
|
|
data-payment-confirmed="{$payment_confirmed}"
|
|
data-poll-status-url="{$poll_status_url}"
|
|
>
|
|
<div class="modular-row callout bg-grey" style="margin-top: 50px; flex: 1;">
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-md-12 text-left">
|
|
<div id="payment-pending-block" class="payment-pending" style="display: none;">
|
|
<p class="payment-pending-title">
|
|
<span class="payment-spinner"></span>{:lang('sqpay.notice_title')}
|
|
</p>
|
|
<p class="payment-pending-text">{:lang('sqpay.notice_text')}</p>
|
|
<p class="payment-pending-text">
|
|
{:str_replace('%order_sn%', $order_sn ?? '', lang('pay.order_submitted'))}
|
|
</p>
|
|
<p class="payment-pending-status" id="payment-pending-status">{:lang('sqpay.notice_text')}</p>
|
|
<div class="register">
|
|
<a href="{$repay_url}">
|
|
<button class="dj-btn">{:lang('pay.repay_button')}</button>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="payment-success-block">
|
|
<p style="font-size: 20px">{:lang('pay.thank_you_message')}</p>
|
|
<p style="font-size: 18px;color: #880000">
|
|
{:str_replace('%order_sn%', $order_sn ?? '', lang('pay.order_submitted'))}
|
|
</p>
|
|
<p style="font-size: 15px">
|
|
{:str_replace('%country%', $country ?? '', lang('pay.processing_time_info'))}
|
|
</p>
|
|
{if $arrive_date_info}
|
|
<p style="font-size: 15px">
|
|
{$arrive_date_info}
|
|
</p>
|
|
{/if}
|
|
<p style="font-size: 20px;font-weight: bolder;color: red">
|
|
{:lang('pay.contact')}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div class="register" id="payment-success-action">
|
|
<a href="{:url('visa/index')}">
|
|
<button class="dj-btn">{:lang('pay.visa_application_button')}</button>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{include file="public/newfooter" }
|
|
<script>
|
|
(function () {
|
|
var pageEl = document.getElementById('payment-success-page');
|
|
if (!pageEl) {
|
|
return;
|
|
}
|
|
|
|
var isConfirmed = pageEl.getAttribute('data-payment-confirmed') === '1';
|
|
var pollUrl = pageEl.getAttribute('data-poll-status-url');
|
|
var pendingBlock = document.getElementById('payment-pending-block');
|
|
var successBlock = document.getElementById('payment-success-block');
|
|
var successAction = document.getElementById('payment-success-action');
|
|
var pendingStatus = document.getElementById('payment-pending-status');
|
|
var pendingText = "{:lang('sqpay.notice_text')}";
|
|
var successText = "{:lang('controller.payment_success')}";
|
|
var pollTimer = null;
|
|
var maxAttempts = 30;
|
|
var attempt = 0;
|
|
|
|
function showPending() {
|
|
if (pendingBlock) {
|
|
pendingBlock.style.display = 'block';
|
|
}
|
|
if (successBlock) {
|
|
successBlock.style.display = 'none';
|
|
}
|
|
if (successAction) {
|
|
successAction.style.display = 'none';
|
|
}
|
|
}
|
|
|
|
function showSuccess() {
|
|
if (pendingBlock) {
|
|
pendingBlock.style.display = 'none';
|
|
}
|
|
if (successBlock) {
|
|
successBlock.style.display = 'block';
|
|
}
|
|
if (successAction) {
|
|
successAction.style.display = 'block';
|
|
}
|
|
}
|
|
|
|
if (isConfirmed || !pollUrl) {
|
|
showSuccess();
|
|
return;
|
|
}
|
|
|
|
showPending();
|
|
|
|
async function pollStatus() {
|
|
attempt++;
|
|
try {
|
|
var response = await fetch(pollUrl, {
|
|
method: 'GET',
|
|
headers: {
|
|
'X-Requested-With': 'XMLHttpRequest'
|
|
}
|
|
});
|
|
var data = await response.json();
|
|
if (data.status === 1) {
|
|
if (pendingStatus) {
|
|
pendingStatus.textContent = successText;
|
|
}
|
|
window.clearInterval(pollTimer);
|
|
showSuccess();
|
|
return;
|
|
}
|
|
|
|
if (data.status === -1 && data.url) {
|
|
window.clearInterval(pollTimer);
|
|
window.location.href = data.url;
|
|
return;
|
|
}
|
|
|
|
if (pendingStatus) {
|
|
pendingStatus.textContent = data.msg || pendingText;
|
|
}
|
|
} catch (e) {
|
|
if (pendingStatus) {
|
|
pendingStatus.textContent = pendingText;
|
|
}
|
|
}
|
|
|
|
if (attempt >= maxAttempts) {
|
|
window.clearInterval(pollTimer);
|
|
if (pendingStatus) {
|
|
pendingStatus.textContent = pendingText;
|
|
}
|
|
}
|
|
}
|
|
|
|
pollStatus();
|
|
pollTimer = window.setInterval(pollStatus, 2000);
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html>
|