summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/super_good/solidus_taxjar/api.rb3
-rw-r--r--spec/super_good/solidus_taxjar/api_spec.rb5
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/super_good/solidus_taxjar/api.rb b/lib/super_good/solidus_taxjar/api.rb
index a1d1af5..5c6ab3e 100644
--- a/lib/super_good/solidus_taxjar/api.rb
+++ b/lib/super_good/solidus_taxjar/api.rb
@@ -6,7 +6,8 @@ module SuperGood
api_key: ENV.fetch("TAXJAR_API_KEY"),
api_url: ENV.fetch("TAXJAR_API_URL") { "https://api.taxjar.com" } # Sandbox URL: https://api.sandbox.taxjar.com
).set_api_config('headers', {
- 'x-api-version' => '2020-08-07'
+ 'x-api-version' => '2020-08-07',
+ 'plugin' => 'supergoodsolidustaxjar'
})
end
diff --git a/spec/super_good/solidus_taxjar/api_spec.rb b/spec/super_good/solidus_taxjar/api_spec.rb
index 0244536..ed97df0 100644
--- a/spec/super_good/solidus_taxjar/api_spec.rb
+++ b/spec/super_good/solidus_taxjar/api_spec.rb
@@ -10,9 +10,10 @@ RSpec.describe SuperGood::SolidusTaxJar::API do
ENV["TAXJAR_API_KEY"] = 'taxjar_api_token'
end
- it "puts the API version in the header" do
+ it "sets the correct headers" do
expect_any_instance_of(::Taxjar::Client).to receive(:set_api_config).with('headers', {
- 'x-api-version' => '2020-08-07'
+ 'x-api-version' => '2020-08-07',
+ 'plugin' => 'supergoodsolidustaxjar'
})
subject
end