Skip to content

Commit

Permalink
Pull request #208: Saved card
Browse files Browse the repository at this point in the history
Merge in EXC/orca-elements from praful/savedCard_bugfix to master

* commit '230259ab0bc35ebb57d5ba77f377b9f7119e28d8':
  saved card cvc added isValid check
  • Loading branch information
prafulkoppalkar authored and arun.mishra committed Aug 29, 2023
2 parents 86a3804 + 230259a commit 234e57e
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 234e57e

Please sign in to comment.