solidus icon indicating copy to clipboard operation
solidus copied to clipboard

Set `states_required` to false for Germany

Open seand7565 opened this issue 5 years ago • 2 comments

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.

seand7565 avatar Oct 21 '20 19:10 seand7565

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?

stuffmatic avatar Nov 07 '20 21:11 stuffmatic

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

victorth avatar Nov 10 '20 07:11 victorth