From f7a9ee1c939e2e1bb85e59b9dd1a32c751cfb492 Mon Sep 17 00:00:00 2001 From: Nicholas Van Doorn Date: Wed, 24 Feb 2021 14:51:18 -0800 Subject: Add nexus regions method to API 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 Co-authored-by: Adnan Abdulally --- lib/super_good/solidus_taxjar/api.rb | 4 ++++ spec/super_good/solidus_taxjar/api_spec.rb | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/lib/super_good/solidus_taxjar/api.rb b/lib/super_good/solidus_taxjar/api.rb index 096994b..715eb5c 100644 --- a/lib/super_good/solidus_taxjar/api.rb +++ b/lib/super_good/solidus_taxjar/api.rb @@ -55,6 +55,10 @@ module SuperGood taxjar_client.validate_address ApiParams.validate_address_params(spree_address) end + def nexus_regions + taxjar_client.nexus_regions + end + private attr_reader :taxjar_client diff --git a/spec/super_good/solidus_taxjar/api_spec.rb b/spec/super_good/solidus_taxjar/api_spec.rb index 94f214d..df46a11 100644 --- a/spec/super_good/solidus_taxjar/api_spec.rb +++ b/spec/super_good/solidus_taxjar/api_spec.rb @@ -202,4 +202,19 @@ RSpec.describe SuperGood::SolidusTaxjar::Api do it { is_expected.to eq({some_kind_of: "response"}) } end + + describe "#nexus_regions" do + subject { api.nexus_regions } + + let(:api) { described_class.new(taxjar_client: dummy_client) } + let(:dummy_client) { instance_double ::Taxjar::Client } + + before do + allow(dummy_client) + .to receive(:nexus_regions) + .and_return({some_kind_of: "response"}) + end + + it { is_expected.to eq({some_kind_of: "response"}) } + end end -- cgit v1.2.3 From e3bbd1d8d1da565cf204d7ab758056897465bf06 Mon Sep 17 00:00:00 2001 From: Nicholas Van Doorn Date: Mon, 22 Mar 2021 10:25:17 -0700 Subject: Update CHANGELOG.md Co-authored-by: Noah Silvera --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58a1c46..d953efa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,14 +2,16 @@ ## master -## v0.18.1 +- [#51](https://github.com/SuperGoodSoft/solidus_taxjar/pull/51) Add nexus regions method to API + +## v0.18.1 [#52](https://github.com/supergoodsoft/solidus_taxjar/pull/52) fixes a critical bug in the API class that was released in `v0.18.0`. Please upgrade. - [#47](https://github.com/SuperGoodSoft/solidus_taxjar/pull/47) Fixed bug in `validate_address_params` for addresses without a state - [#52](https://github.com/supergoodsoft/solidus_taxjar/pull/52) Fixed critical bug in API class -## ~~v0.18.0~~ +## ~~v0.18.0~~ `v0.18.0` was removed due to a regression in the API class that was fixed in [#52](https://github.com/SuperGoodSoft/solidus_taxjar/pull/52) and `v0.18.1` - [#21](https://github.com/SuperGoodSoft/solidus_taxjar/pull/21) Migrated project to `solidus_dev_support` -- cgit v1.2.3