Germany and other countries are seeded with `states_required` true
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 5.3k
- Forks
- 1.4k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 62
Description
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):

the below error happens on submit with solidus_paypal_braintree cart checkout on submit:

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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with core/db/default/spree/countries.rb, where states_required is derived from Carmen subregions, and inspect how country address validation consumes that value. Confirm the expected behavior for Germany and any similarly affected countries; done means German checkout addresses without a state pass validation without breaking countries that require one.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100