Age | Commit message (Collapse) | Author |
|
We want to start syncing nexus data from TaxJar to this extension. As
such we start by implementing an API call to fetch nexus regions from
TaxJar.
Future commits should offer path for users to persist this data in their
Solidus store.
Co-authored-by: Noah Silvera <noah@super.gd>
Co-authored-by: Adnan Abdulally <adnan.abdulally@printivity.com>
|
|
In #34, we modified `.default_taxjar_client` to include the API version,
and then the name of the plugin, but we also introduced a critical bug.
`Taxjar::Client#set_api_config` returns a hash and not the TaxJar
client, so it is not safe to chain the method call. As such, we add a
spec to cover this case and patch the class method.
Co-authored-by: Noah Silvera <noah@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>
|
|
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>
|
|
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>
|
|
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.
|
|
|
|
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 will log the params sent to and responses received from TaxJar in
order to facilitate debugging production issues.
|
|
|
|
|
|
|
|
|
|
|
|
This removes the logic from the API class and moves all the calls to the
order_params method to our new module.
|
|
There's no reason for both the TaxCalculator and the API to have nearly
the same logic... so I unified that while was in there.
|
|
|
|
|
|
|
|
It's not necessary because we're sending line items.
|
|
|
|
|
|
I renamed this class to be less confusing.
|
|
This allows us to calculate the tax for a Solidus order using the TaxJar
API. It's currently hardcoded to use the sandbox, and provides no
caching.
|