avatax 17.7.0 → 17.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/avatax.gemspec +1 -0
- data/lib/avatax/client/transactions.rb +11 -11
- data/lib/avatax/connection.rb +22 -11
- data/lib/avatax/request.rb +2 -2
- data/lib/avatax/version.rb +1 -1
- data/spec/avatax_spec.rb +0 -2
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f91622695347c4040a71f175e5b217c4a90049a2
|
4
|
+
data.tar.gz: 4fdcbb988386306d7d8d1e4871fcc7b8a8cfdb01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd4cc8cefb18f556b6dbe8bf29375bed4da326c282bbfc74c4763b810b82a807836a9fa3daed3c445c1d18977f04f3cf91aae4c217a78f3d7705576ee86e43c3
|
7
|
+
data.tar.gz: fba6bea77a3fc36619eb1efe3accd0561137c0ff8655493e4f79f3a8c397c3b7b2e5467a0bd951dba7af104385c71a0bedc56e41f68086a074d7e148335d2528
|
data/avatax.gemspec
CHANGED
@@ -8,6 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.add_runtime_dependency('faraday_middleware', '>= 0.10')
|
9
9
|
s.add_runtime_dependency('multi_json', '>= 1.0.3')
|
10
10
|
s.add_runtime_dependency('hashie', '>= 3.0.0')
|
11
|
+
s.add_runtime_dependency('faraday_middleware-parse_oj', '~> 0.3.2')
|
11
12
|
s.authors = ["Marcus Vorwaller"]
|
12
13
|
s.description = %q{A Ruby wrapper for the AvaTax REST and Search APIs}
|
13
14
|
s.post_install_message =<<eos
|
@@ -26,9 +26,9 @@ module AvaTax
|
|
26
26
|
# @param include [String] A comma separated list of child objects to return underneath the primary object.
|
27
27
|
# @param model [Object] information about the transaction and lines to be added
|
28
28
|
# @return [Object]
|
29
|
-
def add_lines(model
|
29
|
+
def add_lines(model)
|
30
30
|
path = "/api/v2/companies/transactions/lines/add"
|
31
|
-
post(path, model
|
31
|
+
post(path, model)
|
32
32
|
end
|
33
33
|
|
34
34
|
|
@@ -181,9 +181,9 @@ module AvaTax
|
|
181
181
|
# @param include [String] A comma separated list of child objects to return underneath the primary object.
|
182
182
|
# @param model [Object] The transaction you wish to create
|
183
183
|
# @return [Object]
|
184
|
-
def create_or_adjust_transaction(model
|
184
|
+
def create_or_adjust_transaction(model)
|
185
185
|
path = "/api/v2/transactions/createoradjust"
|
186
|
-
post(path, model
|
186
|
+
post(path, model)
|
187
187
|
end
|
188
188
|
|
189
189
|
|
@@ -210,9 +210,9 @@ module AvaTax
|
|
210
210
|
# @param include [String] A comma separated list of child objects to return underneath the primary object.
|
211
211
|
# @param model [Object] The transaction you wish to create
|
212
212
|
# @return [Object]
|
213
|
-
def create_transaction(model
|
213
|
+
def create_transaction(model)
|
214
214
|
path = "/api/v2/transactions/create"
|
215
|
-
post(path, model
|
215
|
+
post(path, model)
|
216
216
|
end
|
217
217
|
|
218
218
|
|
@@ -236,9 +236,9 @@ module AvaTax
|
|
236
236
|
# @param include [String] A comma separated list of child objects to return underneath the primary object.
|
237
237
|
# @param model [Object] information about the transaction and lines to be removed
|
238
238
|
# @return [Object]
|
239
|
-
def delete_lines(model
|
239
|
+
def delete_lines(model)
|
240
240
|
path = "/api/v2/companies/transactions/lines/delete"
|
241
|
-
post(path, model
|
241
|
+
post(path, model)
|
242
242
|
end
|
243
243
|
|
244
244
|
|
@@ -379,9 +379,9 @@ module AvaTax
|
|
379
379
|
# @param include [String] A comma separated list of child objects to return underneath the primary object.
|
380
380
|
# @param model [Object] Information about the refund to create
|
381
381
|
# @return [Object]
|
382
|
-
def refund_transaction(companyCode, transactionCode, model
|
382
|
+
def refund_transaction(companyCode, transactionCode, model)
|
383
383
|
path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/refund"
|
384
|
-
post(path, model
|
384
|
+
post(path, model)
|
385
385
|
end
|
386
386
|
|
387
387
|
|
@@ -432,4 +432,4 @@ module AvaTax
|
|
432
432
|
|
433
433
|
end
|
434
434
|
end
|
435
|
-
end
|
435
|
+
end
|
data/lib/avatax/connection.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'faraday_middleware'
|
1
|
+
require 'faraday_middleware/parse_oj'
|
2
2
|
|
3
3
|
module AvaTax
|
4
4
|
|
@@ -6,23 +6,34 @@ module AvaTax
|
|
6
6
|
private
|
7
7
|
|
8
8
|
def connection
|
9
|
+
client_id = "#{app_name};#{app_version};RubySdk;#{AvaTax::VERSION.dup};#{machine_name}"
|
9
10
|
options = {
|
10
|
-
:headers =>
|
11
|
+
:headers =>
|
12
|
+
{
|
13
|
+
'Accept' => "application/json; charset=utf-8",
|
14
|
+
'User-Agent' => user_agent,
|
15
|
+
'X-Avalara-Client' => client_id
|
16
|
+
},
|
11
17
|
:url => endpoint,
|
12
18
|
:proxy => proxy,
|
13
19
|
}.merge(connection_options)
|
14
20
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
21
|
+
Faraday.new(options) do |faraday|
|
22
|
+
Oj.default_options = {
|
23
|
+
bigdecimal_load: :bigdecimal
|
24
|
+
}
|
25
|
+
|
26
|
+
faraday.response :oj, content_type: /\bjson$/
|
27
|
+
faraday.basic_auth(username, password)
|
28
|
+
|
29
|
+
if logger
|
30
|
+
faraday.response :logger do |logger|
|
31
|
+
logger.filter(/(Authorization\:\ \"Basic\ )(\w+)\=/, '\1[REMOVED]')
|
32
|
+
end
|
19
33
|
end
|
20
|
-
end
|
21
|
-
c.use Faraday::Request::UrlEncoded
|
22
|
-
c.use Faraday::Response::ParseJson
|
23
|
-
c.basic_auth(username, password)
|
24
34
|
|
25
|
-
|
35
|
+
faraday.adapter Faraday.default_adapter
|
36
|
+
end
|
26
37
|
end
|
27
38
|
end
|
28
39
|
end
|
data/lib/avatax/request.rb
CHANGED
@@ -26,8 +26,8 @@ module AvaTax
|
|
26
26
|
request.url(URI.encode(path), options)
|
27
27
|
when :post, :put
|
28
28
|
request.path = URI.encode(path)
|
29
|
-
|
30
|
-
request.body = options unless options.empty?
|
29
|
+
request.headers['Content-Type'] = 'application/json'
|
30
|
+
request.body = options.to_json unless options.empty?
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
data/lib/avatax/version.rb
CHANGED
data/spec/avatax_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avatax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 17.7.
|
4
|
+
version: 17.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcus Vorwaller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 3.0.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: faraday_middleware-parse_oj
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.3.2
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.3.2
|
111
125
|
description: A Ruby wrapper for the AvaTax REST and Search APIs
|
112
126
|
email:
|
113
127
|
- marcus.vorwaller@avalara.com
|