From 72ebc7b24b3f4f7bd11968d3f34ce398fdfbf6d9 Mon Sep 17 00:00:00 2001 From: Nastya Date: Sun, 17 Mar 2024 12:22:49 +0300 Subject: [PATCH] -- --- src/pages/Payment/Payment.tsx | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/src/pages/Payment/Payment.tsx b/src/pages/Payment/Payment.tsx index 2586b28..3ca0f6f 100644 --- a/src/pages/Payment/Payment.tsx +++ b/src/pages/Payment/Payment.tsx @@ -40,7 +40,7 @@ const paymentMethods: PaymentMethod[] = [ { label: "Тинькофф", name: "tinkoffBank", image: tinkoffLogo }, { label: "СБП", name: "sbp", image: spbLogo }, { label: "SberPay", name: "sberbank", image: sberpayLogo }, - { label: "B2B Сбербанк", name: "b2bSperbank", image: b2bLogo }, + { label: "B2B Сбербанк", name: "b2bSberbank", image: b2bLogo }, { label: "ЮMoney", name: "yoomoney", image: umoneyLogo }, ]; @@ -90,6 +90,7 @@ export default function Payment() { } if (Number(paymentValueField) === 0) { + enqueueSnackbar("Введите сумму") return; } @@ -98,7 +99,7 @@ export default function Payment() { fromSquiz, body: { type: selectedPaymentMethod, - amount: Number(paymentValueField), + amount: Number(paymentValueField) * 100, currency: "RUB", bankCard: { number: "RUB", @@ -148,6 +149,31 @@ export default function Payment() { } return; + } else { + if (verificationStatus !== VerificationStatus.VERIFICATED) { + setWarnModalOpen(true); + + return; + } + console.log(paymentValueField) + if (Number(paymentValueField) < 900){ + enqueueSnackbar("Минимальная сумма 900р") + + return; + } + + const sendRSPaymentError = await sendRSPayment(Number(paymentValueField)); + + if (sendRSPaymentError) { + return enqueueSnackbar(sendRSPaymentError); + } + + enqueueSnackbar( + "Cпасибо за заявку, в течении 24 часов вам будет выставлен счёт для оплаты услуг." + ); + + navigate("/settings"); + } } @@ -208,7 +234,7 @@ export default function Payment() { > {paymentMethods.map(({ name, label, image, unpopular = false }) => ( ))} {