From 134be24f677be142b5ddeb889c45e80a19fd58c8 Mon Sep 17 00:00:00 2001 From: andrea longhi Date: Mon, 13 Jan 2020 20:12:43 +0100 Subject: 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. --- lib/super_good/solidus_taxjar/api_params.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/super_good') 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)) -- cgit v1.2.3