diff options
author | Nicholas Van Doorn <vandoorn.nick@gmail.com> | 2021-02-01 16:57:32 -0800 |
---|---|---|
committer | Nicholas Van Doorn <vandoorn.nick@gmail.com> | 2021-02-08 15:10:34 -0800 |
commit | 338d38d00a3e444aaeddc757e508d0f34d811209 (patch) | |
tree | 14c1f3a3d59ec9df9eb7b601cbe146bf14ad3e2a /lib/super_good/solidus_taxjar/api.rb | |
parent | b8e1db2f128312b7d2a6923c2fe2424df70385c2 (diff) |
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 <noah@super.gd>
Diffstat (limited to 'lib/super_good/solidus_taxjar/api.rb')
-rw-r--r-- | lib/super_good/solidus_taxjar/api.rb | 4 |
1 files changed, 3 insertions, 1 deletions
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) |