avatax 20.12.1 → 21.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/avatax/client/advancedrules.rb +0 -10
- data/lib/avatax/client/definitions.rb +4 -4
- data/lib/avatax/client/free.rb +0 -73
- data/lib/avatax/client/nexus.rb +2 -2
- data/lib/avatax/client/reports.rb +9 -0
- data/lib/avatax/client/taxcontent.rb +63 -0
- data/lib/avatax/configuration.rb +1 -1
- data/lib/avatax/request.rb +0 -2
- data/lib/avatax/version.rb +1 -1
- data/spec/avatax/request_spec.rb +25 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a779b97acfcbecb8782c8f98309982313d1409cbb44f28d3ef65f396116e2c15
|
4
|
+
data.tar.gz: c491a1f18172047a20a1d4bfcdadafb05e077827402a4451d45aa9ef5cc63338
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98b845ac4ef06403f88ecf26fd0ba2d29547e6df6a8be1f3af2c494b5b4f6bae10fc1ef8bf655244636123497011f528d653f6648824704313a4e7193d1bb01d
|
7
|
+
data.tar.gz: dad022262512d018cba8963e3abde005460b159f86b0a41e678a06aded9b3598565512bef7eb0b17fc4be4e472a0f5a21af4e8a10e8bd9e140d94720bb227c6a
|
@@ -22,16 +22,6 @@ module AvaTax
|
|
22
22
|
def delete_lookup_file(accountId, id) path = "/api/v2/advancedrules/accounts/#{accountId}/lookupFiles/#{id}"
|
23
23
|
delete(path) end
|
24
24
|
|
25
|
-
# Get audit records by account id and date range.
|
26
|
-
#
|
27
|
-
#
|
28
|
-
# @param accountId [Integer] The ID of the account
|
29
|
-
# @param fromDate [String] Date
|
30
|
-
# @param toDate [String] Date
|
31
|
-
# @return [Object]
|
32
|
-
def get_audit_records(accountId, fromDate, toDate) path = "/api/v2/advancedrules/audits/accounts/#{accountId}/from/#{fromDate}/to/#{toDate}"
|
33
|
-
get(path) end
|
34
|
-
|
35
25
|
# Get the lookup files for a company
|
36
26
|
#
|
37
27
|
#
|
@@ -348,7 +348,7 @@ module AvaTax
|
|
348
348
|
# Returns the full list of all Avalara-supported nexus for all countries and regions.
|
349
349
|
#
|
350
350
|
# This API is intended to be useful if your user interface needs to display a selectable list of nexus.
|
351
|
-
# @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId, taxName, parameters
|
351
|
+
# @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId, taxName, parameters, taxableNexus
|
352
352
|
# @param top [Integer] If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records.
|
353
353
|
# @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
|
354
354
|
# @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
|
@@ -370,7 +370,7 @@ module AvaTax
|
|
370
370
|
# @param region [String] Name or ISO 3166 code identifying the region portion of the address. This field supports many different region identifiers: * Two and three character ISO 3166 region codes * Fully spelled out names of the region in ISO supported languages * Common alternative spellings for many regions For a full list of all supported codes and names, please see the Definitions API `ListRegions`.
|
371
371
|
# @param postalCode [String] The postal code or zip code portion of this address.
|
372
372
|
# @param country [String] Name or ISO 3166 code identifying the country portion of this address. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`.
|
373
|
-
# @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId, taxName, parameters
|
373
|
+
# @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId, taxName, parameters, taxableNexus
|
374
374
|
# @param top [Integer] If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records.
|
375
375
|
# @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
|
376
376
|
# @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
|
@@ -384,7 +384,7 @@ module AvaTax
|
|
384
384
|
#
|
385
385
|
# This API is intended to be useful if your user interface needs to display a selectable list of nexus filtered by country.
|
386
386
|
# @param country [String] The country in which you want to fetch the system nexus
|
387
|
-
# @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId, taxName, parameters
|
387
|
+
# @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId, taxName, parameters, taxableNexus
|
388
388
|
# @param top [Integer] If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records.
|
389
389
|
# @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
|
390
390
|
# @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
|
@@ -399,7 +399,7 @@ module AvaTax
|
|
399
399
|
# This API is intended to be useful if your user interface needs to display a selectable list of nexus filtered by country and region.
|
400
400
|
# @param country [String] The two-character ISO-3166 code for the country.
|
401
401
|
# @param region [String] The two or three character region code for the region.
|
402
|
-
# @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId, taxName, parameters
|
402
|
+
# @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId, taxName, parameters, taxableNexus
|
403
403
|
# @param top [Integer] If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records.
|
404
404
|
# @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
|
405
405
|
# @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
|
data/lib/avatax/client/free.rb
CHANGED
@@ -23,79 +23,6 @@ module AvaTax
|
|
23
23
|
# @return [Object]
|
24
24
|
def request_free_trial(model) path = "/api/v2/accounts/freetrials/request"
|
25
25
|
post(path, model) end
|
26
|
-
|
27
|
-
# FREE API - Sales tax rates for a specified address
|
28
|
-
#
|
29
|
-
# # Free-To-Use
|
30
|
-
#
|
31
|
-
# The TaxRates API is a free-to-use, no cost option for estimating sales tax rates.
|
32
|
-
# Any customer can request a free AvaTax account and make use of the TaxRates API.
|
33
|
-
#
|
34
|
-
# Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP
|
35
|
-
# response code 429 - `Too Many Requests`.
|
36
|
-
#
|
37
|
-
# This API assumes that you are selling general tangible personal property at a retail point-of-sale
|
38
|
-
# location in the United States only.
|
39
|
-
#
|
40
|
-
# For more powerful tax calculation, please consider upgrading to the `CreateTransaction` API,
|
41
|
-
# which supports features including, but not limited to:
|
42
|
-
#
|
43
|
-
# * Nexus declarations
|
44
|
-
# * Taxability based on product/service type
|
45
|
-
# * Sourcing rules affecting origin/destination states
|
46
|
-
# * Customers who are exempt from certain taxes
|
47
|
-
# * States that have dollar value thresholds for tax amounts
|
48
|
-
# * Refunds for products purchased on a different date
|
49
|
-
# * Detailed jurisdiction names and state assigned codes
|
50
|
-
# * And more!
|
51
|
-
#
|
52
|
-
# Please see [Estimating Tax with REST v2](http://developer.avalara.com/blog/2016/11/04/estimating-tax-with-rest-v2/)
|
53
|
-
# for information on how to upgrade to the full AvaTax CreateTransaction API.
|
54
|
-
# @param line1 [String] The street address of the location.
|
55
|
-
# @param line2 [String] The street address of the location.
|
56
|
-
# @param line3 [String] The street address of the location.
|
57
|
-
# @param city [String] The city name of the location.
|
58
|
-
# @param region [String] Name or ISO 3166 code identifying the region within the country. This field supports many different region identifiers: * Two and three character ISO 3166 region codes * Fully spelled out names of the region in ISO supported languages * Common alternative spellings for many regions For a full list of all supported codes and names, please see the Definitions API `ListRegions`.
|
59
|
-
# @param postalCode [String] The postal code of the location.
|
60
|
-
# @param country [String] Name or ISO 3166 code identifying the country. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`.
|
61
|
-
# @return [Object]
|
62
|
-
def tax_rates_by_address(options={}) path = "/api/v2/taxrates/byaddress"
|
63
|
-
get(path, options) end
|
64
|
-
|
65
|
-
# FREE API - Sales tax rates for a specified country and postal code. This API is only available for US postal codes.
|
66
|
-
#
|
67
|
-
# # Free-To-Use
|
68
|
-
#
|
69
|
-
# This API is only available for a US postal codes.
|
70
|
-
#
|
71
|
-
# The TaxRates API is a free-to-use, no cost option for estimating sales tax rates.
|
72
|
-
# Any customer can request a free AvaTax account and make use of the TaxRates API.
|
73
|
-
#
|
74
|
-
# Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP
|
75
|
-
# response code 429 - `Too Many Requests`.
|
76
|
-
#
|
77
|
-
# This API assumes that you are selling general tangible personal property at a retail point-of-sale
|
78
|
-
# location in the United States only.
|
79
|
-
#
|
80
|
-
# For more powerful tax calculation, please consider upgrading to the `CreateTransaction` API,
|
81
|
-
# which supports features including, but not limited to:
|
82
|
-
#
|
83
|
-
# * Nexus declarations
|
84
|
-
# * Taxability based on product/service type
|
85
|
-
# * Sourcing rules affecting origin/destination states
|
86
|
-
# * Customers who are exempt from certain taxes
|
87
|
-
# * States that have dollar value thresholds for tax amounts
|
88
|
-
# * Refunds for products purchased on a different date
|
89
|
-
# * Detailed jurisdiction names and state assigned codes
|
90
|
-
# * And more!
|
91
|
-
#
|
92
|
-
# Please see [Estimating Tax with REST v2](http://developer.avalara.com/blog/2016/11/04/estimating-tax-with-rest-v2/)
|
93
|
-
# for information on how to upgrade to the full AvaTax CreateTransaction API.
|
94
|
-
# @param country [String] Name or ISO 3166 code identifying the country. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`.
|
95
|
-
# @param postalCode [String] The postal code of the location.
|
96
|
-
# @return [Object]
|
97
|
-
def tax_rates_by_postal_code(options={}) path = "/api/v2/taxrates/bypostalcode"
|
98
|
-
get(path, options) end
|
99
26
|
end
|
100
27
|
end
|
101
28
|
end
|
data/lib/avatax/client/nexus.rb
CHANGED
@@ -225,7 +225,7 @@ module AvaTax
|
|
225
225
|
#
|
226
226
|
# * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
227
227
|
# @param companyId [Integer] The ID of the company that owns these nexus objects
|
228
|
-
# @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId, taxName, parameters
|
228
|
+
# @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId, taxName, parameters, taxableNexus
|
229
229
|
# @param include [String] A comma separated list of additional data to retrieve.
|
230
230
|
# @param top [Integer] If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records.
|
231
231
|
# @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
|
@@ -276,7 +276,7 @@ module AvaTax
|
|
276
276
|
# ### Security Policies
|
277
277
|
#
|
278
278
|
# * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
279
|
-
# @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId, taxName, parameters
|
279
|
+
# @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* streamlinedSalesTax, isSSTActive, taxAuthorityId, taxName, parameters, taxableNexus
|
280
280
|
# @param include [String] A comma separated list of additional data to retrieve.
|
281
281
|
# @param top [Integer] If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records.
|
282
282
|
# @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
|
@@ -60,6 +60,15 @@ module AvaTax
|
|
60
60
|
#
|
61
61
|
# The `ExportDocumentLine` report produces information about invoice lines recorded within your account.
|
62
62
|
#
|
63
|
+
# To split large reports into multiple smaller partitions, use the numberOfPartitions and partition properties on ExportDocumentLineModel.
|
64
|
+
#
|
65
|
+
# Example - split a report into three partitions
|
66
|
+
#
|
67
|
+
# * Follow the steps above with numberOfPartitions = 3 and partition = 0
|
68
|
+
# * Follow the steps above with numberOfPartitions = 3 and partition = 1
|
69
|
+
# * Follow the steps above with numberOfPartitions = 3 and partition = 2
|
70
|
+
# * Once all three reports are downloaded merge the files on the client side.
|
71
|
+
#
|
63
72
|
# ### Security Policies
|
64
73
|
#
|
65
74
|
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
@@ -129,6 +129,69 @@ module AvaTax
|
|
129
129
|
# @return [Object]
|
130
130
|
def download_tax_rates_by_zip_code(date, options={}) path = "/api/v2/taxratesbyzipcode/download/#{date}"
|
131
131
|
get(path, options) end
|
132
|
+
|
133
|
+
# Sales tax rates for a specified address
|
134
|
+
#
|
135
|
+
# Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP
|
136
|
+
# response code 429 - `Too Many Requests`.
|
137
|
+
#
|
138
|
+
# This API assumes that you are selling general tangible personal property at a retail point-of-sale
|
139
|
+
# location in the United States only.
|
140
|
+
#
|
141
|
+
# For more powerful tax calculation, please consider upgrading to the `CreateTransaction` API,
|
142
|
+
# which supports features including, but not limited to:
|
143
|
+
#
|
144
|
+
# * Nexus declarations
|
145
|
+
# * Taxability based on product/service type
|
146
|
+
# * Sourcing rules affecting origin/destination states
|
147
|
+
# * Customers who are exempt from certain taxes
|
148
|
+
# * States that have dollar value thresholds for tax amounts
|
149
|
+
# * Refunds for products purchased on a different date
|
150
|
+
# * Detailed jurisdiction names and state assigned codes
|
151
|
+
# * And more!
|
152
|
+
#
|
153
|
+
# Please see [Estimating Tax with REST v2](http://developer.avalara.com/blog/2016/11/04/estimating-tax-with-rest-v2/)
|
154
|
+
# for information on how to upgrade to the full AvaTax CreateTransaction API.
|
155
|
+
# @param line1 [String] The street address of the location.
|
156
|
+
# @param line2 [String] The street address of the location.
|
157
|
+
# @param line3 [String] The street address of the location.
|
158
|
+
# @param city [String] The city name of the location.
|
159
|
+
# @param region [String] Name or ISO 3166 code identifying the region within the country. This field supports many different region identifiers: * Two and three character ISO 3166 region codes * Fully spelled out names of the region in ISO supported languages * Common alternative spellings for many regions For a full list of all supported codes and names, please see the Definitions API `ListRegions`.
|
160
|
+
# @param postalCode [String] The postal code of the location.
|
161
|
+
# @param country [String] Name or ISO 3166 code identifying the country. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`.
|
162
|
+
# @return [Object]
|
163
|
+
def tax_rates_by_address(options={}) path = "/api/v2/taxrates/byaddress"
|
164
|
+
get(path, options) end
|
165
|
+
|
166
|
+
# Sales tax rates for a specified country and postal code. This API is only available for US postal codes.
|
167
|
+
#
|
168
|
+
# This API is only available for a US postal codes.
|
169
|
+
#
|
170
|
+
# Usage of this API is subject to rate limits. Users who exceed the rate limit will receive HTTP
|
171
|
+
# response code 429 - `Too Many Requests`.
|
172
|
+
#
|
173
|
+
# This API assumes that you are selling general tangible personal property at a retail point-of-sale
|
174
|
+
# location in the United States only.
|
175
|
+
#
|
176
|
+
# For more powerful tax calculation, please consider upgrading to the `CreateTransaction` API,
|
177
|
+
# which supports features including, but not limited to:
|
178
|
+
#
|
179
|
+
# * Nexus declarations
|
180
|
+
# * Taxability based on product/service type
|
181
|
+
# * Sourcing rules affecting origin/destination states
|
182
|
+
# * Customers who are exempt from certain taxes
|
183
|
+
# * States that have dollar value thresholds for tax amounts
|
184
|
+
# * Refunds for products purchased on a different date
|
185
|
+
# * Detailed jurisdiction names and state assigned codes
|
186
|
+
# * And more!
|
187
|
+
#
|
188
|
+
# Please see [Estimating Tax with REST v2](http://developer.avalara.com/blog/2016/11/04/estimating-tax-with-rest-v2/)
|
189
|
+
# for information on how to upgrade to the full AvaTax CreateTransaction API.
|
190
|
+
# @param country [String] Name or ISO 3166 code identifying the country. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`.
|
191
|
+
# @param postalCode [String] The postal code of the location.
|
192
|
+
# @return [Object]
|
193
|
+
def tax_rates_by_postal_code(options={}) path = "/api/v2/taxrates/bypostalcode"
|
194
|
+
get(path, options) end
|
132
195
|
end
|
133
196
|
end
|
134
197
|
end
|
data/lib/avatax/configuration.rb
CHANGED
@@ -29,7 +29,7 @@ module AvaTax
|
|
29
29
|
DEFAULT_USER_AGENT = "AvaTax Ruby Gem #{AvaTax::VERSION}".freeze
|
30
30
|
DEFAULT_USERNAME = nil
|
31
31
|
DEFAULT_PASSWORD = nil
|
32
|
-
DEFAULT_CONNECTION_OPTIONS = {}
|
32
|
+
DEFAULT_CONNECTION_OPTIONS = {request: {timeout: 1200}} # timeout in seconds
|
33
33
|
DEFAULT_LOGGER = false
|
34
34
|
DEFAULT_CUSTOM_LOGGER = nil
|
35
35
|
DEFAULT_CUSTOM_LOGGER_OPTIONS = {}
|
data/lib/avatax/request.rb
CHANGED
@@ -22,8 +22,6 @@ module AvaTax
|
|
22
22
|
|
23
23
|
def request(method, path, model, options={})
|
24
24
|
response = connection.send(method) do |request|
|
25
|
-
# timeout in seconds
|
26
|
-
request.options['timeout'] = 1200
|
27
25
|
case method
|
28
26
|
when :get, :delete
|
29
27
|
request.url("#{URI.encode(path)}?#{URI.encode_www_form(options)}")
|
data/lib/avatax/version.rb
CHANGED
@@ -0,0 +1,25 @@
|
|
1
|
+
require File.expand_path('../../spec_helper', __FILE__)
|
2
|
+
|
3
|
+
describe AvaTax::Request do
|
4
|
+
|
5
|
+
describe ".request" do
|
6
|
+
it "should default to a 1200 second timeout" do
|
7
|
+
@client.faraday_response = true
|
8
|
+
response = @client.request(:get, 'path', 'model')
|
9
|
+
expect(response.env.request['timeout']).to eq(1200)
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should allow setting a custom timeout" do
|
13
|
+
@client.faraday_response = true
|
14
|
+
@client.connection_options = {
|
15
|
+
request: {
|
16
|
+
open_timeout: 5,
|
17
|
+
timeout: 10
|
18
|
+
}
|
19
|
+
}
|
20
|
+
response = @client.request(:get, 'path', 'model')
|
21
|
+
expect(response.env.request['open_timeout']).to eq(5)
|
22
|
+
expect(response.env.request['timeout']).to eq(10)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
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:
|
4
|
+
version: 21.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcus Vorwaller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -170,6 +170,7 @@ files:
|
|
170
170
|
- lib/avatax/version.rb
|
171
171
|
- spec/avatax/client/accounts_spec.rb
|
172
172
|
- spec/avatax/client/transactions_spec.rb
|
173
|
+
- spec/avatax/request_spec.rb
|
173
174
|
- spec/avatax_spec.rb
|
174
175
|
- spec/credentials.yaml.example
|
175
176
|
- spec/fixtures/accounts.json
|