Using the single UI element, I am able to submit a card without inputting a zip code, even though the zip code is required. This happens when receiving a stripe error on the first submission, and then subsequently submitting valid info without a postal code. I suspect that this might be related to #158 because the steps to reproduce are very similar (so I am not sure if this is a react-stripe-elements issue or a Stripe.js issue).
Steps to reproduce:
4000000000000101, for a real card use the card number with an incorrect CVC code)Examining the element's state through the onChange function, we see that the postalCode is initially '' (the empty string), and once reset becomes undefined. Also (and I assume the reason for this issue) complete is set to true, even though there is no postalCode. On the first attempt, complete is false when there is no postalCode.
I should also note that this is for adding a card, not checking out.
Thanks for reporting @ejarzo! This indeed seems like a bug in Stripe.js. I've reported it internally, and we will work to push a fix soon.
@atty-stripe Thanks! I actually noticed that my steps are a little convoluted (whoops). All you need to do is enter a CC number, enter a ZIP, and then delete the CC number and you will be able to submit with an empty ZIP.
Yep, we found that as well! We're actively working on a fix, and will post here once it's done.
@atty-stripe Would you be able to suggest a workaround for the interim? We tried using the postalCode of the underlying elements card object but no luck as it's an unreliable source of truth (will be an empty string initially and then undefined after the bug state is entered).
@ACollectionOfAtoms I don't think there's a workaround in the mean time. We're still working on a fix though, and we will post here when this issue is resolved!
Hi all -- this bug should now be fixed. Please let us know if you find any other issues!
@ACollectionOfAtoms The value.postalCode attribute in the change event should also now always be a string (empty or with a value.)
Most helpful comment
Yep, we found that as well! We're actively working on a fix, and will post here once it's done.