fix: redirect return_url to homepage and show success modal on homepage
This commit is contained in:
+49
@@ -1521,6 +1521,55 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<!-- Success Modal -->
|
||||||
|
<div id="successModal" class="fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-md hidden opacity-0 transition-opacity duration-300">
|
||||||
|
<div id="successModalContent" class="w-full max-w-md p-8 bg-slate-900 border border-purple-500/30 rounded-2xl shadow-2xl relative text-center space-y-6 mx-4 transform scale-95 transition-transform duration-300">
|
||||||
|
<div class="w-16 h-16 bg-emerald-500/10 border border-emerald-500/30 text-emerald-400 rounded-full flex items-center justify-center text-3xl font-bold mx-auto shadow-[0_0_15px_rgba(16,185,129,0.2)]">
|
||||||
|
✓
|
||||||
|
</div>
|
||||||
|
<h2 class="font-display font-black text-2xl text-white uppercase tracking-wider">Заявка успешно оплачена!</h2>
|
||||||
|
<p class="text-sm text-slate-300 leading-relaxed">
|
||||||
|
Спасибо за оплату!<br>
|
||||||
|
Наш киберспортивный координатор свяжется с вами в ближайшее время, чтобы открыть доступ к материалам и записать на занятие.
|
||||||
|
</p>
|
||||||
|
<button onclick="closeSuccessModal()" class="w-full py-3 bg-purple-600 hover:bg-purple-500 text-white font-display font-black text-xs uppercase tracking-wider rounded-xl shadow-lg shadow-purple-600/20 hover:shadow-purple-600/40 transform hover:-translate-y-0.5 transition duration-200">
|
||||||
|
Закрыть
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
|
if (urlParams.get('success') === 'true') {
|
||||||
|
const modal = document.getElementById('successModal');
|
||||||
|
const content = document.getElementById('successModalContent');
|
||||||
|
|
||||||
|
modal.classList.remove('hidden');
|
||||||
|
setTimeout(() => {
|
||||||
|
modal.classList.add('opacity-100');
|
||||||
|
content.classList.remove('scale-95');
|
||||||
|
content.classList.add('scale-100');
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function closeSuccessModal() {
|
||||||
|
const modal = document.getElementById('successModal');
|
||||||
|
const content = document.getElementById('successModalContent');
|
||||||
|
|
||||||
|
modal.classList.remove('opacity-100');
|
||||||
|
content.classList.remove('scale-100');
|
||||||
|
content.classList.add('scale-95');
|
||||||
|
setTimeout(() => {
|
||||||
|
modal.classList.add('hidden');
|
||||||
|
// Remove success parameter from URL so it doesn't show again on refresh
|
||||||
|
const newUrl = window.location.protocol + "//" + window.location.host + window.location.pathname;
|
||||||
|
window.history.replaceState({ path: newUrl }, '', newUrl);
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -563,7 +563,7 @@ def submit():
|
|||||||
amount = service_info["price_numeric"]
|
amount = service_info["price_numeric"]
|
||||||
|
|
||||||
# 1. YooKassa checkout generation
|
# 1. YooKassa checkout generation
|
||||||
return_url = f"{request.host_url}form/index.html?success=true®_id={reg_id}&service_id={service_id}"
|
return_url = f"{request.host_url}?success=true®_id={reg_id}&service_id={service_id}"
|
||||||
payment_info = create_yookassa_payment(
|
payment_info = create_yookassa_payment(
|
||||||
reg_id=reg_id,
|
reg_id=reg_id,
|
||||||
amount=amount,
|
amount=amount,
|
||||||
|
|||||||
Reference in New Issue
Block a user