solidusio / solidusio/solidus

Germany and other countries are seeded with `states_required` true

Open
#3,803 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

changelog:solidus_core
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):
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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.