Skip to content

Commit

Permalink
saved card cvc added isValid check
Browse files Browse the repository at this point in the history
  • Loading branch information
prafulkoppalkar committed Aug 29, 2023
1 parent 86a3804 commit 230259a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Payments/CardPayment.res
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -222,7 +224,7 @@ let make = (
~handleUserError=false,
(),
)
} else if !showFeilds && token !== "" && !isBancontact && cvcNumber !== "" {
} else if complete && !empty {
intent(
~bodyArr=savedCardBody,
~confirmParam=confirm.confirmParams,
Expand Down

0 comments on commit 230259a

Please sign in to comment.