diff --git a/app/models/avatax/request_decorator.rb b/app/models/avatax/request_decorator.rb index 924c8daf..cac7ba50 100644 --- a/app/models/avatax/request_decorator.rb +++ b/app/models/avatax/request_decorator.rb @@ -2,10 +2,12 @@ module Avatax module RequestDecorator include ::SpreeAvataxOfficial::HttpHelper - def request(method, path, model, options = {}) + def request(method, path, model, options = {}, apiversion="", headers=Hash.new) max_retries ||= ::SpreeAvataxOfficial::Config.max_retries uri_encoded_path = URI.parse(path).to_s response = connection.send(method) do |request| + request.headers['X-Avalara-Client'] = request.headers['X-Avalara-Client'].gsub("API_VERSION", apiversion) + request.headers=request.headers.merge(headers) unless headers.empty? request.options['timeout'] ||= 1_200 case method when :get, :delete