Open RostyslavKhasanov opened 6 months ago
Hey @RostyslavKhasanov Thanks for writing in!
It sounds like your issue is slightly different than the previous issue. Your issue is that the client-side is reporting an empty string as a valid postal code whereas when you submit this data to your server-side call our gateway reads it as an empty string, so reporting that it was submitted as empty
The reason for this is that postal codes differ across multiple countries, so the only validation we make on the postal code is to check if it is within the minimum and maximum lengths since, for example, in the UK, valid postal codes do have a whitespace in them. We have built this card-validator module for these checks and you can see that repo for more information on how this works within our SDK -> https://github.com/braintree/card-validator?tab=readme-ov-file#validpostalcodevalue-string-options-object-object
However, I do agree with you that it would be a good idea to report the postal code as invalid if the entire value is whitespace.
Since this is actually an issue with our card-validator module, I've opened the issue there -> https://github.com/braintree/card-validator/issues/121
I'll also keep this issue open until we are able to get this prioritized.
General information
Issue description
My question is similar to !425 issue. I'm able to pass " " (whitespace characters) to the postal code and submit the form. It accepted by braintree-web. But when try to use generated nonce for sale transaction an error occurs on the server: "Addresses must have at least one field filled in".
Do you have any updates on validation for postal code ?