From 338d38d00a3e444aaeddc757e508d0f34d811209 Mon Sep 17 00:00:00 2001 From: Nicholas Van Doorn Date: Mon, 1 Feb 2021 16:57:32 -0800 Subject: Include API version in request headers 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 --- lib/super_good/solidus_taxjar/api.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/super_good/solidus_taxjar/api.rb') diff --git a/lib/super_good/solidus_taxjar/api.rb b/lib/super_good/solidus_taxjar/api.rb index 9a8ba90..a1d1af5 100644 --- a/lib/super_good/solidus_taxjar/api.rb +++ b/lib/super_good/solidus_taxjar/api.rb @@ -5,7 +5,9 @@ module SuperGood ::Taxjar::Client.new( 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' + }) end def initialize(taxjar_client: self.class.default_taxjar_client) -- cgit v1.2.3