From 1625312bbb3b0399f40006da161309295811630a Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Wed, 13 Mar 2024 21:40:17 +0530 Subject: [PATCH] fix: not require_cvc disable the pay now button --- src/Components/PayNowButton.res | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Components/PayNowButton.res b/src/Components/PayNowButton.res index 85d1ce3dc..f9619cc5e 100644 --- a/src/Components/PayNowButton.res +++ b/src/Components/PayNowButton.res @@ -79,18 +79,26 @@ let make = ( let buttonText = sdkHandleConfirmPayment.buttonText->Option.getOr(localeString.payNowButton) - React.useEffect4(() => { + React.useEffect5(() => { if showFields { if selectedOption === Card { setIsDisabled(_ => !validFormat) } else { setIsDisabled(_ => !areRequiredFieldsValidValue) } + } else if !customerMethod.requiresCvv { + setIsDisabled(_ => customerMethod.requiresCvv) } else { setIsDisabled(_ => !isSavedMethodCheck) } None - }, (validFormat, areRequiredFieldsValidValue, selectedOption, isSavedMethodCheck)) + }, ( + validFormat, + areRequiredFieldsValidValue, + selectedOption, + isSavedMethodCheck, + customerMethod.requiresCvv, + ))