testing topupResult

This commit was merged in pull request #364.
This commit is contained in:
2023-07-31 13:02:31 +01:00
parent 41badd52be
commit f543a2d893
@@ -128,20 +128,21 @@ function ConfirmAddFund({
logo: "https://www.wrenchboard.com/assets/images/wrench-500-500-icon.png", logo: "https://www.wrenchboard.com/assets/images/wrench-500-500-icon.png",
}, },
}; };
//debugger; //debugger;
const fwConfig = { const fwConfig = {
...config, ...config,
text: "Proceed", text: "Proceed",
callback: (response) => { callback: (response) => {
onSuccessPayment(); onSuccessPayment();
closePaymentModal(); setTimeout(() => {
closePaymentModal();
}, 2000);
}, },
onClose: () => {},
}; };
const onSuccessPayment = () => { const onSuccessPayment = () => {
setRequestStatus({ message: "", loading: true, status: false }); 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"); console.log("**** onSuccessPayment **** THIS WAS REACHED");
apiURL apiURL
.resultTopUp(reqData) .resultTopUp(reqData)
@@ -159,8 +160,15 @@ function ConfirmAddFund({
loading: false, loading: false,
status: true, 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" })); dispatch(tableReload({ type: "WALLETTABLE" }));
navigate("/my-wallet", { replace: true }); navigate("/my-wallet", { replace: true });
// setTimeout(() => { // setTimeout(() => {
@@ -300,9 +308,7 @@ function ConfirmAddFund({
}, },
data: {}, data: {},
})); }));
} };
console.log(__confirmData)
return ( return (
<div className="content-wrapper w-full h-[32rem]"> <div className="content-wrapper w-full h-[32rem]">