ifnex/04_Laravel/resources/views/payment-result.blade.php
Kazem Alghasi 2e7f975094 feat(wallet): complete online payment with Zarinpal + mock gateway
- Add ZarinpalService for production payment gateway
- Add MockZarinpalService for testing without real merchant ID
- Add MockGatewayController for simulating payment page
- Add beautiful mock gateway UI with RTL support
- Update PaymentController to switch between mock/real based on config
- Fix double-click bug: prevent re-processing completed transactions
- Add payment-result page with success/failure UI
- All API endpoints tested successfully:
  * balance, transactions, activity-log
  * admin-adjust (deposit/withdrawal)
  * freeze/unfreeze
  * online payment redirect + callback + verify
- Wallet balance verified: 67,700,000 IRR after all transactions
- 5 transactions recorded with correct gateways (manual/zarinpal)

Closes: Payment gateway integration for Phase 2
2026-08-08 00:46:54 +03:30

159 lines
5.2 KiB
PHP

<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ $isSuccess ? 'پرداخت موفق' : 'پرداخت ناموفق' }} - IFNEX</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: Tahoma, Arial, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
padding: 20px;
}
.result-card {
background: white;
border-radius: 16px;
padding: 40px;
box-shadow: 0 20px 60px rgba(0,0,0,0.3);
max-width: 500px;
width: 100%;
text-align: center;
}
.icon {
font-size: 64px;
margin-bottom: 20px;
}
.success-icon { color: #10b981; }
.failure-icon { color: #ef4444; }
h1 {
color: #333;
font-size: 24px;
margin-bottom: 10px;
}
.message {
color: #666;
font-size: 14px;
margin-bottom: 30px;
}
.details {
background: #f5f5f5;
border-radius: 12px;
padding: 20px;
margin: 20px 0;
text-align: right;
}
.detail-row {
display: flex;
justify-content: space-between;
padding: 8px 0;
border-bottom: 1px solid #e5e5e5;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: #666; font-size: 14px; }
.detail-value { color: #333; font-weight: bold; font-size: 14px; }
.amount {
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
padding: 20px;
border-radius: 12px;
margin: 20px 0;
}
.amount .value {
font-size: 32px;
font-weight: bold;
}
.amount .unit {
font-size: 16px;
opacity: 0.9;
}
.btn {
background: #667eea;
color: white;
padding: 14px 32px;
border: none;
border-radius: 8px;
font-size: 16px;
font-weight: bold;
cursor: pointer;
text-decoration: none;
display: inline-block;
margin-top: 20px;
transition: all 0.3s;
}
.btn:hover {
background: #5568d3;
transform: translateY(-2px);
}
.warning {
background: #fef3c7;
border: 1px solid #f59e0b;
border-radius: 8px;
padding: 12px;
font-size: 13px;
color: #92400e;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="result-card">
@if($isSuccess)
<div class="icon success-icon"></div>
<h1>پرداخت موفق</h1>
<p class="message">پرداخت شما با موفقیت انجام شد و کیف پول شارژ گردید.</p>
@if($amount)
<div class="amount">
<div class="value">{{ number_format((float)$amount) }}</div>
<div class="unit">ریال</div>
</div>
@endif
<div class="details">
<div class="detail-row">
<span class="detail-label">شناسه تراکنش:</span>
<span class="detail-value">#{{ $transactionId }}</span>
</div>
@if($refId)
<div class="detail-row">
<span class="detail-label">کد پیگیری:</span>
<span class="detail-value">{{ $refId }}</span>
</div>
@endif
@if($message)
<div class="detail-row">
<span class="detail-label">پیام:</span>
<span class="detail-value">{{ $message }}</span>
</div>
@endif
</div>
@else
<div class="icon failure-icon"></div>
<h1>پرداخت ناموفق</h1>
<p class="message">{{ $message ?? 'پرداخت شما انجام نشد. لطفاً دوباره تلاش کنید.' }}</p>
@if($transactionId)
<div class="details">
<div class="detail-row">
<span class="detail-label">شناسه تراکنش:</span>
<span class="detail-value">#{{ $transactionId }}</span>
</div>
</div>
@endif
@endif
<a href="http://localhost:8000/admin" class="btn">
بازگشت به پنل مدیریت
</a>
<div class="warning">
⚠️ این یک صفحه تست است. در محیط Production، این صفحه باید با طراحی برند IFNEX تطبیق داده شود.
</div>
</div>
</body>
</html>