Closed BeauNouvelle closed 6 years ago
Here's what I'm using at the moment right after pre-filling:
let result = cardType.validate(number: card.bankCardNumber)
.union(cardType.validate(cvc: card.cardVerificationCode))
.union(cardType.validate(expiry: card.expiryDate))
submitCardButton.isEnabled = result == .Valid
I guess technically it's a single line, but would love something a little shorter.
The current example project does this, enabling a "Buy" button in the upper right hand corner of the screen. cardTextField(_ cardTextField: CardTextField, didEnterCardInformation information: Card, withValidationResult validationResult: CardValidationResult)
is called appropriately here to update this button state as you describe. Please note, that this uses prefill(_, month: Int, year: Int, cvc: String)
rather than setting text directly, in case that is what you are doing.
Thanks, Daniel
No problem thank you.
After pre-filling fields with CardIO,
didEnterCardInformation
is not called. Some actions are taken after a successful validation, such as enabling a "Submit" button.How would I force textfield to validate and call the
didEnterCardInformation
delegate method?