From 89c593621232d33299e5e66109f9887549a251a2 Mon Sep 17 00:00:00 2001 From: Ebube Date: Mon, 17 Jul 2023 11:29:50 +0100 Subject: [PATCH] Some fixes --- .../MyWallet/Popup/CompleteConfirmCredit.jsx | 60 ++++++++++--------- .../MyWallet/Popup/ConfirmAddFund.jsx | 4 +- src/components/MyWallet/Popup/CreditPopup.jsx | 3 + 3 files changed, 38 insertions(+), 29 deletions(-) diff --git a/src/components/MyWallet/Popup/CompleteConfirmCredit.jsx b/src/components/MyWallet/Popup/CompleteConfirmCredit.jsx index 1c13432..51f827f 100644 --- a/src/components/MyWallet/Popup/CompleteConfirmCredit.jsx +++ b/src/components/MyWallet/Popup/CompleteConfirmCredit.jsx @@ -53,38 +53,44 @@ function CompleteConfirmCredit({ onClose, confirmCredit }) {

{data?.result == "Charge success" ? "Credit was Successful!" - : data?.result} + : "Credit was Unsuccessful"}

-
-

- Amount({data?.currency || ""}) -

- - {`${data?.symbol || ""} ${ - Number(data?.amount * 0.01).toLocaleString() || "" - }`} - -
+ {data?.internal_return >= 0 ? ( + <> +
+

+ Amount({data?.currency || ""}) +

+ + {`${data?.symbol || ""} ${ + Number(data?.amount * 0.01).toLocaleString() || "" + }`} + +
-
-

- Wallet Balance -

- - {data?.curr_balance} - -
+
+

+ Wallet Balance +

+ + {data?.curr_balance} + +
-
-

- Confirmation Number -

- - {data?.confirmation} - -
+
+

+ Confirmation Number +

+ + {data?.confirmation} + +
+ + ) : ( +
+ )} diff --git a/src/components/MyWallet/Popup/ConfirmAddFund.jsx b/src/components/MyWallet/Popup/ConfirmAddFund.jsx index 4a4dd1a..cc05950 100644 --- a/src/components/MyWallet/Popup/ConfirmAddFund.jsx +++ b/src/components/MyWallet/Popup/ConfirmAddFund.jsx @@ -11,7 +11,7 @@ function ThePaymentText({ value, type }) { type === "new" ? cardDetails.cardNum[0] === "4" ? "Visa" - : value[0] === "5" + : value[0] == "5" ? "Master" : "ATM" : value.description; @@ -223,7 +223,7 @@ function ConfirmAddFund({ amount: amount * 100, cardnumber: cardNum.replace(/\s/g, ""), credit_reference, - cvc: cvv, + cvc: String(cvv), description: address, exp_month: expirationMonth, exp_year: expirationYear, diff --git a/src/components/MyWallet/Popup/CreditPopup.jsx b/src/components/MyWallet/Popup/CreditPopup.jsx index b464db0..4d291ea 100644 --- a/src/components/MyWallet/Popup/CreditPopup.jsx +++ b/src/components/MyWallet/Popup/CreditPopup.jsx @@ -24,6 +24,9 @@ const CreditPopup = ({ details, onClose, situation, walletItem }) => {

+ {confirmCredit?.show?.acceptConfirm?.state && + confirmCredit?.data?.internal_return < 0 && + "Credit Unsuccessful"} {confirmCredit?.show?.acceptConfirm?.loader ? "Confirming Credit..." : confirmCredit?.show?.awaitConfirm?.state