diff --git a/src/components/MyWallet/Popup/CompleteConfirmCredit.jsx b/src/components/MyWallet/Popup/CompleteConfirmCredit.jsx index 1c13432..62e3e05 100644 --- a/src/components/MyWallet/Popup/CompleteConfirmCredit.jsx +++ b/src/components/MyWallet/Popup/CompleteConfirmCredit.jsx @@ -1,7 +1,6 @@ import React from "react"; function CompleteConfirmCredit({ onClose, confirmCredit }) { - console.log(confirmCredit); const { data } = confirmCredit; return (
@@ -53,38 +52,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..a0fa4ff 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" + : cardDetails.cardNum[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).length === 1 ? `0${cvv}` : String(cvv), description: address, exp_month: expirationMonth, exp_year: expirationYear, @@ -269,7 +269,7 @@ function ConfirmAddFund({ acceptConfirm: { loader: false }, }, })); - setTimeout(() => onClose, 10000) + setTimeout(() => onClose, 10000); console.log(error); } }; diff --git a/src/components/MyWallet/Popup/CreditPopup.jsx b/src/components/MyWallet/Popup/CreditPopup.jsx index b464db0..d186081 100644 --- a/src/components/MyWallet/Popup/CreditPopup.jsx +++ b/src/components/MyWallet/Popup/CreditPopup.jsx @@ -24,13 +24,20 @@ const CreditPopup = ({ details, onClose, situation, walletItem }) => {

- {confirmCredit?.show?.acceptConfirm?.loader - ? "Confirming Credit..." - : confirmCredit?.show?.awaitConfirm?.state - ? "Confirm Credit Add" - : confirmCredit?.show?.acceptConfirm?.state - ? "Credit Add Completed" - : "Add Credit"} + {confirmCredit?.show?.acceptConfirm?.state && + confirmCredit?.data?.internal_return < 0 ? ( + "Credit Unsuccessful" + ) : ( + <> + {confirmCredit?.show?.acceptConfirm?.loader + ? "Confirming Credit..." + : confirmCredit?.show?.awaitConfirm?.state + ? "Confirm Credit Add" + : confirmCredit?.show?.acceptConfirm?.state + ? "Credit Add Completed" + : "Add Credit"} + + )}