avatax 21.12.0 → 22.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +55 -55
- data/.rspec +1 -1
- data/.travis.yml +18 -18
- data/.vs/VSWorkspaceState.json +5 -5
- data/.yardopts +4 -4
- data/Gemfile +2 -2
- data/LICENSE +201 -201
- data/README.md +98 -98
- data/Rakefile +9 -9
- data/avatax.gemspec +38 -38
- data/example/avatax.rb +47 -47
- data/example/credentials.example.yaml +5 -5
- data/lib/avatax/api.rb +27 -27
- data/lib/avatax/client/accounts.rb +11 -11
- data/lib/avatax/client/addresses.rb +2 -2
- data/lib/avatax/client/advancedrules.rb +5 -5
- data/lib/avatax/client/avafileforms.rb +5 -5
- data/lib/avatax/client/batches.rb +8 -8
- data/lib/avatax/client/certexpressinvites.rb +3 -3
- data/lib/avatax/client/certificates.rb +15 -15
- data/lib/avatax/client/companies.rb +40 -21
- data/lib/avatax/client/compliance.rb +1 -1
- data/lib/avatax/client/contacts.rb +6 -6
- data/lib/avatax/client/customers.rb +13 -13
- data/lib/avatax/client/datasources.rb +6 -6
- data/lib/avatax/client/definitions.rb +70 -70
- data/lib/avatax/client/distancethresholds.rb +6 -6
- data/lib/avatax/client/ecms.rb +73 -73
- data/lib/avatax/client/ecommercetoken.rb +2 -2
- data/lib/avatax/client/errortransactions.rb +61 -61
- data/lib/avatax/client/filingcalendars.rb +3 -3
- data/lib/avatax/client/filings.rb +2 -2
- data/lib/avatax/client/firmclientlinkages.rb +9 -9
- data/lib/avatax/client/free.rb +1 -1
- data/lib/avatax/client/fundingrequests.rb +2 -2
- data/lib/avatax/client/items.rb +25 -25
- data/lib/avatax/client/jurisdictionoverrides.rb +6 -6
- data/lib/avatax/client/locations.rb +12 -12
- data/lib/avatax/client/multidocument.rb +10 -10
- data/lib/avatax/client/nexus.rb +15 -15
- data/lib/avatax/client/notices.rb +4 -4
- data/lib/avatax/client/notifications.rb +3 -3
- data/lib/avatax/client/onboarding.rb +55 -55
- data/lib/avatax/client/pointofsale.rb +21 -21
- data/lib/avatax/client/provisioning.rb +2 -2
- data/lib/avatax/client/registrar.rb +11 -11
- data/lib/avatax/client/reports.rb +4 -4
- data/lib/avatax/client/settings.rb +6 -6
- data/lib/avatax/client/subscriptions.rb +3 -3
- data/lib/avatax/client/taxcodes.rb +6 -6
- data/lib/avatax/client/taxcontent.rb +5 -5
- data/lib/avatax/client/taxprofiles.rb +42 -42
- data/lib/avatax/client/taxrules.rb +6 -6
- data/lib/avatax/client/transactions.rb +21 -21
- data/lib/avatax/client/upcs.rb +6 -6
- data/lib/avatax/client/userdefinedfields.rb +3 -3
- data/lib/avatax/client/users.rb +8 -8
- data/lib/avatax/client/utilities.rb +3 -3
- data/lib/avatax/client.rb +37 -37
- data/lib/avatax/configuration.rb +76 -76
- data/lib/avatax/connection.rb +49 -49
- data/lib/avatax/request.rb +50 -50
- data/lib/avatax/version.rb +3 -3
- data/lib/avatax.rb +26 -26
- data/spec/avatax/client/accounts_spec.rb +13 -13
- data/spec/avatax/client/transactions_spec.rb +80 -80
- data/spec/avatax/request_spec.rb +25 -25
- data/spec/avatax_spec.rb +45 -45
- data/spec/credentials.yaml.example +4 -4
- data/spec/fixtures/accounts.json +15 -15
- data/spec/spec_helper.rb +27 -27
- metadata +6 -13
@@ -35,7 +35,7 @@ module AvaTax
|
|
35
35
|
# @param model [Object] information about the transaction and lines to be added
|
36
36
|
# @return [Object]
|
37
37
|
def add_lines(model, options={}) path = "/api/v2/companies/transactions/lines/add"
|
38
|
-
post(path, model, options, "
|
38
|
+
post(path, model, options, "22.2.0") end
|
39
39
|
|
40
40
|
# Correct a previously created transaction
|
41
41
|
#
|
@@ -81,7 +81,7 @@ module AvaTax
|
|
81
81
|
# @param model [Object] The adjustment you wish to make
|
82
82
|
# @return [Object]
|
83
83
|
def adjust_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/adjust"
|
84
|
-
post(path, model, options, "
|
84
|
+
post(path, model, options, "22.2.0") end
|
85
85
|
|
86
86
|
# Get audit information about a transaction
|
87
87
|
#
|
@@ -118,7 +118,7 @@ module AvaTax
|
|
118
118
|
# @param transactionCode [String] The code identifying the transaction
|
119
119
|
# @return [Object]
|
120
120
|
def audit_transaction(companyCode, transactionCode) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/audit"
|
121
|
-
get(path, {}, "
|
121
|
+
get(path, {}, "22.2.0") end
|
122
122
|
|
123
123
|
# Get audit information about a transaction
|
124
124
|
#
|
@@ -156,7 +156,7 @@ module AvaTax
|
|
156
156
|
# @param documentType [String] The document type of the original transaction (See DocumentType::* for a list of allowable values)
|
157
157
|
# @return [Object]
|
158
158
|
def audit_transaction_with_type(companyCode, transactionCode, documentType) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/types/#{documentType}/audit"
|
159
|
-
get(path, {}, "
|
159
|
+
get(path, {}, "22.2.0") end
|
160
160
|
|
161
161
|
# Lock a set of documents
|
162
162
|
#
|
@@ -176,7 +176,7 @@ module AvaTax
|
|
176
176
|
# @param model [Object] bulk lock request
|
177
177
|
# @return [Object]
|
178
178
|
def bulk_lock_transaction(model) path = "/api/v2/transactions/lock"
|
179
|
-
post(path, model, {}, "
|
179
|
+
post(path, model, {}, "22.2.0") end
|
180
180
|
|
181
181
|
# Change a transaction's code
|
182
182
|
#
|
@@ -222,7 +222,7 @@ module AvaTax
|
|
222
222
|
# @param model [Object] The code change request you wish to execute
|
223
223
|
# @return [Object]
|
224
224
|
def change_transaction_code(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/changecode"
|
225
|
-
post(path, model, options, "
|
225
|
+
post(path, model, options, "22.2.0") end
|
226
226
|
|
227
227
|
# Commit a transaction for reporting
|
228
228
|
#
|
@@ -266,7 +266,7 @@ module AvaTax
|
|
266
266
|
# @param model [Object] The commit request you wish to execute
|
267
267
|
# @return [Object]
|
268
268
|
def commit_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/commit"
|
269
|
-
post(path, model, options, "
|
269
|
+
post(path, model, options, "22.2.0") end
|
270
270
|
|
271
271
|
# Create or adjust a transaction
|
272
272
|
#
|
@@ -313,7 +313,7 @@ module AvaTax
|
|
313
313
|
# @param model [Object] The transaction you wish to create or adjust
|
314
314
|
# @return [Object]
|
315
315
|
def create_or_adjust_transaction(model, options={}) path = "/api/v2/transactions/createoradjust"
|
316
|
-
post(path, model, options, "
|
316
|
+
post(path, model, options, "22.2.0") end
|
317
317
|
|
318
318
|
# Create a new transaction
|
319
319
|
#
|
@@ -367,7 +367,7 @@ module AvaTax
|
|
367
367
|
# @param model [Object] The transaction you wish to create
|
368
368
|
# @return [Object]
|
369
369
|
def create_transaction(model, options={}) path = "/api/v2/transactions/create"
|
370
|
-
post(path, model, options, "
|
370
|
+
post(path, model, options, "22.2.0") end
|
371
371
|
|
372
372
|
# Remove lines from an existing unlocked transaction
|
373
373
|
#
|
@@ -398,7 +398,7 @@ module AvaTax
|
|
398
398
|
# @param model [Object] information about the transaction and lines to be removed
|
399
399
|
# @return [Object]
|
400
400
|
def delete_lines(model, options={}) path = "/api/v2/companies/transactions/lines/delete"
|
401
|
-
post(path, model, options, "
|
401
|
+
post(path, model, options, "22.2.0") end
|
402
402
|
|
403
403
|
# Retrieve a single transaction by code
|
404
404
|
#
|
@@ -440,7 +440,7 @@ module AvaTax
|
|
440
440
|
# @param include [String] Specifies objects to include in this fetch call
|
441
441
|
# @return [Object]
|
442
442
|
def get_transaction_by_code(companyCode, transactionCode, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}"
|
443
|
-
get(path, options, "
|
443
|
+
get(path, options, "22.2.0") end
|
444
444
|
|
445
445
|
# Retrieve a single transaction by code
|
446
446
|
#
|
@@ -465,7 +465,7 @@ module AvaTax
|
|
465
465
|
# @param include [String] Specifies objects to include in this fetch call
|
466
466
|
# @return [Object]
|
467
467
|
def get_transaction_by_code_and_type(companyCode, transactionCode, documentType, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/types/#{documentType}"
|
468
|
-
get(path, options, "
|
468
|
+
get(path, options, "22.2.0") end
|
469
469
|
|
470
470
|
# Retrieve a single transaction by ID
|
471
471
|
#
|
@@ -496,7 +496,7 @@ module AvaTax
|
|
496
496
|
# @param include [String] Specifies objects to include in this fetch call
|
497
497
|
# @return [Object]
|
498
498
|
def get_transaction_by_id(id, options={}) path = "/api/v2/transactions/#{id}"
|
499
|
-
get(path, options, "
|
499
|
+
get(path, options, "22.2.0") end
|
500
500
|
|
501
501
|
# Retrieve all transactions
|
502
502
|
#
|
@@ -544,7 +544,7 @@ module AvaTax
|
|
544
544
|
# @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
|
545
545
|
# @return [FetchResult]
|
546
546
|
def list_transactions_by_company(companyCode, options={}) path = "/api/v2/companies/#{companyCode}/transactions"
|
547
|
-
get(path, options, "
|
547
|
+
get(path, options, "22.2.0") end
|
548
548
|
|
549
549
|
# Lock a single transaction
|
550
550
|
#
|
@@ -590,7 +590,7 @@ module AvaTax
|
|
590
590
|
# @param model [Object] The lock request you wish to execute
|
591
591
|
# @return [Object]
|
592
592
|
def lock_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/lock"
|
593
|
-
post(path, model, options, "
|
593
|
+
post(path, model, options, "22.2.0") end
|
594
594
|
|
595
595
|
# Create a refund for a transaction
|
596
596
|
#
|
@@ -647,7 +647,7 @@ module AvaTax
|
|
647
647
|
# @param model [Object] Information about the refund to create
|
648
648
|
# @return [Object]
|
649
649
|
def refund_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/refund"
|
650
|
-
post(path, model, options, "
|
650
|
+
post(path, model, options, "22.2.0") end
|
651
651
|
|
652
652
|
# Perform multiple actions on a transaction
|
653
653
|
#
|
@@ -691,7 +691,7 @@ module AvaTax
|
|
691
691
|
# @param model [Object] The data from an external system to reconcile against AvaTax
|
692
692
|
# @return [Object]
|
693
693
|
def settle_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/settle"
|
694
|
-
post(path, model, options, "
|
694
|
+
post(path, model, options, "22.2.0") end
|
695
695
|
|
696
696
|
# Uncommit a transaction for reporting
|
697
697
|
#
|
@@ -729,7 +729,7 @@ module AvaTax
|
|
729
729
|
# @param include [String] Specifies objects to include in this fetch call
|
730
730
|
# @return [Object]
|
731
731
|
def uncommit_transaction(companyCode, transactionCode, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/uncommit"
|
732
|
-
post(path, options, "
|
732
|
+
post(path, options, "22.2.0") end
|
733
733
|
|
734
734
|
# Unvoids a transaction
|
735
735
|
#
|
@@ -764,7 +764,7 @@ module AvaTax
|
|
764
764
|
# @param include [String] Specifies objects to include in this fetch call
|
765
765
|
# @return [Object]
|
766
766
|
def unvoid_transaction(companyCode, transactionCode, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/unvoid"
|
767
|
-
post(path, options, "
|
767
|
+
post(path, options, "22.2.0") end
|
768
768
|
|
769
769
|
# Verify a transaction
|
770
770
|
#
|
@@ -807,7 +807,7 @@ module AvaTax
|
|
807
807
|
# @param model [Object] The data from an external system to reconcile against AvaTax
|
808
808
|
# @return [Object]
|
809
809
|
def verify_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/verify"
|
810
|
-
post(path, model, options, "
|
810
|
+
post(path, model, options, "22.2.0") end
|
811
811
|
|
812
812
|
# Void a transaction
|
813
813
|
#
|
@@ -852,7 +852,7 @@ module AvaTax
|
|
852
852
|
# @param model [Object] The void request you wish to execute. To void a transaction the code must be set to 'DocVoided'
|
853
853
|
# @return [Object]
|
854
854
|
def void_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/void"
|
855
|
-
post(path, model, options, "
|
855
|
+
post(path, model, options, "22.2.0") end
|
856
856
|
end
|
857
857
|
end
|
858
858
|
end
|
data/lib/avatax/client/upcs.rb
CHANGED
@@ -17,7 +17,7 @@ module AvaTax
|
|
17
17
|
# @param model [UPCModel[]] The UPC you wish to create.
|
18
18
|
# @return [UPCModel[]]
|
19
19
|
def create_u_p_cs(companyId, model) path = "/api/v2/companies/#{companyId}/upcs"
|
20
|
-
post(path, model, {}, "
|
20
|
+
post(path, model, {}, "22.2.0") end
|
21
21
|
|
22
22
|
# Delete a single UPC
|
23
23
|
#
|
@@ -32,7 +32,7 @@ module AvaTax
|
|
32
32
|
# @param id [Integer] The ID of the UPC you wish to delete.
|
33
33
|
# @return [ErrorDetail[]]
|
34
34
|
def delete_u_p_c(companyId, id) path = "/api/v2/companies/#{companyId}/upcs/#{id}"
|
35
|
-
delete(path, {}, "
|
35
|
+
delete(path, {}, "22.2.0") end
|
36
36
|
|
37
37
|
# Retrieve a single UPC
|
38
38
|
#
|
@@ -48,7 +48,7 @@ module AvaTax
|
|
48
48
|
# @param id [Integer] The primary key of this UPC
|
49
49
|
# @return [Object]
|
50
50
|
def get_u_p_c(companyId, id) path = "/api/v2/companies/#{companyId}/upcs/#{id}"
|
51
|
-
get(path, {}, "
|
51
|
+
get(path, {}, "22.2.0") end
|
52
52
|
|
53
53
|
# Retrieve UPCs for this company
|
54
54
|
#
|
@@ -71,7 +71,7 @@ module AvaTax
|
|
71
71
|
# @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
|
72
72
|
# @return [FetchResult]
|
73
73
|
def list_u_p_cs_by_company(companyId, options={}) path = "/api/v2/companies/#{companyId}/upcs"
|
74
|
-
get(path, options, "
|
74
|
+
get(path, options, "22.2.0") end
|
75
75
|
|
76
76
|
# Retrieve all UPCs
|
77
77
|
#
|
@@ -93,7 +93,7 @@ module AvaTax
|
|
93
93
|
# @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
|
94
94
|
# @return [FetchResult]
|
95
95
|
def query_u_p_cs(options={}) path = "/api/v2/upcs"
|
96
|
-
get(path, options, "
|
96
|
+
get(path, options, "22.2.0") end
|
97
97
|
|
98
98
|
# Update a single UPC
|
99
99
|
#
|
@@ -112,7 +112,7 @@ module AvaTax
|
|
112
112
|
# @param model [Object] The UPC you wish to update.
|
113
113
|
# @return [Object]
|
114
114
|
def update_u_p_c(companyId, id, model) path = "/api/v2/companies/#{companyId}/upcs/#{id}"
|
115
|
-
put(path, model, {}, "
|
115
|
+
put(path, model, {}, "22.2.0") end
|
116
116
|
end
|
117
117
|
end
|
118
118
|
end
|
@@ -16,7 +16,7 @@ module AvaTax
|
|
16
16
|
# @param id [Integer] The id of the User Defined Field you wish to delete.
|
17
17
|
# @return [ErrorDetail[]]
|
18
18
|
def delete_user_defined_field(companyId, id) path = "/api/v2/companies/#{companyId}/userdefinedfields/#{id}"
|
19
|
-
delete(path, {}, "
|
19
|
+
delete(path, {}, "22.2.0") end
|
20
20
|
|
21
21
|
#
|
22
22
|
#
|
@@ -30,7 +30,7 @@ module AvaTax
|
|
30
30
|
# @param allowDefaults [Boolean] If true this will add defaulted UDFs to the list that are not named yet
|
31
31
|
# @return [FetchResult]
|
32
32
|
def list_user_defined_fields_by_company_id(companyId, options={}) path = "/api/v2/companies/#{companyId}/userdefinedfields"
|
33
|
-
get(path, options, "
|
33
|
+
get(path, options, "22.2.0") end
|
34
34
|
|
35
35
|
# Update a User Defined Field identified by id for a company
|
36
36
|
#
|
@@ -46,7 +46,7 @@ module AvaTax
|
|
46
46
|
# @param model [Object]
|
47
47
|
# @return [Object]
|
48
48
|
def update_user_defined_field(companyId, model, options={}) path = "/api/v2/companies/#{companyId}/userdefinedfields"
|
49
|
-
post(path, model, options, "
|
49
|
+
post(path, model, options, "22.2.0") end
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
data/lib/avatax/client/users.rb
CHANGED
@@ -20,7 +20,7 @@ module AvaTax
|
|
20
20
|
# @param model [Object] An object containing your current password and the new password.
|
21
21
|
# @return [String]
|
22
22
|
def change_password(model) path = "/api/v2/passwords"
|
23
|
-
put(path, model, {}, "
|
23
|
+
put(path, model, {}, "22.2.0") end
|
24
24
|
|
25
25
|
# Create new users
|
26
26
|
#
|
@@ -42,7 +42,7 @@ module AvaTax
|
|
42
42
|
# @param model [UserModel[]] The user or array of users you wish to create.
|
43
43
|
# @return [UserModel[]]
|
44
44
|
def create_users(accountId, model) path = "/api/v2/accounts/#{accountId}/users"
|
45
|
-
post(path, model, {}, "
|
45
|
+
post(path, model, {}, "22.2.0") end
|
46
46
|
|
47
47
|
# Delete a single user
|
48
48
|
#
|
@@ -61,7 +61,7 @@ module AvaTax
|
|
61
61
|
# @param accountId [Integer] The accountID of the user you wish to delete.
|
62
62
|
# @return [ErrorDetail[]]
|
63
63
|
def delete_user(id, accountId) path = "/api/v2/accounts/#{accountId}/users/#{id}"
|
64
|
-
delete(path, {}, "
|
64
|
+
delete(path, {}, "22.2.0") end
|
65
65
|
|
66
66
|
# Retrieve a single user
|
67
67
|
#
|
@@ -81,7 +81,7 @@ module AvaTax
|
|
81
81
|
# @param include [String] Optional fetch commands.
|
82
82
|
# @return [Object]
|
83
83
|
def get_user(id, accountId, options={}) path = "/api/v2/accounts/#{accountId}/users/#{id}"
|
84
|
-
get(path, options, "
|
84
|
+
get(path, options, "22.2.0") end
|
85
85
|
|
86
86
|
# Retrieve all entitlements for a single user
|
87
87
|
#
|
@@ -109,7 +109,7 @@ module AvaTax
|
|
109
109
|
# @param accountId [Integer] The accountID of the user you wish to get.
|
110
110
|
# @return [Object]
|
111
111
|
def get_user_entitlements(id, accountId) path = "/api/v2/accounts/#{accountId}/users/#{id}/entitlements"
|
112
|
-
get(path, {}, "
|
112
|
+
get(path, {}, "22.2.0") end
|
113
113
|
|
114
114
|
# Retrieve users for this account
|
115
115
|
#
|
@@ -138,7 +138,7 @@ module AvaTax
|
|
138
138
|
# @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
|
139
139
|
# @return [FetchResult]
|
140
140
|
def list_users_by_account(accountId, options={}) path = "/api/v2/accounts/#{accountId}/users"
|
141
|
-
get(path, options, "
|
141
|
+
get(path, options, "22.2.0") end
|
142
142
|
|
143
143
|
# Retrieve all users
|
144
144
|
#
|
@@ -168,7 +168,7 @@ module AvaTax
|
|
168
168
|
# @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
|
169
169
|
# @return [FetchResult]
|
170
170
|
def query_users(options={}) path = "/api/v2/users"
|
171
|
-
get(path, options, "
|
171
|
+
get(path, options, "22.2.0") end
|
172
172
|
|
173
173
|
# Update a single user
|
174
174
|
#
|
@@ -186,7 +186,7 @@ module AvaTax
|
|
186
186
|
# @param model [Object] The user object you wish to update.
|
187
187
|
# @return [Object]
|
188
188
|
def update_user(id, accountId, model) path = "/api/v2/accounts/#{accountId}/users/#{id}"
|
189
|
-
put(path, model, {}, "
|
189
|
+
put(path, model, {}, "22.2.0") end
|
190
190
|
end
|
191
191
|
end
|
192
192
|
end
|
@@ -17,7 +17,7 @@ module AvaTax
|
|
17
17
|
# @param serviceTypeId [String] The service to check
|
18
18
|
# @return [Object]
|
19
19
|
def get_my_subscription(serviceTypeId) path = "/api/v2/utilities/subscriptions/#{serviceTypeId}"
|
20
|
-
get(path, {}, "
|
20
|
+
get(path, {}, "22.2.0") end
|
21
21
|
|
22
22
|
# List all services to which the current user is subscribed
|
23
23
|
#
|
@@ -32,7 +32,7 @@ module AvaTax
|
|
32
32
|
# Swagger Name: AvaTaxClient
|
33
33
|
# @return [FetchResult]
|
34
34
|
def list_my_subscriptions() path = "/api/v2/utilities/subscriptions"
|
35
|
-
get(path, {}, "
|
35
|
+
get(path, {}, "22.2.0") end
|
36
36
|
|
37
37
|
# Tests connectivity and version of the service
|
38
38
|
#
|
@@ -59,7 +59,7 @@ module AvaTax
|
|
59
59
|
# Swagger Name: AvaTaxClient
|
60
60
|
# @return [Object]
|
61
61
|
def ping() path = "/api/v2/utilities/ping"
|
62
|
-
get(path, {}, "
|
62
|
+
get(path, {}, "22.2.0") end
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
data/lib/avatax/client.rb
CHANGED
@@ -1,37 +1,37 @@
|
|
1
|
-
module AvaTax
|
2
|
-
class Client < API
|
3
|
-
Dir[File.expand_path('../client/*.rb', __FILE__)].each{|f| require f}
|
4
|
-
|
5
|
-
include AvaTax::Client::Accounts
|
6
|
-
include AvaTax::Client::Addresses
|
7
|
-
include AvaTax::Client::Batches
|
8
|
-
include AvaTax::Client::CertExpressInvites
|
9
|
-
include AvaTax::Client::Companies
|
10
|
-
include AvaTax::Client::Contacts
|
11
|
-
include AvaTax::Client::Customers
|
12
|
-
include AvaTax::Client::Definitions
|
13
|
-
include AvaTax::Client::FilingCalendars
|
14
|
-
include AvaTax::Client::Filings
|
15
|
-
include AvaTax::Client::Free
|
16
|
-
include AvaTax::Client::FundingRequests
|
17
|
-
include AvaTax::Client::Items
|
18
|
-
include AvaTax::Client::JurisdictionOverrides
|
19
|
-
include AvaTax::Client::Locations
|
20
|
-
include AvaTax::Client::Nexus
|
21
|
-
include AvaTax::Client::Notices
|
22
|
-
include AvaTax::Client::Onboarding
|
23
|
-
include AvaTax::Client::PointOfSale
|
24
|
-
include AvaTax::Client::Registrar
|
25
|
-
include AvaTax::Client::Settings
|
26
|
-
include AvaTax::Client::Subscriptions
|
27
|
-
include AvaTax::Client::TaxCodes
|
28
|
-
include AvaTax::Client::TaxContent
|
29
|
-
include AvaTax::Client::TaxRules
|
30
|
-
include AvaTax::Client::Transactions
|
31
|
-
include AvaTax::Client::Upcs
|
32
|
-
include AvaTax::Client::Users
|
33
|
-
include AvaTax::Client::Utilities
|
34
|
-
include AvaTax::Client::ShippingVerification
|
35
|
-
include AvaTax::Client::AgeVerification
|
36
|
-
end
|
37
|
-
end
|
1
|
+
module AvaTax
|
2
|
+
class Client < API
|
3
|
+
Dir[File.expand_path('../client/*.rb', __FILE__)].each{|f| require f}
|
4
|
+
|
5
|
+
include AvaTax::Client::Accounts
|
6
|
+
include AvaTax::Client::Addresses
|
7
|
+
include AvaTax::Client::Batches
|
8
|
+
include AvaTax::Client::CertExpressInvites
|
9
|
+
include AvaTax::Client::Companies
|
10
|
+
include AvaTax::Client::Contacts
|
11
|
+
include AvaTax::Client::Customers
|
12
|
+
include AvaTax::Client::Definitions
|
13
|
+
include AvaTax::Client::FilingCalendars
|
14
|
+
include AvaTax::Client::Filings
|
15
|
+
include AvaTax::Client::Free
|
16
|
+
include AvaTax::Client::FundingRequests
|
17
|
+
include AvaTax::Client::Items
|
18
|
+
include AvaTax::Client::JurisdictionOverrides
|
19
|
+
include AvaTax::Client::Locations
|
20
|
+
include AvaTax::Client::Nexus
|
21
|
+
include AvaTax::Client::Notices
|
22
|
+
include AvaTax::Client::Onboarding
|
23
|
+
include AvaTax::Client::PointOfSale
|
24
|
+
include AvaTax::Client::Registrar
|
25
|
+
include AvaTax::Client::Settings
|
26
|
+
include AvaTax::Client::Subscriptions
|
27
|
+
include AvaTax::Client::TaxCodes
|
28
|
+
include AvaTax::Client::TaxContent
|
29
|
+
include AvaTax::Client::TaxRules
|
30
|
+
include AvaTax::Client::Transactions
|
31
|
+
include AvaTax::Client::Upcs
|
32
|
+
include AvaTax::Client::Users
|
33
|
+
include AvaTax::Client::Utilities
|
34
|
+
include AvaTax::Client::ShippingVerification
|
35
|
+
include AvaTax::Client::AgeVerification
|
36
|
+
end
|
37
|
+
end
|
data/lib/avatax/configuration.rb
CHANGED
@@ -1,76 +1,76 @@
|
|
1
|
-
require 'faraday'
|
2
|
-
require File.expand_path('../version', __FILE__)
|
3
|
-
|
4
|
-
module AvaTax
|
5
|
-
module Configuration
|
6
|
-
|
7
|
-
VALID_OPTIONS_KEYS = [
|
8
|
-
:app_name,
|
9
|
-
:app_version,
|
10
|
-
:machine_name,
|
11
|
-
:environment,
|
12
|
-
:endpoint,
|
13
|
-
:user_agent,
|
14
|
-
:username,
|
15
|
-
:password,
|
16
|
-
:connection_options,
|
17
|
-
:logger,
|
18
|
-
:custom_logger,
|
19
|
-
:custom_logger_options,
|
20
|
-
:proxy,
|
21
|
-
:faraday_response,
|
22
|
-
:response_big_decimal_conversion
|
23
|
-
].freeze
|
24
|
-
|
25
|
-
DEFAULT_APP_NAME = nil
|
26
|
-
DEFAULT_APP_VERSION = nil
|
27
|
-
DEFAULT_MACHINE_NAME = nil
|
28
|
-
DEFAULT_ENDPOINT = 'https://rest.avatax.com'
|
29
|
-
DEFAULT_USER_AGENT = "AvaTax Ruby Gem #{AvaTax::VERSION}".freeze
|
30
|
-
DEFAULT_USERNAME = nil
|
31
|
-
DEFAULT_PASSWORD = nil
|
32
|
-
DEFAULT_CONNECTION_OPTIONS = {request: {timeout: 1200}} # timeout in seconds
|
33
|
-
DEFAULT_LOGGER = false
|
34
|
-
DEFAULT_CUSTOM_LOGGER = nil
|
35
|
-
DEFAULT_CUSTOM_LOGGER_OPTIONS = {}
|
36
|
-
DEFAULT_PROXY = nil
|
37
|
-
DEFAULT_FARADAY_RESPONSE = false
|
38
|
-
DEFAULT_RESPONSE_BIG_DECIMAL_CONVERSION = false
|
39
|
-
|
40
|
-
attr_accessor *VALID_OPTIONS_KEYS
|
41
|
-
|
42
|
-
# Reset config values when extended
|
43
|
-
def self.extended(base)
|
44
|
-
base.reset
|
45
|
-
end
|
46
|
-
|
47
|
-
# Allow configuration options to be set in a block
|
48
|
-
def configure
|
49
|
-
yield self
|
50
|
-
end
|
51
|
-
|
52
|
-
def options
|
53
|
-
VALID_OPTIONS_KEYS.inject({}) do |option, key|
|
54
|
-
option.merge!(key => send(key))
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
def reset
|
59
|
-
self.app_name = DEFAULT_APP_NAME
|
60
|
-
self.app_version = DEFAULT_APP_VERSION
|
61
|
-
self.machine_name = DEFAULT_MACHINE_NAME
|
62
|
-
self.endpoint = DEFAULT_ENDPOINT
|
63
|
-
self.user_agent = DEFAULT_USER_AGENT
|
64
|
-
self.username = DEFAULT_USERNAME
|
65
|
-
self.password = DEFAULT_PASSWORD
|
66
|
-
self.connection_options = DEFAULT_CONNECTION_OPTIONS
|
67
|
-
self.logger = DEFAULT_LOGGER
|
68
|
-
self.custom_logger = DEFAULT_CUSTOM_LOGGER
|
69
|
-
self.custom_logger_options = DEFAULT_CUSTOM_LOGGER_OPTIONS
|
70
|
-
self.proxy = DEFAULT_PROXY
|
71
|
-
self.faraday_response = DEFAULT_FARADAY_RESPONSE
|
72
|
-
self.response_big_decimal_conversion = DEFAULT_RESPONSE_BIG_DECIMAL_CONVERSION
|
73
|
-
end
|
74
|
-
|
75
|
-
end
|
76
|
-
end
|
1
|
+
require 'faraday'
|
2
|
+
require File.expand_path('../version', __FILE__)
|
3
|
+
|
4
|
+
module AvaTax
|
5
|
+
module Configuration
|
6
|
+
|
7
|
+
VALID_OPTIONS_KEYS = [
|
8
|
+
:app_name,
|
9
|
+
:app_version,
|
10
|
+
:machine_name,
|
11
|
+
:environment,
|
12
|
+
:endpoint,
|
13
|
+
:user_agent,
|
14
|
+
:username,
|
15
|
+
:password,
|
16
|
+
:connection_options,
|
17
|
+
:logger,
|
18
|
+
:custom_logger,
|
19
|
+
:custom_logger_options,
|
20
|
+
:proxy,
|
21
|
+
:faraday_response,
|
22
|
+
:response_big_decimal_conversion
|
23
|
+
].freeze
|
24
|
+
|
25
|
+
DEFAULT_APP_NAME = nil
|
26
|
+
DEFAULT_APP_VERSION = nil
|
27
|
+
DEFAULT_MACHINE_NAME = nil
|
28
|
+
DEFAULT_ENDPOINT = 'https://rest.avatax.com'
|
29
|
+
DEFAULT_USER_AGENT = "AvaTax Ruby Gem #{AvaTax::VERSION}".freeze
|
30
|
+
DEFAULT_USERNAME = nil
|
31
|
+
DEFAULT_PASSWORD = nil
|
32
|
+
DEFAULT_CONNECTION_OPTIONS = {request: {timeout: 1200}} # timeout in seconds
|
33
|
+
DEFAULT_LOGGER = false
|
34
|
+
DEFAULT_CUSTOM_LOGGER = nil
|
35
|
+
DEFAULT_CUSTOM_LOGGER_OPTIONS = {}
|
36
|
+
DEFAULT_PROXY = nil
|
37
|
+
DEFAULT_FARADAY_RESPONSE = false
|
38
|
+
DEFAULT_RESPONSE_BIG_DECIMAL_CONVERSION = false
|
39
|
+
|
40
|
+
attr_accessor *VALID_OPTIONS_KEYS
|
41
|
+
|
42
|
+
# Reset config values when extended
|
43
|
+
def self.extended(base)
|
44
|
+
base.reset
|
45
|
+
end
|
46
|
+
|
47
|
+
# Allow configuration options to be set in a block
|
48
|
+
def configure
|
49
|
+
yield self
|
50
|
+
end
|
51
|
+
|
52
|
+
def options
|
53
|
+
VALID_OPTIONS_KEYS.inject({}) do |option, key|
|
54
|
+
option.merge!(key => send(key))
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def reset
|
59
|
+
self.app_name = DEFAULT_APP_NAME
|
60
|
+
self.app_version = DEFAULT_APP_VERSION
|
61
|
+
self.machine_name = DEFAULT_MACHINE_NAME
|
62
|
+
self.endpoint = DEFAULT_ENDPOINT
|
63
|
+
self.user_agent = DEFAULT_USER_AGENT
|
64
|
+
self.username = DEFAULT_USERNAME
|
65
|
+
self.password = DEFAULT_PASSWORD
|
66
|
+
self.connection_options = DEFAULT_CONNECTION_OPTIONS
|
67
|
+
self.logger = DEFAULT_LOGGER
|
68
|
+
self.custom_logger = DEFAULT_CUSTOM_LOGGER
|
69
|
+
self.custom_logger_options = DEFAULT_CUSTOM_LOGGER_OPTIONS
|
70
|
+
self.proxy = DEFAULT_PROXY
|
71
|
+
self.faraday_response = DEFAULT_FARADAY_RESPONSE
|
72
|
+
self.response_big_decimal_conversion = DEFAULT_RESPONSE_BIG_DECIMAL_CONVERSION
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
76
|
+
end
|