summaryrefslogtreecommitdiff
path: root/lib/super_good/solidus_taxjar/api.rb
AgeCommit message (Collapse)Author
2021-03-25Add nexus regions method to APINicholas Van Doorn
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>
2021-03-24Fix `.default_taxjar_client`Nicholas Van Doorn
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>
2021-03-17Rename classes that have API in their name to ApiAdnan Abdulally
This done so Zeitwerk can correctly can correctly load the class from the filename. Co-authored-by: Nick Van Doorn <nick@super.gd>
2021-03-17Rename module SolidusTaxJar to SolidusTaxjarAdnan Abdulally
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>
2021-02-24Put plugin name in API request headersNicholas Van Doorn
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>
2021-02-08Include API version in request headersNicholas Van Doorn
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>
2020-07-14Add API call to validate addressesJared Norman
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.
2020-07-14Run project through standardrbJared Norman
2020-01-14Add SolidusTaxJar::API#tax_rate_forandrea longhi
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.
2019-06-25Add loggingJared Norman
This will log the params sent to and responses received from TaxJar in order to facilitate debugging production issues.
2019-01-31Add ability to create refundsJared Norman
2019-01-30Add support for deleting order transactionsJared Norman
2019-01-30Add support for updating order transactionsJared Norman
2019-01-30Add ability to create order transactionsJared Norman
2019-01-30Extract address lookup params as wellJared Norman
2019-01-30Integrate APIParams classJared Norman
This removes the logic from the API class and moves all the calls to the order_params method to our new module.
2019-01-28Use DiscountCalculator and fix duplicationJared Norman
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.
2019-01-23Add support for fetching tax rates by locationJared Norman
2019-01-22Use promo total instead of adjustment totalJared Norman
2019-01-22Make API URL configurableJared Norman
2019-01-20Don't send amountJared Norman
It's not necessary because we're sending line items.
2019-01-10Use tax_address rather than ship_addressJared Norman
2019-01-09Rename methodJared Norman
2019-01-09Fix stale class name referenceJared Norman
I renamed this class to be less confusing.
2019-01-09Communicate with TaxJar APIJared Norman
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.