Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add validation state to CardField (#423) #629

Merged
merged 1 commit into from
Nov 16, 2021

Conversation

atiernan
Copy link
Contributor

@atiernan atiernan commented Oct 7, 2021

Closes #423

This adds three new fields to the card details returned by onCardChange: validCVC, validExpiryDate, and validNumber. On iOS, each field has a possible value of "Valid", "Invalid", "Incomplete", and "Unknown". The Android SDK doesn't seem to expose whether a field is incomplete or not, so Android has "Valid", "Invalid", and "Unknown".

This is my first time working on a native module so I'm not 100% on the Swift and Kotlin syntax, let me know if there's a better way to write this and I'll update it

@CLAassistant
Copy link

CLAassistant commented Oct 7, 2021

CLA assistant check
All committers have signed the CLA.

@arekkubaczkowski
Copy link
Collaborator

@atiernan great job but I am wondering if we should stay only with valid | invalid | unknown states to keep consistency on both platforms. @trag-stripe what do you think?

@atiernan
Copy link
Contributor Author

atiernan commented Oct 9, 2021

For my use case the Incomplete state is a necessity, as my apps styling would be out of sync with the SDKs error styling (showing the error state when the field is empty/incomplete)

Would it not be better to have the ideal situation on iOS and push for an update to the Android SDK, to align them, rather than settle for a subpar solution on both platforms.

I can see the want for consistency between platforms though, so I'm happy to update the PR either way

@atiernan
Copy link
Contributor Author

@csabol-stripe @michelleb-stripe Is there anything I can do to help progress this?

@giorgiofellipe
Copy link

Thanks @atiernan for the great work.

@arekkubaczkowski would be really great to have it merged and published.

Let me know if there is anything I can help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CardField handle validation errors
7 participants