From f543a2d8938e272f95a1809e91444152d9fef3bc Mon Sep 17 00:00:00 2001 From: Ebube Date: Mon, 31 Jul 2023 13:02:31 +0100 Subject: [PATCH] testing topupResult --- .../MyWallet/Popup/ConfirmAddFund.jsx | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/components/MyWallet/Popup/ConfirmAddFund.jsx b/src/components/MyWallet/Popup/ConfirmAddFund.jsx index dd136ea..74737dc 100644 --- a/src/components/MyWallet/Popup/ConfirmAddFund.jsx +++ b/src/components/MyWallet/Popup/ConfirmAddFund.jsx @@ -128,20 +128,21 @@ function ConfirmAddFund({ logo: "https://www.wrenchboard.com/assets/images/wrench-500-500-icon.png", }, }; -//debugger; + //debugger; const fwConfig = { ...config, text: "Proceed", callback: (response) => { onSuccessPayment(); - closePaymentModal(); + setTimeout(() => { + closePaymentModal(); + }, 2000); }, - onClose: () => {}, }; const onSuccessPayment = () => { setRequestStatus({ message: "", loading: true, status: false }); - const reqData = { amount: Number(__confirmData?.amount), currency: "NGN" }; + const reqData = { tx_ref: __confirmData?.credit_reference }; console.log("**** onSuccessPayment **** THIS WAS REACHED"); apiURL .resultTopUp(reqData) @@ -159,8 +160,15 @@ function ConfirmAddFund({ loading: false, status: true, }); - toast.success("Account Topup was successful"); - onClose() + + setConfirmCredit((prev) => ({ + ...prev, + show: { + awaitConfirm: { loader: false, state: false }, + acceptConfirm: { loader: false, state: true }, + }, + data: res, + })); dispatch(tableReload({ type: "WALLETTABLE" })); navigate("/my-wallet", { replace: true }); // setTimeout(() => { @@ -267,7 +275,7 @@ function ConfirmAddFund({ })); return; } - + setTimeout(() => { setConfirmCredit((prev) => ({ ...prev, @@ -300,9 +308,7 @@ function ConfirmAddFund({ }, data: {}, })); - } - - console.log(__confirmData) + }; return (
-- 2.34.1