Skip to content

Commit

Permalink
refactor: moved the expiry message to on change (#814)
Browse files Browse the repository at this point in the history
  • Loading branch information
sakksham7 authored Dec 2, 2024
1 parent 046f577 commit cfa8aa3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/Payment.res
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ let make = (~paymentMode, ~integrateError, ~logger) => {
}
setExpiryValid(formattedExpiry, setIsExpiryValid)
setCardExpiry(_ => formattedExpiry)
// * Sending card expiry to handle cases where the card expires before the use date.
Utils.messageParentWindow([("expiryDate", formattedExpiry->JSON.Encode.string)])
}

let changeCVCNumber = ev => {
Expand Down
3 changes: 0 additions & 3 deletions src/Payments/CardPayment.res
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,6 @@ let make = (
defaultCardBody
}
if confirm.doSubmit {
// * Sending card expiry to handle cases where the card expires before the use date.
messageParentWindow([("expiryDate", cardExpiry->JSON.Encode.string)])

let isCardDetailsValid =
isCVCValid->Option.getOr(false) &&
isCardValid->Option.getOr(false) &&
Expand Down

0 comments on commit cfa8aa3

Please sign in to comment.