Age | Commit message (Collapse) | Author |
|
According to the documentation, and some testing, the API will raise a
Taxjar::Error::NotFound error if the API finds no addresses. Instead of
raising this error to others, we should handle it ourselves and return
nil/an empty array like we originally intended.
https://developers.taxjar.com/api/reference/#post-validate-an-address
|
|
|
|
Support for TaxJar Address Validation API
|
|
|
|
|
|
This is used by any class that interacts with the TaxJar API and is
meant to be able to be consumed by applications for custom needs, so
let's just make it exposed at the top level.
|
|
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.
|
|
I'm going to add support for address validation. This is the first step,
ensuring that we can take a Spree::Address and transform it into the
params that TaxJar expects for the address validation endpoint.
|
|
|
|
solidus_dev_support-support
|
|
|
|
|
|
|
|
|
|
While bundler knows to translate the dashes in gem names into slashes
for namespaced gems, there's some interplay between solidus_core's test
helpers and solidus_dev_support that ends up trying to require the name
of the gem without bundler's fallback logic.
This just makes it so everything plays nice with the namespaced gem
name.
|
|
|
|
This updates the project to the compatible BSD 3-clause license and
transfers the ownership to Super Good Software, Inc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Use shipping_calculator lambda for order shipping param
|
|
`APIParams#order_params` should use the `shipping_calculator` lambda
instead of a hardcoded value for providing shipping costs to TaxJar.
|
|
|
|
Add support for modifying order params
|
|
|
|
|
|
Remove unnecessary errors when validating address without country
|
|
The safe navigator is not necessary here, as all other method
calls on `address` don't have it.
|
|
When validating addresses, it may happen that the address
has no country, so trying to fetch the country ISO raises
an unnecessary error. Using ruby safe navigation prevents
this to happen. Of course, the address will still result
invalid eventually.
|
|
Add tax rate calculator
|
|
|
|
|
|
|
|
This new calculator allows to retrieve tax rate information starting
from a `Spree::Address` model.
It shares some logic with the tax calculator, for example the ability
to handle exceptions using `SolidusTaxJar.exception_handler` lambda.
|
|
When calculating tax rates, the recommended endpoint from TaxJar
support for live calculations is `/v2/taxes`, the same used for
calculating order taxes, as it accounts for all factors like
sourcing or nexus, while the `/v2/rates` endpoint will return
the full combined rate for the queried location.
|
|
This helper converts a `Spree::Address` to address params that can be
used to retrieve the tax rate for that location.
|
|
`SuperGood::SolidusTaxJar.cache_key` uses different `APIParams`
methods for calculating cache keys for different models.
|
|
This module includes helper methods that can be shared among different
calculators.
|
|
Fixed the example of the error handler configuration
|
|
|
|
|
|
This is ready for primetime use, but missing documentation and some other things I want to include in v1.0.
|
|
|
|
Much easier to trace a request by doing this.
|
|
|
|
Logging!
|
|
|