summaryrefslogtreecommitdiff
path: root/lib/super_good/solidus_taxjar
diff options
context:
space:
mode:
authorandrea longhi <andrea@spaghetticode.it>2020-01-13 20:12:43 +0100
committerandrea longhi <andrea@spaghetticode.it>2020-01-14 09:44:59 +0100
commit134be24f677be142b5ddeb889c45e80a19fd58c8 (patch)
tree93679f3d992e96fb9a02f10e4c5b1c5df655a4b8 /lib/super_good/solidus_taxjar
parent0c11683822428495635e5acd2ec32c382f2ff261 (diff)
Add SolidusTaxJar::APIParams.tax_rate_address_params
This helper converts a `Spree::Address` to address params that can be used to retrieve the tax rate for that location.
Diffstat (limited to 'lib/super_good/solidus_taxjar')
-rw-r--r--lib/super_good/solidus_taxjar/api_params.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/super_good/solidus_taxjar/api_params.rb b/lib/super_good/solidus_taxjar/api_params.rb
index b8ef896..3e5bcb4 100644
--- a/lib/super_good/solidus_taxjar/api_params.rb
+++ b/lib/super_good/solidus_taxjar/api_params.rb
@@ -29,6 +29,13 @@ module SuperGood
]
end
+ def tax_rate_address_params(address)
+ {
+ amount: 100,
+ shipping: 0,
+ }.merge(order_address_params(address))
+ end
+
def transaction_params(order)
{}
.merge(customer_params(order))