summaryrefslogtreecommitdiff
path: root/lib/super_good/solidus_taxjar/api_params.rb
diff options
context:
space:
mode:
authorNoah Silvera <noah@super.gd>2021-04-30 10:51:32 -0700
committerNoah Silvera <noah@super.gd>2021-05-19 12:01:16 -0700
commit038f392070aab53512871a1208081b1122968536 (patch)
tree82e7cc65e6b7228395286398dc9fa6140ce812bd /lib/super_good/solidus_taxjar/api_params.rb
parent676adfa988317ef15ee412f230e1431648774ff4 (diff)
Use spree address2 if it is present
The taxjar validation API has the option to take a freeform street input consisting of the full address. This means that if both address1 and address2 exist, we should concatenate them and pass them to the street parameter. This can help with situations that involve a suite number that has a unique ZIP+4 code that can be determined from the suite. The suite number is usually kept in address2, so without it, there's no way to distinguish the full address if only the 5 digit zip code is passed. Co-authored-by: Nick Van Doorn <nick@super.gd>
Diffstat (limited to 'lib/super_good/solidus_taxjar/api_params.rb')
-rw-r--r--lib/super_good/solidus_taxjar/api_params.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/super_good/solidus_taxjar/api_params.rb b/lib/super_good/solidus_taxjar/api_params.rb
index ef189e9..2e0e92c 100644
--- a/lib/super_good/solidus_taxjar/api_params.rb
+++ b/lib/super_good/solidus_taxjar/api_params.rb
@@ -72,7 +72,7 @@ module SuperGood
state: spree_address.state&.abbr || spree_address.state_name,
zip: spree_address.zipcode,
city: spree_address.city,
- street: spree_address.address1
+ street: [spree_address.address1, spree_address.address2].compact.join(' ')
}
end