|
|
@@ -34,7 +34,7 @@
|
|
|
<div class="relative z-10">
|
|
|
<p class="text-white/80 font-bold text-[14px] uppercase tracking-wider">@Lang.v2_account_name</p>
|
|
|
<div class="flex items-end gap-2 mt-2">
|
|
|
- <span class="text-white font-[900] text-[36px] leading-[0.9]">@String.Format("{0:N0}", double.TryParse(Model?.userStatus?.cash_coin, out var cc) ? cc : 0)</span>
|
|
|
+ <span id="currentBetCoin" class="text-white font-[900] text-[36px] leading-[0.9]">@String.Format("{0:N0}", double.TryParse(Model?.userStatus?.bet_coin, out var cc) ? cc : 0)</span>
|
|
|
<span class="text-[#FBF3A7] font-[900] text-[16px] uppercase pb-1">htg</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -43,7 +43,7 @@
|
|
|
<div class="w-10 h-10 bg-white/20 backdrop-blur-md rounded-full flex items-center justify-center border border-white/30">
|
|
|
<img src="/LotteryV2/img/transfer_wallet_icon.png" alt="Wallet" class="w-5 h-5 object-contain" />
|
|
|
</div>
|
|
|
- <span class="text-white/90 font-bold text-[14px]">Available Balance</span>
|
|
|
+ <!-- <span class="text-white/90 font-bold text-[14px]">Available Balance</span> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -130,8 +130,64 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <!-- Failure Modal Overlay (Standardized Height as per user request) -->
|
|
|
- <div id="failureModal" class="fixed inset-0 z-[110] flex items-center justify-center hidden px-6 translate-y-0" style="background: rgba(0,0,0,0.5);">
|
|
|
+ <!-- Success Modal Overlay -->
|
|
|
+ <div id="successModal" class="fixed inset-0 z-[110] flex items-center justify-center hidden px-6" style="background: rgba(0,0,0,0.7);">
|
|
|
+ <div class="w-full max-w-[370px] bg-white rounded-[32px] overflow-hidden flex flex-col items-center animate__animated animate__zoomIn animate__faster shadow-2xl relative">
|
|
|
+
|
|
|
+ <!-- Confetti Background (Uses existing if available, else decorative fallback) -->
|
|
|
+ <img src="/LotteryV2/img/modal/otp_glitter.png" class="absolute top-0 left-0 w-full opacity-40 pointer-events-none" />
|
|
|
+
|
|
|
+ <!-- Content Container -->
|
|
|
+ <div class="relative z-10 w-full flex flex-col items-center pt-10 pb-8 px-6">
|
|
|
+
|
|
|
+ <!-- Success Icon Group -->
|
|
|
+ <div class="relative w-[120px] h-[120px] mb-4">
|
|
|
+ <div class="absolute inset-0 bg-[#F5F5F5] rounded-full scale-110"></div>
|
|
|
+ <img src="/LotteryV2/img/modal/otp_success.png" class="relative z-20 w-full h-full object-contain drop-shadow-[0_0_8px_rgba(240,201,63,0.8)]" />
|
|
|
+ <!-- Sparkles (Using existing SVG icons if possible) -->
|
|
|
+ <img src="/LotteryV2/img/modal/otp_sparkle_1.svg" class="absolute -bottom-2 -left-2 w-8 z-30 drop-shadow-[0_0_4px_rgba(240,201,63,1)]" />
|
|
|
+ <img src="/LotteryV2/img/modal/otp_sparkle_2.svg" class="absolute top-10 -right-6 w-10 z-30 drop-shadow-[0_0_4px_rgba(240,201,63,1)] opacity-70" />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <h2 class="text-[#0A9800] font-[800] text-[32px] mb-1 tracking-tight">@Lang.success</h2>
|
|
|
+ <p class="text-[#000000] font-[700] text-[20px] text-center px-4 mb-6 leading-tight">
|
|
|
+ @Lang.v2_payment_successfully
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <div class="w-full border-t border-dashed border-gray-200 pt-5 flex flex-col gap-3 mb-5">
|
|
|
+ <!-- Info Rows -->
|
|
|
+ <div class="flex justify-between items-center text-[15px]">
|
|
|
+ <span class="text-[#534A4A] font-bold">@Lang.amount_transfered</span>
|
|
|
+ <span id="successAmount" class="text-black font-black text-right">5.000 HTG</span>
|
|
|
+ </div>
|
|
|
+ <div class="flex justify-between items-center text-[15px]">
|
|
|
+ <span class="text-[#534A4A] font-bold">@Lang.sender</span>
|
|
|
+ <span id="successSender" class="text-black font-black text-right">50940236545</span>
|
|
|
+ </div>
|
|
|
+ <div class="flex justify-between items-center text-[15px]">
|
|
|
+ <span class="text-[#534A4A] font-bold">@Lang.receiver</span>
|
|
|
+ <span id="successReceiver" class="text-black font-black text-right">50940236545</span>
|
|
|
+ </div>
|
|
|
+ <div class="flex justify-between items-center text-[15px]">
|
|
|
+ <span class="text-[#534A4A] font-bold">@Lang.fee</span>
|
|
|
+ <span class="text-black font-black text-right">0 HTG</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="w-full border-t border-dashed border-gray-200 pt-4 flex justify-between items-center mb-8">
|
|
|
+ <span class="text-[#534A4A] font-bold text-[15px]">@Lang.time</span>
|
|
|
+ <span id="successTime" class="text-[#534A4A] font-medium text-[14px] text-right">08/01/2022 - 10:00:20</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <button onclick="window.location.href='/LotteryV2/Home/GameHome'" class="w-full bg-[#EE0033] text-white font-[800] text-[20px] py-[14px] rounded-[14px] shadow-lg active:scale-95 transition-all">
|
|
|
+ @Lang.back_to_homepage
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- Failure Modal Overlay -->
|
|
|
+ <div id="failureModal" class="fixed inset-0 z-[110] flex items-center justify-center hidden px-6" style="background: rgba(0,0,0,0.5);">
|
|
|
<div class="w-full max-w-[343px] min-h-[420px] bg-white rounded-[20px] overflow-hidden flex flex-col items-center p-8 animate__animated animate__zoomIn animate__faster shadow-2xl">
|
|
|
<div class="w-full flex flex-col items-center mb-6 mt-4">
|
|
|
<div class="relative w-full flex items-center justify-center">
|
|
|
@@ -153,27 +209,69 @@
|
|
|
|
|
|
|
|
|
<!-- OTP Modal Overlay -->
|
|
|
- <div id="otpModal" class="fixed inset-0 z-[120] flex items-center justify-center hidden px-6 translate-y-0" style="background: rgba(0,0,0,0.5);">
|
|
|
- <div class="w-full max-w-[343px] min-h-[420px] bg-white rounded-[20px] overflow-hidden flex flex-col items-center p-6 animate__animated animate__zoomIn animate__faster shadow-2xl relative">
|
|
|
- <!-- Decorative Header Circle -->
|
|
|
- <div class="absolute -top-12 left-1/2 -translate-x-1/2 w-[400px] h-[80px] bg-[#EE0033] rounded-full opacity-10"></div>
|
|
|
-
|
|
|
- <h3 class="text-[#534A4A] font-black text-[22px] mt-4 mb-2">@Lang.v2_confirm_transaction</h3>
|
|
|
- <p class="text-gray-500 font-bold text-[14px] text-center px-4 mb-6">@Lang.v2_enter_otp_proceed</p>
|
|
|
+ <div id="otpModal" class="fixed inset-0 z-[120] flex items-center justify-center hidden px-6" style="background: rgba(0,0,0,0.7);">
|
|
|
+ <!-- Glitter/Sparkles Overlay -->
|
|
|
+ <img src="/LotteryV2/img/modal/otp_glitter.png" class="absolute pointer-events-none opacity-60 w-full max-w-[500px]" />
|
|
|
+
|
|
|
+ <div class="w-full max-w-[360px] bg-white rounded-[32px] overflow-visible flex flex-col items-center animate__animated animate__zoomIn animate__faster relative border-4 border-[#FFCD1D]/10" style="box-shadow: 0 0 25px rgba(229, 107, 35, 0.6);">
|
|
|
|
|
|
- <!-- OTP Inputs -->
|
|
|
- <div class="flex gap-3 mb-4" id="otpInputs">
|
|
|
- <input type="tel" maxlength="1" pattern="[0-9]" inputmode="numeric" oninput="handleOtpInput(this)" onkeydown="handleOtpKeydown(event, this)" class="otp-digit w-12 h-14 bg-gray-100 border-2 border-transparent focus:border-[#EE0033] rounded-xl text-center text-[24px] font-black outline-none transition-all" />
|
|
|
- <input type="tel" maxlength="1" pattern="[0-9]" inputmode="numeric" oninput="handleOtpInput(this)" onkeydown="handleOtpKeydown(event, this)" class="otp-digit w-12 h-14 bg-gray-100 border-2 border-transparent focus:border-[#EE0033] rounded-xl text-center text-[24px] font-black outline-none transition-all" />
|
|
|
- <input type="tel" maxlength="1" pattern="[0-9]" inputmode="numeric" oninput="handleOtpInput(this)" onkeydown="handleOtpKeydown(event, this)" class="otp-digit w-12 h-14 bg-gray-100 border-2 border-transparent focus:border-[#EE0033] rounded-xl text-center text-[24px] font-black outline-none transition-all" />
|
|
|
- <input type="tel" maxlength="1" pattern="[0-9]" inputmode="numeric" oninput="handleOtpInput(this)" onkeydown="handleOtpKeydown(event, this)" class="otp-digit w-12 h-14 bg-gray-100 border-2 border-transparent focus:border-[#EE0033] rounded-xl text-center text-[24px] font-black outline-none transition-all" />
|
|
|
+ <!-- Gold Coins on Top -->
|
|
|
+ <img src="/LotteryV2/img/modal/otp_coins.png" class="absolute -top-12 -right-2 w-32 z-30 pointer-events-none drop-shadow-lg" />
|
|
|
+
|
|
|
+ <!-- Red Header -->
|
|
|
+ <div class="w-full bg-[#EE0033] pt-5 pb-4 px-6 rounded-t-[32px] flex justify-center border-b-4 border-white/20">
|
|
|
+ <h3 class="text-white font-[900] text-[22px] tracking-tight text-center">@Lang.v2_confirm_transaction</h3>
|
|
|
</div>
|
|
|
-
|
|
|
- <span id="otpTimer" class="text-[#EE0033] font-black text-[16px] mb-8">60s</span>
|
|
|
-
|
|
|
- <div class="w-full flex gap-3 mt-auto">
|
|
|
- <button onclick="closeOtpModal()" class="flex-1 bg-gray-200 text-[#534A4A] font-black py-3 rounded-xl active:scale-95 transition-all text-[18px]">@Lang.cancel</button>s
|
|
|
- <button id="btnConfirmTransfer" class="flex-1 bg-[#0A9800] text-white font-black py-3 rounded-xl active:scale-95 transition-all text-[18px]">@Lang.confirm</button>
|
|
|
+
|
|
|
+ <div class="relative z-10 w-full flex flex-col items-center p-6 py-6 pb-8">
|
|
|
+
|
|
|
+ <!-- Shield Icon -->
|
|
|
+ <div class="flex flex-col items-center gap-1 mb-2">
|
|
|
+ <img src="/LotteryV2/img/modal/otp_shield.png" class="w-[90px] h-auto object-contain drop-shadow-md" />
|
|
|
+ <span class="text-[#534A4A] font-bold text-[14px]">@Lang.v2_convert</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- Conversion Display Area -->
|
|
|
+ <div class="flex items-center justify-center gap-2 mb-4">
|
|
|
+ <span id="displayAmountCoins" class="text-[#EE0033] font-[900] text-[24px]">100</span>
|
|
|
+ <span class="text-black font-[900] text-[24px]">@Lang.v2_coins</span>
|
|
|
+ <i class="fa-solid fa-arrow-right text-gray-800 text-[20px] mx-1"></i>
|
|
|
+ <span id="displayAmountHTG" class="text-[#EE0033] font-[900] text-[24px]">100</span>
|
|
|
+ <span class="text-black font-[900] text-[24px]">@Lang.v2_htg</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <p class="text-[#534A4A] font-bold text-[14px] text-center px-4 mb-6 leading-tight">@Lang.v2_enter_otp_proceed</p>
|
|
|
+
|
|
|
+ <!-- OTP Inputs Area -->
|
|
|
+ <div class="flex gap-2 mb-4" id="otpInputs">
|
|
|
+ <input type="tel" maxlength="1" pattern="[0-9]" inputmode="numeric" oninput="handleOtpInput(this)" onkeydown="handleOtpKeydown(event, this)" placeholder="-"
|
|
|
+ class="otp-digit w-[42px] h-[48px] bg-[#757575] text-white rounded-[10px] text-center text-[26px] font-[900] outline-none transition-all placeholder:text-white/60 shadow-inner" />
|
|
|
+ <input type="tel" maxlength="1" pattern="[0-9]" inputmode="numeric" oninput="handleOtpInput(this)" onkeydown="handleOtpKeydown(event, this)" placeholder="-"
|
|
|
+ class="otp-digit w-[42px] h-[48px] bg-[#757575] text-white rounded-[10px] text-center text-[26px] font-[900] outline-none transition-all placeholder:text-white/60 shadow-inner" />
|
|
|
+ <input type="tel" maxlength="1" pattern="[0-9]" inputmode="numeric" oninput="handleOtpInput(this)" onkeydown="handleOtpKeydown(event, this)" placeholder="-"
|
|
|
+ class="otp-digit w-[42px] h-[48px] bg-[#757575] text-white rounded-[10px] text-center text-[26px] font-[900] outline-none transition-all placeholder:text-white/60 shadow-inner" />
|
|
|
+ <input type="tel" maxlength="1" pattern="[0-9]" inputmode="numeric" oninput="handleOtpInput(this)" onkeydown="handleOtpKeydown(event, this)" placeholder="-"
|
|
|
+ class="otp-digit w-[42px] h-[48px] bg-[#757575] text-white rounded-[10px] text-center text-[26px] font-[900] outline-none transition-all placeholder:text-white/60 shadow-inner" />
|
|
|
+ <input type="tel" maxlength="1" pattern="[0-9]" inputmode="numeric" oninput="handleOtpInput(this)" onkeydown="handleOtpKeydown(event, this)" placeholder="-"
|
|
|
+ class="otp-digit w-[42px] h-[48px] bg-[#757575] text-white rounded-[10px] text-center text-[26px] font-[900] outline-none transition-all placeholder:text-white/60 shadow-inner" />
|
|
|
+ <input type="tel" maxlength="1" pattern="[0-9]" inputmode="numeric" oninput="handleOtpInput(this)" onkeydown="handleOtpKeydown(event, this)" placeholder="-"
|
|
|
+ class="otp-digit w-[42px] h-[48px] bg-[#757575] text-white rounded-[10px] text-center text-[26px] font-[900] outline-none transition-all placeholder:text-white/60 shadow-inner" />
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- OTP Error Message -->
|
|
|
+ <p id="otpError" class="text-[#EE0033] font-bold text-[14px] text-center mb-4 hidden animate__animated animate__shakeX"></p>
|
|
|
+
|
|
|
+ <!-- Timer & Resend Display -->
|
|
|
+ <div class="flex flex-col items-center justify-center mb-6 gap-2">
|
|
|
+ <span id="otpTimer" class="text-[#EE0033] font-[900] text-[18px]">60s</span>
|
|
|
+ <button id="resendOtpBtn" onclick="sendOtpRequest()" class="hidden text-[15px] font-black text-[#0A9800] underline decoration-solid underline-offset-[4px] hover:text-[#087a00] transition-all font-bricolage">@Lang.v2_request_new_otp</button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- Action Buttons -->
|
|
|
+ <div class="w-full flex gap-4">
|
|
|
+ <button onclick="closeOtpModal()" class="flex-1 bg-[#FF0000] text-white font-[900] py-2.5 rounded-[16px] active:scale-95 transition-all text-[13px] shadow-lg">@Lang.cancel</button>
|
|
|
+ <button id="btnConfirmTransfer" class="flex-1 bg-[#0A9800] text-white font-[900] py-2.5 rounded-[16px] active:scale-95 transition-all text-[13px] shadow-lg">@Lang.confirm</button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -232,7 +330,7 @@
|
|
|
success: function(res) {
|
|
|
$btn.prop('disabled', false).html(originalText);
|
|
|
isProcessing = false;
|
|
|
- if(res.status == "0" || res.status == 0) {
|
|
|
+ if(res.responseCode == "0" || res.responseCode == 0) {
|
|
|
openOtpModal();
|
|
|
} else {
|
|
|
showFailureModal(res.message || "Failed to send OTP");
|
|
|
@@ -249,8 +347,15 @@
|
|
|
function openOtpModal() {
|
|
|
// Clear previous OTP values
|
|
|
$(".otp-digit").val("");
|
|
|
+
|
|
|
+ // Set display amounts
|
|
|
+ const amt = $("#transferAmount").val();
|
|
|
+ const formattedAmt = String(amt).replace(/\B(?=(\d{3})+(?!\d))/g, ".");
|
|
|
+ $("#displayAmountCoins").text(formattedAmt);
|
|
|
+ $("#displayAmountHTG").text(formattedAmt);
|
|
|
+
|
|
|
$("#otpModal").removeClass("hidden").addClass("flex");
|
|
|
- $("#btnConfirmTransfer").prop('disabled', false).html('Confirm');
|
|
|
+ $("#btnConfirmTransfer").prop('disabled', false).html('@Lang.confirm').removeClass('opacity-50');
|
|
|
resetTimer();
|
|
|
$(".otp-digit").first().focus();
|
|
|
}
|
|
|
@@ -264,43 +369,83 @@
|
|
|
function handleOtpInput(el) {
|
|
|
// Allow only single digit
|
|
|
el.value = el.value.replace(/[^0-9]/g, '').slice(0, 1);
|
|
|
+
|
|
|
if (el.value.length === 1) {
|
|
|
- $(el).next('.otp-digit').focus();
|
|
|
+ const next = $(el).next('.otp-digit');
|
|
|
+ if (next.length) {
|
|
|
+ next.focus();
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ // Clear error when typing
|
|
|
+ $("#otpError").addClass("hidden").text("");
|
|
|
}
|
|
|
|
|
|
// OTP backspace: move to previous input
|
|
|
function handleOtpKeydown(e, el) {
|
|
|
- if (e.key === 'Backspace' && el.value.length === 0) {
|
|
|
- $(el).prev('.otp-digit').focus();
|
|
|
+ if (e.key === 'Backspace') {
|
|
|
+ if (el.value.length === 0) {
|
|
|
+ const prev = $(el).prev('.otp-digit');
|
|
|
+ if (prev.length) {
|
|
|
+ prev.focus();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function resetTimer() {
|
|
|
let seconds = 60;
|
|
|
clearInterval(timerInterval);
|
|
|
- $("#otpTimer").text("60s");
|
|
|
- $("#btnConfirmTransfer").prop('disabled', false);
|
|
|
+ $("#otpTimer").removeClass("hidden").text("60s");
|
|
|
+ $("#resendOtpBtn").addClass("hidden");
|
|
|
+ $("#btnConfirmTransfer").prop('disabled', false).removeClass('opacity-50');
|
|
|
+
|
|
|
timerInterval = setInterval(() => {
|
|
|
seconds--;
|
|
|
$("#otpTimer").text(seconds + "s");
|
|
|
if (seconds <= 0) {
|
|
|
clearInterval(timerInterval);
|
|
|
- $("#otpTimer").text("Expired");
|
|
|
+ $("#otpTimer").addClass("hidden");
|
|
|
+ $("#resendOtpBtn").removeClass("hidden");
|
|
|
// Disable confirm when timer expired
|
|
|
$("#btnConfirmTransfer").prop('disabled', true).addClass('opacity-50');
|
|
|
}
|
|
|
}, 1000);
|
|
|
}
|
|
|
|
|
|
+ function sendOtpRequest() {
|
|
|
+ const $btn = $("#resendOtpBtn");
|
|
|
+ const originalText = $btn.text();
|
|
|
+ $btn.prop('disabled', true).text("...");
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ url: subDomain + "/LotteryV2/Home/SendOTP",
|
|
|
+ type: 'POST',
|
|
|
+ success: function(data) {
|
|
|
+ $btn.prop('disabled', false).text(originalText);
|
|
|
+ if (data.responseCode === "0") {
|
|
|
+ resetTimer();
|
|
|
+ $("#otpError").addClass("hidden").text("");
|
|
|
+ $(".otp-digit").val("").first().focus();
|
|
|
+ } else {
|
|
|
+ $("#otpError").text(data.responseMessage || "Failed to resend OTP").removeClass("hidden");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function() {
|
|
|
+ $btn.prop('disabled', false).text(originalText);
|
|
|
+ $("#otpError").text("Network error occurred.").removeClass("hidden");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
$("#btnConfirmTransfer").on("click", function() {
|
|
|
if (isProcessing) return; // Prevent double-click
|
|
|
|
|
|
let otp = "";
|
|
|
$(".otp-digit").each(function() { otp += $(this).val(); });
|
|
|
|
|
|
- if(otp.length < 4) {
|
|
|
- showFailureModal("Please enter 4-digit OTP");
|
|
|
+ if(otp.length < 6) {
|
|
|
+ showFailureModal("Please enter 6-digit OTP");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -310,7 +455,7 @@
|
|
|
const originalText = $btn.html();
|
|
|
$btn.prop('disabled', true).html('<i class="fa-solid fa-spinner fa-spin mr-2"></i> ...');
|
|
|
|
|
|
- // Call transfer confirm API
|
|
|
+ // Call the unified backend action that verifies OTP and then transfers
|
|
|
$.ajax({
|
|
|
url: subDomain + "/LotteryV2/Home/ConfirmTransfer",
|
|
|
type: "POST",
|
|
|
@@ -322,12 +467,35 @@
|
|
|
success: function(res) {
|
|
|
$btn.prop('disabled', false).html(originalText);
|
|
|
isProcessing = false;
|
|
|
- if(res.status == "0" || res.status == 0) {
|
|
|
+
|
|
|
+ if(res.responseCode == "0" || res.responseCode == 0) {
|
|
|
closeOtpModal();
|
|
|
- // Redirect to success or show success modal
|
|
|
- window.location.href = subDomain + "/LotteryV2/Home/GameHome";
|
|
|
+
|
|
|
+ // Update balance in UI immediately
|
|
|
+ if(res.userStatus && res.userStatus.bet_coin) {
|
|
|
+ let balanceVal = parseFloat(res.userStatus.bet_coin);
|
|
|
+ $("#currentBetCoin").text(balanceVal.toLocaleString());
|
|
|
+ }
|
|
|
+
|
|
|
+ // Populate Success Modal Fields
|
|
|
+ const transferAmt = $("#transferAmount").val();
|
|
|
+ $("#successAmount").text(parseFloat(transferAmt).toLocaleString() + " HTG");
|
|
|
+ $("#successSender").text("@(Model?.userStatus?.msisdn ?? "0")");
|
|
|
+ $("#successReceiver").text($("#receiverPhone").val());
|
|
|
+
|
|
|
+ const now = new Date();
|
|
|
+ const pad = (n) => n.toString().padStart(2, '0');
|
|
|
+ const formattedTime = `${pad(now.getDate())}/${pad(now.getMonth() + 1)}/${now.getFullYear()} - ${pad(now.getHours())}:${pad(now.getMinutes())}:${pad(now.getSeconds())}`;
|
|
|
+ $("#successTime").text(formattedTime);
|
|
|
+
|
|
|
+ $("#successModal").removeClass("hidden").addClass("flex");
|
|
|
} else {
|
|
|
- showFailureModal(res.message || "Transfer failed");
|
|
|
+ // showFailureModal(res.message || "Transfer failed");
|
|
|
+ // As requested: show error on OTP modal instead of failing whole transaction modal
|
|
|
+ $("#otpError").text(res.message || "Invalid OTP").removeClass("hidden");
|
|
|
+ // Clear inputs
|
|
|
+ $(".otp-digit").val("");
|
|
|
+ $(".otp-digit").first().focus();
|
|
|
}
|
|
|
},
|
|
|
error: function() {
|