Skip to content

Commit

Permalink
Merge pull request #180 from alejandropereira/fix-request-decorator
Browse files Browse the repository at this point in the history
fix: request decorator issue
  • Loading branch information
rafalcymerys authored Oct 21, 2023
2 parents 04ed66f + 7937939 commit b579675
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/models/avatax/request_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b579675

Please sign in to comment.