Skip to content

Commit a411ca8

Browse files
Fixes for AVS and DEVPORT-764
1 parent 8b6ac97 commit a411ca8

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

lib/avatax/client.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,7 @@ class Client < API
3131
include AvaTax::Client::Upcs
3232
include AvaTax::Client::Users
3333
include AvaTax::Client::Utilities
34+
include AvaTax::Client::ShippingVerification
35+
include AvaTax::Client::AgeVerification
3436
end
3537
end

lib/avatax/connection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module Connection
88
REMOVED_LABEL = '\1[REMOVED]'
99

1010
def connection
11-
client_id = "#{app_name};#{app_version};RubySdk;#{AvaTax::VERSION.dup};#{machine_name}"
11+
client_id = "#{app_name};#{app_version};RubySdk;API_VERSION;#{machine_name}"
1212
options = {
1313
:headers =>
1414
{

lib/avatax/request.rb

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,25 @@
66
module AvaTax
77
module Request
88

9-
def get(path, options={})
10-
request(:get, path, nil, options)
9+
def get(path, options={}, apiversion="")
10+
request(:get, path, nil, options, apiversion)
1111
end
1212

13-
def post(path, model, options={})
14-
request(:post, path, model, options)
13+
def post(path, model, options={}, apiversion="")
14+
request(:post, path, model, options, apiversion)
1515
end
1616

17-
def put(path, model, options={})
18-
request(:put, path, model, options)
17+
def put(path, model, options={}, apiversion="")
18+
request(:put, path, model, options, apiversion)
1919
end
2020

21-
def delete(path, options={})
22-
request(:delete, path, nil, options)
21+
def delete(path, options={}, apiversion="")
22+
request(:delete, path, nil, options, apiversion)
2323
end
2424

25-
def request(method, path, model, options={})
25+
def request(method, path, model, options={}, apiversion="")
2626
response = connection.send(method) do |request|
27+
request.headers['X-Avalara-Client'] = request.headers['X-Avalara-Client'].gsub("API_VERSION", apiversion)
2728
case method
2829
when :get, :delete
2930
request.url("#{encode_path(path)}?#{URI.encode_www_form(options)}")

0 commit comments

Comments
 (0)