diff --git a/src/components/pages/ABDesign/v1/pages/TrialPayment/index.tsx b/src/components/pages/ABDesign/v1/pages/TrialPayment/index.tsx index f617d36..5bc9290 100644 --- a/src/components/pages/ABDesign/v1/pages/TrialPayment/index.tsx +++ b/src/components/pages/ABDesign/v1/pages/TrialPayment/index.tsx @@ -72,10 +72,10 @@ function TrialPaymentPage() { }, [isPaymentSuccess]) useEffect(() => { - if (isModalClosed) { + if (isModalClosed && !isPaymentSuccess && !isLoading) { return handleDiscount() } - }, [isModalClosed]) + }, [isModalClosed, isPaymentSuccess, isLoading]) useEffect(() => { if (error?.length && error !== "Product not found") { diff --git a/src/hooks/payment/nmi/usePayment.ts b/src/hooks/payment/nmi/usePayment.ts index 50ead93..775b8ba 100644 --- a/src/hooks/payment/nmi/usePayment.ts +++ b/src/hooks/payment/nmi/usePayment.ts @@ -78,7 +78,6 @@ export const usePayment = ({ placementKey, activeProduct }: IUsePaymentProps) => const finishSubmit = async (response: any) => { try { - console.log("response: ", response); setIsSubmitting(true); const res = await api.makePayment({ token,