summaryrefslogtreecommitdiff
path: root/lib/super_good/solidus_taxjar
diff options
context:
space:
mode:
authorJared Norman <jared@super.gd>2020-07-08 18:26:14 -0700
committerJared Norman <jared@super.gd>2020-07-14 13:07:55 -0700
commit68b29ea1afbb9339865493016fe196464b7ee1f4 (patch)
tree4995d60a49e75c571d9f450ae6277afb4ce1fe47 /lib/super_good/solidus_taxjar
parentd7cf2cb8d7f0bb45f69cb1cef58faf246aa5ff84 (diff)
Add API call to validate addresses
This adds support to the API module for performing address validation lookups. It doesn't hook anything up to that, but you can now call: SuperGood::SolidusTaxjar.new.validate_spree_address(address) to hit the TaxJar address validation API and a list of validated addresses back.
Diffstat (limited to 'lib/super_good/solidus_taxjar')
-rw-r--r--lib/super_good/solidus_taxjar/api.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/super_good/solidus_taxjar/api.rb b/lib/super_good/solidus_taxjar/api.rb
index 865bb45..9a8ba90 100644
--- a/lib/super_good/solidus_taxjar/api.rb
+++ b/lib/super_good/solidus_taxjar/api.rb
@@ -46,6 +46,10 @@ module SuperGood
taxjar_client.create_refund APIParams.refund_params(reimbursement)
end
+ def validate_spree_address(spree_address)
+ taxjar_client.validate_address APIParams.validate_address_params(spree_address)
+ end
+
private
attr_reader :taxjar_client