diff options
author | Jared Norman <jared@super.gd> | 2019-06-25 14:48:34 -0700 |
---|---|---|
committer | Jared Norman <jared@super.gd> | 2019-06-25 14:48:34 -0700 |
commit | 707db65108006f06a34fee95ed507b0ae855ef57 (patch) | |
tree | 6ee7c2e38677505c66e4406f931a18ba6636d74f /lib/super_good/solidus_taxjar/api.rb | |
parent | 7d71b5c5c1e8894c70899f1a9ffc9fe3a3d6c810 (diff) |
Add logging
This will log the params sent to and responses received from TaxJar in
order to facilitate debugging production issues.
Diffstat (limited to 'lib/super_good/solidus_taxjar/api.rb')
-rw-r--r-- | lib/super_good/solidus_taxjar/api.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/super_good/solidus_taxjar/api.rb b/lib/super_good/solidus_taxjar/api.rb index 7309a64..0d182ce 100644 --- a/lib/super_good/solidus_taxjar/api.rb +++ b/lib/super_good/solidus_taxjar/api.rb @@ -13,7 +13,13 @@ module SuperGood end def tax_for(order) - taxjar_client.tax_for_order APIParams.order_params(order) + taxjar_client.tax_for_order(APIParams.order_params(order)).tap do |taxes| + next unless SuperGood::SolidusTaxJar.logging_enabled + + Rails.logger.info( + "TaxJar response for #{order.number}: #{taxes.to_h.inspect}" + ) + end end def tax_rates_for(address) |