Age | Commit message (Collapse) | Author |
|
Add information around the breaking changes added and upgrade
instructions for 0.17.X to 0.18.X
Co-authored-by: Nick Van Doorn <nick@super.gd>
|
|
This done so Zeitwerk can correctly can correctly load the class
from the filename.
Co-authored-by: Nick Van Doorn <nick@super.gd>
|
|
In order for the Zeitwerk loader to properly identity our classes
from the file names, we should remove camel casing from this name
that isn't consistent with underscores in the file name itself.
Co-authored-by: Nick Van Doorn <nick@super.gd>
|
|
Once we add an install generator with migrations, having an engine name
with a dash in it will cause the migration generation to fail, as
migrations will be created with the engine name in it, and dashes are
not allowed.
Co-authored-by: Nick Van Doorn <nick@super.gd>
|
|
Put plugin name in API request headers
|
|
To meet Taxjar's certification requirements, we need to supply a 'plugin'
name in each API request header. As such we add this header where the
API version header is supplied.
Co-authored-by: Noah Silvera <noah@super.gd>
|
|
Upcoming work to get this extension officially certified with Taxjar
will require the addition of UI components into the solidus backend.
Creating a rails engine for the new rails components of this extension
is a prerequisite to any UI work.
Co-authored-by: Nick Van Doorn <nick@super.gd>
Co-authored-by: Adam Mueller <adam@super.gd>
|
|
TaxJar requires certified extensions to include an API version in the
header of each request. This extensions wraps the official TaxJar Ruby
Gem with another API client, so we make sure the version gets set in
when our wrapper class is constructed.
Co-authored-by: Noah Silvera <noah@super.gd>
|
|
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
|
|
|
|
|
|
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.
|
|
|
|
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.
|
|
|
|
`APIParams#order_params` should use the `shipping_calculator` lambda
instead of a hardcoded value for providing shipping costs to TaxJar.
|
|
|
|
|
|
|
|
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.
|
|
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.
|
|
|
|
Much easier to trace a request by doing this.
|
|
|
|
This will log the params sent to and responses received from TaxJar in
order to facilitate debugging production issues.
|
|
|
|
|
|
|
|
|
|
This just uses the taxable order check configuration added in the parent
commit to provide a hook to short circuit order tax checks.
|
|
This will allow apps to use properties of an order to determine whether
an order is taxable.
|
|
|
|
This is required to support per-customer exemptions through the TaxJar
API.
|
|
|
|
I have a plan for how to handle these better in v1.0 though!
|
|
|
|
|
|
If an order is adjusted to zero, we don't want to subtract the tax from
it... because that don't make no sense.
A better solution that properly factors in order level adjustments will
be coming eventually, this is just a hack to process some orders
immediately.
|
|
|
|
|
|
|
|
Necessary if you need to factor in order level adjustments (boooooo)
into your shipping amounts to make things add up correctly.
|
|
|