You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm using CardField and createToken method in my application. Everything is working perfectly fine.
But I want to do customizations with CardField, and I'm unable to do that.
CardField is handling all the validations which are really great, but I also want to display errors to users, that which specific fields have issues.
I was able to handle the error message for ExpiryDate, as shown in the below screenshots.
How I handled this CardField has a method on onCardChange, in which I have access to expiryMonth and expiryYear. I can validate it, and show errors to the user. But I can't do it for the card number. Because when the card number is empty or is not valid, onCardChange gives null for last4 digits of the card. Same for CVC.
Describe the solution you'd like CardField has a method on onCardChange, which gives cardDetails. Addition of some bool attributes like validCard, validExpiryDate, and validCVC, so I can show & hide errors at my end. Just like we have complete in cardDetails, which is false when any of the fields are invalid, and true when all the fields are valid.
Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered:
ghost
changed the title
CardField handle errors
CardField handle validation errors
Jul 15, 2021
Is your feature request related to a problem? Please describe.
I'm using
CardField
andcreateToken
method in my application. Everything is working perfectly fine.But I want to do customizations with
CardField
, and I'm unable to do that.CardField
is handling all the validations which are really great, but I also want to display errors to users, that which specific fields have issues.I was able to handle the error message for
ExpiryDate
, as shown in the below screenshots.How I handled this
CardField
has a method ononCardChange
, in which I have access toexpiryMonth
andexpiryYear
. I can validate it, and show errors to the user. But I can't do it for the card number. Because when the card number is empty or is not valid,onCardChange
givesnull
forlast4
digits of the card. Same forCVC
.Describe the solution you'd like
CardField
has a method ononCardChange
, which givescardDetails
. Addition of some bool attributes likevalidCard
,validExpiryDate
, andvalidCVC
, so I can show & hide errors at my end. Just like we havecomplete
incardDetails
, which isfalse
when any of the fields are invalid, andtrue
when all the fields are valid.Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: