summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJared Norman <jared@super.gd>2020-07-08 17:57:11 -0700
committerJared Norman <jared@super.gd>2020-07-14 13:07:55 -0700
commitd7cf2cb8d7f0bb45f69cb1cef58faf246aa5ff84 (patch)
treefe19cccf000a3c8ffdbf47b05f2f037902a631fb /lib
parentc170aa6c7e82560747e252682852984d2e8fdba0 (diff)
Add param generation for validate_address endpoint
I'm going to add support for address validation. This is the first step, ensuring that we can take a Spree::Address and transform it into the params that TaxJar expects for the address validation endpoint.
Diffstat (limited to 'lib')
-rw-r--r--lib/super_good/solidus_taxjar/api_params.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/super_good/solidus_taxjar/api_params.rb b/lib/super_good/solidus_taxjar/api_params.rb
index ebce8fe..a7d1a5b 100644
--- a/lib/super_good/solidus_taxjar/api_params.rb
+++ b/lib/super_good/solidus_taxjar/api_params.rb
@@ -66,6 +66,16 @@ module SuperGood
)
end
+ def validate_address_params(spree_address)
+ {
+ country: spree_address.country&.iso,
+ state: spree_address.state&.abbr || adddress.state_name,
+ zip: spree_address.zipcode,
+ city: spree_address.city,
+ street: spree_address.address1
+ }
+ end
+
private
def customer_params(order)