Update site: auth fixes, new admin pages, payment flow, membership renewal, helpers

This commit is contained in:
twotalesanimation
2026-06-11 10:01:48 +02:00
parent 32e50ffc39
commit bc8d923221
56 changed files with 5155 additions and 534 deletions
+17 -5
View File
@@ -105,17 +105,29 @@ if (isset($_SESSION['user_id'])) {
response = JSON.parse(response);
}
if (response.status === 'success') {
// Check if the user has paid
// If provider returned a direct paylink, go there immediately
if (response.paylinkUrl) {
window.location.href = 'membership_payment?token=' + encodeURIComponent(response.token);
return;
}
// If we have a payment_id, redirect to membership_payment with it
// if (response.payment_id) {
// setTimeout(function() {
// window.location.href = 'membership_payment.php?payment_id=' + encodeURIComponent(response.token);
// }, 800);
// return;
// }
// Fallback behaviour: check paymentStatus
if (response.paymentStatus === 'PAID') {
// Redirect to membership_details.php if paid
setTimeout(function() {
window.location.href = 'membership_details.php';
}, 2000); // 2-second delay before redirecting
}, 1200);
} else {
// Redirect to membership_payment.php if not paid
setTimeout(function() {
window.location.href = 'membership_payment.php';
}, 2000); // 2-second delay before redirecting
}, 1200);
}
} else {
$('#responseMessage').html('<div class="alert alert-danger">' + response.message + '</div>');