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

Missing property for encryptedCardNumber error in v6 #3034

Open
ashrafnazar opened this issue Dec 19, 2024 · 4 comments
Open

Missing property for encryptedCardNumber error in v6 #3034

ashrafnazar opened this issue Dec 19, 2024 · 4 comments
Labels
Confirmed Issue is confirmed and needs fix To be investigated

Comments

@ashrafnazar
Copy link

Describe the bug
A clear and concise description of what the bug is.

Having state.errors?.encryptedCardNumber?.detectedBrands will flag a compilation error in the code

To Reproduce
Steps to reproduce the behavior:

  1. Enter in an unsupported card
  2. There is a detectedBrands array in the encryptedCardNumber error property, but is not present in the type

Expected behavior
The type should include an optional property for detectedBrands

@ashrafnazar ashrafnazar changed the title Missing property for encryptedCardNumber error Missing property for encryptedCardNumber error in v6 Dec 19, 2024
@longyulongyu
Copy link
Contributor

Hi @ashrafnazar thanks for reporting. Are you referring to the state object in the onChange callback for the Card component?

@ashrafnazar
Copy link
Author

Hi @longyulongyu - that's correct

@sponglord sponglord added the Confirmed Issue is confirmed and needs fix label Jan 7, 2025
@sponglord
Copy link
Contributor

@ashrafnazar - thanks for pointing this out.
Unfortunately it has triggered a larger discussion about the onChange callback and the type of data it receives (which varies based on payment method)
For this reason we don't anticipate a fix any time soon. :-(
For the time being can you work around this in your own code to avoid the compilation error?

@ashrafnazar
Copy link
Author

@sponglord - apologies for the late reply. That's fine, we're comparing the encryptedCardNumber.error property for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Confirmed Issue is confirmed and needs fix To be investigated
Projects
None yet
Development

No branches or pull requests

3 participants