From 230259ab0bc35ebb57d5ba77f377b9f7119e28d8 Mon Sep 17 00:00:00 2001 From: Praful Koppalkar Date: Tue, 29 Aug 2023 12:22:48 +0530 Subject: [PATCH] saved card cvc added isValid check --- src/Payments/CardPayment.res | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Payments/CardPayment.res b/src/Payments/CardPayment.res index ff011ed80..bcd1e1a4e 100644 --- a/src/Payments/CardPayment.res +++ b/src/Payments/CardPayment.res @@ -134,9 +134,11 @@ let make = ( let complete = showFeilds ? isAllValid(isCardValid, isCVCValid, isExpiryValid, true, "payment") - : token !== "" - let empty = showFeilds ? cardNumber == "" || cardExpiry == "" || cvcNumber == "" : false - + : switch isCVCValid { + | Some(val) => token !== "" && !isBancontact && val + | _ => false + } + let empty = showFeilds ? cardNumber == "" || cardExpiry == "" || cvcNumber == "" : cvcNumber == "" React.useEffect1(() => { setComplete(._ => complete) None @@ -222,7 +224,7 @@ let make = ( ~handleUserError=false, (), ) - } else if !showFeilds && token !== "" && !isBancontact && cvcNumber !== "" { + } else if complete && !empty { intent( ~bodyArr=savedCardBody, ~confirmParam=confirm.confirmParams,