- Add order number to param logging.
- Add support for request/response logging.
- Made sure cache key is a string, instead of a giant nested hash/array structure that probably won't get interpreted by Rails well. Still not happy with the caching behaviour, but it's configurable.
- Added
SuperGood::SolidusTaxJar.taxable_order_check
option which can be set to a proc that receives the order and will prevent actual tax calculation from occurring if it returns false. If your app has introduced a method likeSpree::Order#complimentary?
, you could avoid trying to compute taxes on complimentary orders by doing the following in an initializer:SuperGood::SolidusTaxJar.taxable_order_check = ->(order) { order.complimentary? }
- Report order.user_id as customer_id when calculating taxes and creating transactions. This enables the use of per customer exemptions.
- Report no tax collected on order and line items when order total zeroed out.
- Avoid sending negative amounts for order totals.
- Avoid sending 0 quantity line items. TaxJar doesn't like them.
- Make shipping amounts configurable to make it easier to support order-level adjustments.
- Fixed unreliable default cache key implementation.
- Made response cache key and cache duration configurable.
- Increased response caching time to 3 hours.
- Switched to sending the full list of line items when creating/updating transactions in TaxJar.
-
Fixed issued where orders without tax address would cause errors because
Spree::Order#tax_address
will return aSpree::Tax::TaxLocation
when called on an order without a tax address.Spree::Tax::TaxLocation
isn't enough like a real address and this was causing exceptions.To fix this
SuperGood::SolidusTaxJar#incomplete_address?
was updated to treatSpree::Tax::TaxLocation
s as "incomplete". (Thanks to @JuanCrg90!)
Warning: v0.6.1 has a critical bug and should not be used.
- Stopped using the deprecated method
Spree::Address#empty?
in favour of simply checking that we have all of the fields on the address required for doing a TaxJar lookup.
- Added
SuperGood::SolidusTaxJar.shipping_tax_label_maker
for customizing the labels on the tax adjustments on shipments. - Added
SuperGood::SolidusTaxJar.line_item_tax_label_maker
for customizing the labels on the line iteme tax adjustments.
- Moved exception handler configuration to
SuperGood::SolidusTaxJar.exception_handler
fromSuperGood::SolidusTaxJar::TaxCalculator.exception_handler
. Now all the configuration options are in the same place. - Added
SuperGood::SolidusTaxJar.taxable_address_check
option which can be set to a block that receives the address and will prevent actual tax calculator from occurring if it returns false. If your app has introduced a method likeSpree::Address#us?
, you could avoid trying to compute taxes on non-US orders by doing the following in an initializer:SuperGood::SolidusTaxJar.taxable_address_check = ->(address) { address.us? }