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

Set states_required to false for Germany #3803

Open
seand7565 opened this issue Oct 21, 2020 · 2 comments
Open

Set states_required to false for Germany #3803

seand7565 opened this issue Oct 21, 2020 · 2 comments
Labels
changelog:solidus_core Changes to the solidus_core gem type:bug Error, flaw or fault

Comments

@seand7565
Copy link
Contributor

German addresses do not typically use states. See: https://www.angloinfo.com/how-to/germany/housing/postal-system

This can cause validation issues on things like solidus_paypal_braintree because PayPal will not return a state when the users selects a German address in PayPal.

Valid German address in PayPal (no state):
Screen Shot 2020-10-21 at 2 52 03 PM

the below error happens on submit with solidus_paypal_braintree cart checkout on submit:
Screen Shot 2020-10-21 at 2 52 10 PM

I'm sure there are other countries like this, but Germany is the only one that I'm currently aware of.

states_required is set to true automatically if the country has any subregions in Carmen, but it appears that that shouldn't happen in some cases. See here - I think that's where it's being set.

@stuffmatic
Copy link

stuffmatic commented Nov 7, 2020

Another example of a country where states_required should be false is Sweden. It's easy enough to set this flag manually if need be, but it would be nice if this information was kept and maintained centrally in Solidus. As far as I can tell, the value of states_required can't be deduced from Carmen data alone, so out of curiosity I had a quick look at the Spree code base and it seems like they're using a hardcoded list of countries for which states_required should be true. Would something like this be a reasonable solution?

@victorth
Copy link

The same is true for the Netherlands and I believe for, most European countries.

@kennyadsl kennyadsl added type:bug Error, flaw or fault changelog:solidus_core Changes to the solidus_core gem labels Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_core Changes to the solidus_core gem type:bug Error, flaw or fault
Projects
None yet
Development

No branches or pull requests

4 participants