172 lines
5.2 KiB
HTML
172 lines
5.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="fa" dir="rtl">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>نتیجه پرداخت</title>
|
|
<style>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
font-family: Tahoma, Arial, sans-serif;
|
|
}
|
|
|
|
body {
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
min-height: 100vh;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 20px;
|
|
}
|
|
|
|
.result-card {
|
|
background: white;
|
|
border-radius: 20px;
|
|
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
|
|
padding: 40px;
|
|
text-align: center;
|
|
max-width: 500px;
|
|
width: 100%;
|
|
}
|
|
|
|
.result-icon {
|
|
font-size: 80px;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.success .result-icon {
|
|
animation: bounce 1s;
|
|
}
|
|
|
|
@keyframes bounce {
|
|
0%, 20%, 50%, 80%, 100% {
|
|
transform: translateY(0);
|
|
}
|
|
40% {
|
|
transform: translateY(-30px);
|
|
}
|
|
60% {
|
|
transform: translateY(-15px);
|
|
}
|
|
}
|
|
|
|
.result-title {
|
|
font-size: 28px;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.success .result-title {
|
|
color: #28a745;
|
|
}
|
|
|
|
.failed .result-title {
|
|
color: #dc3545;
|
|
}
|
|
|
|
.result-message {
|
|
color: #666;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.transaction-box {
|
|
background: #f8f9fa;
|
|
border-radius: 10px;
|
|
padding: 15px;
|
|
margin-top: 20px;
|
|
}
|
|
|
|
.transaction-label {
|
|
color: #888;
|
|
font-size: 14px;
|
|
margin-bottom: 5px;
|
|
}
|
|
|
|
.transaction-id {
|
|
color: #667eea;
|
|
font-size: 20px;
|
|
font-weight: bold;
|
|
word-break: break-all;
|
|
}
|
|
|
|
.btn-home {
|
|
display: inline-block;
|
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
color: white;
|
|
padding: 14px 30px;
|
|
border-radius: 50px;
|
|
text-decoration: none;
|
|
margin-top: 25px;
|
|
font-weight: bold;
|
|
transition: transform 0.3s;
|
|
}
|
|
|
|
.btn-home:hover {
|
|
transform: scale(1.05);
|
|
color: white;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="result-card" id="resultCard">
|
|
</div>
|
|
|
|
<script>
|
|
function showResult() {
|
|
const urlParams = new URLSearchParams(window.location.search);
|
|
|
|
const state = urlParams.get('state') || '';
|
|
const status = urlParams.get('status') || '';
|
|
const transactionId = urlParams.get('transactionId') || '';
|
|
const refNum = urlParams.get('refNum') || '';
|
|
const amount = urlParams.get('amount') || '';
|
|
|
|
const resultCard = document.getElementById('resultCard');
|
|
|
|
const isSuccess = (state === 'OK' || status === 'success');
|
|
|
|
if (isSuccess) {
|
|
resultCard.className = 'result-card success';
|
|
resultCard.innerHTML = `
|
|
<div class="result-icon">✅</div>
|
|
<h2 class="result-title">پرداخت موفق</h2>
|
|
<p class="result-message">پرداخت شما با موفقیت انجام شد.</p>
|
|
<div class="transaction-box">
|
|
<div class="transaction-label">شماره تراکنش:</div>
|
|
<div class="transaction-id">${transactionId || 'نامشخص'}</div>
|
|
</div>
|
|
${refNum ? `
|
|
<div class="transaction-box" style="margin-top: 10px;">
|
|
<div class="transaction-label">شماره سفارش:</div>
|
|
<div class="transaction-id" style="font-size: 16px;">${refNum}</div>
|
|
</div>
|
|
` : ''}
|
|
${amount ? `
|
|
<div class="transaction-box" style="margin-top: 10px;">
|
|
<div class="transaction-label">مبلغ:</div>
|
|
<div class="transaction-id" style="font-size: 16px;">${parseInt(amount).toLocaleString()} ریال</div>
|
|
</div>
|
|
` : ''}
|
|
<a href="/" class="btn-home">🏠 بازگشت به صفحه اصلی</a>
|
|
`;
|
|
} else {
|
|
let message = 'پرداخت شما ناموفق بود.';
|
|
if (status === 'verify_failed') {
|
|
message = 'پرداخت موفق بود اما در تأیید تراکنش خطایی رخ داد.';
|
|
}
|
|
|
|
resultCard.className = 'result-card failed';
|
|
resultCard.innerHTML = `
|
|
<div class="result-icon">❌</div>
|
|
<h2 class="result-title">پرداخت ناموفق</h2>
|
|
<p class="result-message">${message}</p>
|
|
<a href="/" class="btn-home">🔄 تلاش مجدد</a>
|
|
`;
|
|
}
|
|
}
|
|
|
|
showResult();
|
|
</script>
|
|
</body>
|
|
</html> |