This commit is contained in:
you 2024-09-05 19:58:13 +03:00
parent 9258c40f25
commit b85cb79f71

View File

@ -22,6 +22,8 @@
let showNormal = false; let showNormal = false;
let showTimeout = false; let showTimeout = false;
let currency = "";
const delay = (ms) => new Promise((res) => setTimeout(res, ms)); const delay = (ms) => new Promise((res) => setTimeout(res, ms));
//http://localhost:8080/?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJleHAiOjE3MjQzNjEzOTgsImlhdCI6MTcyMTk0MjE5OCwiaW5fY3VycmVuY3lfY29kZSI6IktHUyIsImlzcyI6Ikhvc3RhcGF5Iiwib3JkZXJfaWQiOiIxZjhjOTI2NC1lZWQ3LTRhYzMtYTEyZC0xYzEzMjg4MWM4NzQiLCJvdXRfY3VycmVuY3lfY29kZSI6IktHUyJ9.w_ki56Hb81kX2SoS9qm0Je3atBhmUWTQaYYrLX-udCM //http://localhost:8080/?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXUyJ9.eyJleHAiOjE3MjQzNjEzOTgsImlhdCI6MTcyMTk0MjE5OCwiaW5fY3VycmVuY3lfY29kZSI6IktHUyIsImlzcyI6Ikhvc3RhcGF5Iiwib3JkZXJfaWQiOiIxZjhjOTI2NC1lZWQ3LTRhYzMtYTEyZC0xYzEzMjg4MWM4NzQiLCJvdXRfY3VycmVuY3lfY29kZSI6IktHUyJ9.w_ki56Hb81kX2SoS9qm0Je3atBhmUWTQaYYrLX-udCM
/** /**
@ -88,6 +90,7 @@
try { try {
let t = jwtDecode(token); let t = jwtDecode(token);
orderID = t["order_id"]; orderID = t["order_id"];
currency = t["out_currency_code"];
// //console.log(t); // //console.log(t);
validJWT = true; validJWT = true;
} catch (error) { } catch (error) {
@ -113,8 +116,7 @@
const formattedSeconds = String(seconds).padStart(2, "0"); const formattedSeconds = String(seconds).padStart(2, "0");
timeLeft = `${formattedMinutes}:${formattedSeconds}`; timeLeft = `${formattedMinutes}:${formattedSeconds}`;
if(timeLeft === "00:00" || timeLeft.includes("-")) if (timeLeft === "00:00" || timeLeft.includes("-")) {
{
orderStatus = 6; orderStatus = 6;
showTimeout = true; showTimeout = true;
clearInterval(timeLeftInterval); clearInterval(timeLeftInterval);
@ -233,6 +235,8 @@
let showLoadingScreen = false; let showLoadingScreen = false;
let disableGetReqBtn = false; let disableGetReqBtn = false;
let orderAmount = "";
let paymentMethods = []; let paymentMethods = [];
async function getPaymentMethods() { async function getPaymentMethods() {
try { try {
@ -270,6 +274,7 @@
); );
requestingReqs = false; requestingReqs = false;
requisites = result.data["requisite"]; requisites = result.data["requisite"];
orderAmount = result.data["amount"];
// console.log(result); // console.log(result);
showReqs = true; showReqs = true;
calculateDate(result.data["requisite_creation_time"]); calculateDate(result.data["requisite_creation_time"]);
@ -311,6 +316,7 @@
selectedBank = result.data["bank_id"] + ""; selectedBank = result.data["bank_id"] + "";
requisites = result.data["requisite"]; requisites = result.data["requisite"];
orderAmount = result.data["amount"];
calculateDate(result.data["requisite_creation_time"]); calculateDate(result.data["requisite_creation_time"]);
disableGetReqBtn = true; disableGetReqBtn = true;
@ -544,6 +550,16 @@
{#if !showHelpSection} {#if !showHelpSection}
<div class="w-full flex p-8 rounded-3xl bg-indigo-950"> <div class="w-full flex p-8 rounded-3xl bg-indigo-950">
<div class="flex flex-col gap-2 w-full"> <div class="flex flex-col gap-2 w-full">
<p
class="font-bold text-green-500 text-2xl p-2 bg-black rounded-md"
>
Переведите точную сумму одним платежом: {orderAmount}{currency}
</p>
<p
class="font-bold text-red-500 text-2xl p-2 bg-black rounded-md"
>
Неверная сумма перевода возврату не подлежит!
</p>
<p class="text-lg">Реквизиты</p> <p class="text-lg">Реквизиты</p>
<div <div
class="flex mt-2 w-full gap-4 items-center justify-center p-2 bg-indigo-900 rounded-xl" class="flex mt-2 w-full gap-4 items-center justify-center p-2 bg-indigo-900 rounded-xl"
@ -772,6 +788,13 @@
<p class="text-white opacity-50 text-sm"> <p class="text-white opacity-50 text-sm">
Почта: support@24paymentgateway.ru Почта: support@24paymentgateway.ru
</p> </p>
<button
on:click={() => {
showLoadingScreen = false;
}}
class={"underline text-white mt-4"}
>Отменить ожидание и вернуться на страницу оплаты</button
>
</div> </div>
{/if} {/if}
{/if} {/if}