avatax 22.3.0 → 22.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/gem-push.yml +31 -0
  3. data/.gitignore +55 -55
  4. data/.rspec +1 -1
  5. data/.vs/VSWorkspaceState.json +5 -5
  6. data/.yardopts +4 -4
  7. data/Gemfile +2 -2
  8. data/LICENSE +201 -201
  9. data/README.md +98 -98
  10. data/Rakefile +9 -9
  11. data/avatax.gemspec +38 -38
  12. data/example/avatax.rb +47 -47
  13. data/example/credentials.example.yaml +5 -5
  14. data/lib/avatax/api.rb +27 -27
  15. data/lib/avatax/client/accounts.rb +22 -22
  16. data/lib/avatax/client/addresses.rb +4 -4
  17. data/lib/avatax/client/advancedrules.rb +5 -5
  18. data/lib/avatax/client/avafileforms.rb +7 -7
  19. data/lib/avatax/client/batches.rb +16 -16
  20. data/lib/avatax/client/certexpressinvites.rb +6 -6
  21. data/lib/avatax/client/certificates.rb +30 -30
  22. data/lib/avatax/client/companies.rb +47 -45
  23. data/lib/avatax/client/compliance.rb +1 -1
  24. data/lib/avatax/client/contacts.rb +12 -12
  25. data/lib/avatax/client/customers.rb +26 -26
  26. data/lib/avatax/client/datasources.rb +12 -12
  27. data/lib/avatax/client/definitions.rb +90 -75
  28. data/lib/avatax/client/distancethresholds.rb +12 -12
  29. data/lib/avatax/client/ecms.rb +73 -73
  30. data/lib/avatax/client/ecommercetoken.rb +4 -4
  31. data/lib/avatax/client/errortransactions.rb +61 -61
  32. data/lib/avatax/client/firmclientlinkages.rb +17 -17
  33. data/lib/avatax/client/free.rb +1 -1
  34. data/lib/avatax/client/fundingrequests.rb +10 -6
  35. data/lib/avatax/client/items.rb +86 -62
  36. data/lib/avatax/client/jurisdictionoverrides.rb +12 -12
  37. data/lib/avatax/client/locations.rb +24 -24
  38. data/lib/avatax/client/multidocument.rb +20 -20
  39. data/lib/avatax/client/nexus.rb +30 -30
  40. data/lib/avatax/client/notices.rb +8 -8
  41. data/lib/avatax/client/notifications.rb +6 -6
  42. data/lib/avatax/client/onboarding.rb +55 -55
  43. data/lib/avatax/client/pointofsale.rb +21 -21
  44. data/lib/avatax/client/provisioning.rb +4 -4
  45. data/lib/avatax/client/registrar.rb +20 -20
  46. data/lib/avatax/client/reports.rb +7 -7
  47. data/lib/avatax/client/settings.rb +12 -12
  48. data/lib/avatax/client/subscriptions.rb +6 -6
  49. data/lib/avatax/client/taxcodes.rb +12 -12
  50. data/lib/avatax/client/taxcontent.rb +8 -8
  51. data/lib/avatax/client/taxprofiles.rb +42 -42
  52. data/lib/avatax/client/taxrules.rb +12 -12
  53. data/lib/avatax/client/transactions.rb +41 -41
  54. data/lib/avatax/client/upcs.rb +12 -12
  55. data/lib/avatax/client/userdefinedfields.rb +6 -6
  56. data/lib/avatax/client/users.rb +16 -16
  57. data/lib/avatax/client/utilities.rb +3 -3
  58. data/lib/avatax/client.rb +37 -37
  59. data/lib/avatax/configuration.rb +76 -76
  60. data/lib/avatax/connection.rb +53 -49
  61. data/lib/avatax/request.rb +51 -51
  62. data/lib/avatax/version.rb +3 -3
  63. data/lib/avatax.rb +26 -26
  64. data/spec/avatax/client/accounts_spec.rb +13 -13
  65. data/spec/avatax/client/transactions_spec.rb +80 -80
  66. data/spec/avatax/request_spec.rb +25 -25
  67. data/spec/avatax_spec.rb +45 -45
  68. data/spec/credentials.yaml.example +4 -4
  69. data/spec/fixtures/accounts.json +15 -15
  70. data/spec/spec_helper.rb +27 -27
  71. metadata +6 -6
  72. data/.travis.yml +0 -19
@@ -1,80 +1,80 @@
1
- require File.expand_path('../../../spec_helper', __FILE__)
2
-
3
- describe AvaTax::Client do
4
-
5
- describe ".transactions" do
6
- before do
7
- @base_transaction = {
8
- type: 'SalesInvoice',
9
- companyCode: @company_code,
10
- date: '2017-06-05',
11
- customerCode: 'ABC',
12
- addresses: {
13
- ShipFrom: {
14
- line1: "123 Main Street",
15
- city: "Irvine",
16
- region: "CA",
17
- country: "US",
18
- postalCode: "92615"
19
- },
20
- ShipTo: {
21
- line1: "100 Market Street",
22
- city: "San Francisco",
23
- region: "CA",
24
- country: "US",
25
- postalCode: "94105"
26
- }
27
- },
28
- lines: [{amount: 100}]
29
- }
30
- end
31
-
32
- it "should create a transaction" do
33
- transaction = @client.create_transaction(@base_transaction)
34
- expect(transaction).to be_a Object
35
- expect(transaction["id"]).to be_a Integer
36
- expect(transaction["status"]).to eq "Saved"
37
- end
38
-
39
- end
40
-
41
-
42
- # Test the option of faraday_response, the returned response should be a type of Faraday response rather than Hashie
43
- describe ".transaction_with_faraday_response" do
44
- before do
45
- @client.faraday_response = true
46
- @base_transaction = {
47
- type: 'SalesInvoice',
48
- companyCode: @company_code,
49
- date: '2017-06-05',
50
- customerCode: 'ABC',
51
- addresses: {
52
- ShipFrom: {
53
- line1: "123 Main Street",
54
- city: "Irvine",
55
- region: "CA",
56
- country: "US",
57
- postalCode: "92615"
58
- },
59
- ShipTo: {
60
- line1: "100 Market Street",
61
- city: "San Francisco",
62
- region: "CA",
63
- country: "US",
64
- postalCode: "94105"
65
- }
66
- },
67
- lines: [{amount: 100}]
68
- }
69
- end
70
-
71
- it "should create a transaction and return the faraday response" do
72
- faraday_trans = @client.create_transaction(@base_transaction)
73
- expect(faraday_trans).to be_a Object
74
- expect(faraday_trans["status"]) == 201
75
- expect(faraday_trans["reason_phrase"]) == "Created"
76
- expect(faraday_trans["request_headers"]).to be_a Object
77
- expect(faraday_trans["body"]).to be_a Object
78
- end
79
- end
80
- end
1
+ require File.expand_path('../../../spec_helper', __FILE__)
2
+
3
+ describe AvaTax::Client do
4
+
5
+ describe ".transactions" do
6
+ before do
7
+ @base_transaction = {
8
+ type: 'SalesInvoice',
9
+ companyCode: @company_code,
10
+ date: '2017-06-05',
11
+ customerCode: 'ABC',
12
+ addresses: {
13
+ ShipFrom: {
14
+ line1: "123 Main Street",
15
+ city: "Irvine",
16
+ region: "CA",
17
+ country: "US",
18
+ postalCode: "92615"
19
+ },
20
+ ShipTo: {
21
+ line1: "100 Market Street",
22
+ city: "San Francisco",
23
+ region: "CA",
24
+ country: "US",
25
+ postalCode: "94105"
26
+ }
27
+ },
28
+ lines: [{amount: 100}]
29
+ }
30
+ end
31
+
32
+ it "should create a transaction" do
33
+ transaction = @client.create_transaction(@base_transaction)
34
+ expect(transaction).to be_a Object
35
+ expect(transaction["id"]).to be_a Integer
36
+ expect(transaction["status"]).to eq "Saved"
37
+ end
38
+
39
+ end
40
+
41
+
42
+ # Test the option of faraday_response, the returned response should be a type of Faraday response rather than Hashie
43
+ describe ".transaction_with_faraday_response" do
44
+ before do
45
+ @client.faraday_response = true
46
+ @base_transaction = {
47
+ type: 'SalesInvoice',
48
+ companyCode: @company_code,
49
+ date: '2017-06-05',
50
+ customerCode: 'ABC',
51
+ addresses: {
52
+ ShipFrom: {
53
+ line1: "123 Main Street",
54
+ city: "Irvine",
55
+ region: "CA",
56
+ country: "US",
57
+ postalCode: "92615"
58
+ },
59
+ ShipTo: {
60
+ line1: "100 Market Street",
61
+ city: "San Francisco",
62
+ region: "CA",
63
+ country: "US",
64
+ postalCode: "94105"
65
+ }
66
+ },
67
+ lines: [{amount: 100}]
68
+ }
69
+ end
70
+
71
+ it "should create a transaction and return the faraday response" do
72
+ faraday_trans = @client.create_transaction(@base_transaction)
73
+ expect(faraday_trans).to be_a Object
74
+ expect(faraday_trans["status"]) == 201
75
+ expect(faraday_trans["reason_phrase"]) == "Created"
76
+ expect(faraday_trans["request_headers"]).to be_a Object
77
+ expect(faraday_trans["body"]).to be_a Object
78
+ end
79
+ end
80
+ end
@@ -1,25 +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
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
data/spec/avatax_spec.rb CHANGED
@@ -1,45 +1,45 @@
1
- require File.expand_path('../spec_helper', __FILE__)
2
- if File.exist?(File.expand_path('../credentials.yaml', __FILE__))
3
- credentials = YAML.load_file(File.expand_path('../credentials.yaml', __FILE__))
4
- else
5
- credentials = {
6
- "endpoint" => 'https://sandbox-rest.avatax.com',
7
- "username" => ENV['SANDBOX_USERNAME'],
8
- "password" => ENV['SANDBOX_PASSWORD'],
9
- }
10
- end
11
-
12
- describe AvaTax do
13
-
14
- describe ".client" do
15
- it "should be a AvaTax::Client" do
16
- expect(AvaTax.client).to be_a AvaTax::Client
17
- end
18
- end
19
-
20
- describe ".endpoint" do
21
- it "should return the default endpoint" do
22
- expect(AvaTax.endpoint).to eq credentials['endpoint']
23
- end
24
- end
25
-
26
- describe ".endpoint=" do
27
- it "should set the endpoint" do
28
- AvaTax.endpoint = 'https://sandbox-rest.avatax.com'
29
- expect(AvaTax.endpoint).to eq 'https://sandbox-rest.avatax.com'
30
- end
31
- end
32
-
33
- describe ".configure" do
34
-
35
- AvaTax::Configuration::VALID_OPTIONS_KEYS.each do |key|
36
-
37
- it "should set the #{key}" do
38
- AvaTax.configure do |config|
39
- config.send("#{key}=", key)
40
- expect(AvaTax.send(key)).to eq key
41
- end
42
- end
43
- end
44
- end
45
- end
1
+ require File.expand_path('../spec_helper', __FILE__)
2
+ if File.exist?(File.expand_path('../credentials.yaml', __FILE__))
3
+ credentials = YAML.load_file(File.expand_path('../credentials.yaml', __FILE__))
4
+ else
5
+ credentials = {
6
+ "endpoint" => 'https://sandbox-rest.avatax.com',
7
+ "username" => ENV['SANDBOX_USERNAME'],
8
+ "password" => ENV['SANDBOX_PASSWORD'],
9
+ }
10
+ end
11
+
12
+ describe AvaTax do
13
+
14
+ describe ".client" do
15
+ it "should be a AvaTax::Client" do
16
+ expect(AvaTax.client).to be_a AvaTax::Client
17
+ end
18
+ end
19
+
20
+ describe ".endpoint" do
21
+ it "should return the default endpoint" do
22
+ expect(AvaTax.endpoint).to eq credentials['endpoint']
23
+ end
24
+ end
25
+
26
+ describe ".endpoint=" do
27
+ it "should set the endpoint" do
28
+ AvaTax.endpoint = 'https://sandbox-rest.avatax.com'
29
+ expect(AvaTax.endpoint).to eq 'https://sandbox-rest.avatax.com'
30
+ end
31
+ end
32
+
33
+ describe ".configure" do
34
+
35
+ AvaTax::Configuration::VALID_OPTIONS_KEYS.each do |key|
36
+
37
+ it "should set the #{key}" do
38
+ AvaTax.configure do |config|
39
+ config.send("#{key}=", key)
40
+ expect(AvaTax.send(key)).to eq key
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -1,4 +1,4 @@
1
- ---
2
- endpoint: https://sandbox-rest.avatax.com
3
- username: ---
4
- password: ---
1
+ ---
2
+ endpoint: https://sandbox-rest.avatax.com
3
+ username: ---
4
+ password: ---
@@ -1,16 +1,16 @@
1
- {
2
- "@recordsetCount": 1,
3
- "value": [
4
- {
5
- "id": 200000251,
6
- "name": "Avalara",
7
- "effectiveDate": "2015-11-05T00:00:00",
8
- "endDate": "2999-02-05T00:00:00",
9
- "accountStatusId": "Active",
10
- "createdDate": "2015-11-05T22:11:17.593",
11
- "createdUserId": 46103,
12
- "modifiedDate": "2017-01-10T18:55:36.193",
13
- "modifiedUserId": 54057
14
- }
15
- ]
1
+ {
2
+ "@recordsetCount": 1,
3
+ "value": [
4
+ {
5
+ "id": 200000251,
6
+ "name": "Avalara",
7
+ "effectiveDate": "2015-11-05T00:00:00",
8
+ "endDate": "2999-02-05T00:00:00",
9
+ "accountStatusId": "Active",
10
+ "createdDate": "2015-11-05T22:11:17.593",
11
+ "createdUserId": 46103,
12
+ "modifiedDate": "2017-01-10T18:55:36.193",
13
+ "modifiedUserId": 54057
14
+ }
15
+ ]
16
16
  }
data/spec/spec_helper.rb CHANGED
@@ -1,27 +1,27 @@
1
- require File.expand_path('../../lib/avatax', __FILE__)
2
- require 'rspec'
3
- require 'yaml'
4
-
5
-
6
- AvaTax.configure do |config|
7
- if File.exist?(File.expand_path('../credentials.yaml', __FILE__))
8
- credentials = YAML.load_file(File.expand_path('../credentials.yaml', __FILE__))
9
- config.endpoint = credentials['endpoint']
10
- config.username = credentials['username']
11
- config.password = credentials['password']
12
- else
13
- config.endpoint = 'https://sandbox-rest.avatax.com'
14
- config.username = ENV['SANDBOX_USERNAME']
15
- config.password = ENV['SANDBOX_PASSWORD']
16
- end
17
- end
18
-
19
- client = AvaTax::Client.new()
20
- companies = client.query_companies
21
-
22
- RSpec.configure do |config|
23
- config.before {
24
- @client = client
25
- @company_code = companies["value"][0]["companyCode"]
26
- }
27
- end
1
+ require File.expand_path('../../lib/avatax', __FILE__)
2
+ require 'rspec'
3
+ require 'yaml'
4
+
5
+
6
+ AvaTax.configure do |config|
7
+ if File.exist?(File.expand_path('../credentials.yaml', __FILE__))
8
+ credentials = YAML.load_file(File.expand_path('../credentials.yaml', __FILE__))
9
+ config.endpoint = credentials['endpoint']
10
+ config.username = credentials['username']
11
+ config.password = credentials['password']
12
+ else
13
+ config.endpoint = 'https://sandbox-rest.avatax.com'
14
+ config.username = ENV['SANDBOX_USERNAME']
15
+ config.password = ENV['SANDBOX_PASSWORD']
16
+ end
17
+ end
18
+
19
+ client = AvaTax::Client.new()
20
+ companies = client.query_companies
21
+
22
+ RSpec.configure do |config|
23
+ config.before {
24
+ @client = client
25
+ @company_code = companies["value"][0]["companyCode"]
26
+ }
27
+ 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: 22.3.0
4
+ version: 22.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcus Vorwaller
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-21 00:00:00.000000000 Z
11
+ date: 2022-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -101,9 +101,9 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
+ - ".github/workflows/gem-push.yml"
104
105
  - ".gitignore"
105
106
  - ".rspec"
106
- - ".travis.yml"
107
107
  - ".vs/AvaTax-REST-V2-Ruby-SDK/v15/.suo"
108
108
  - ".vs/VSWorkspaceState.json"
109
109
  - ".vs/slnx.sqlite"
@@ -209,8 +209,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  - !ruby/object:Gem::Version
210
210
  version: 2.0.0
211
211
  requirements: []
212
- rubygems_version: 3.2.22
213
- signing_key:
212
+ rubygems_version: 3.0.3.1
213
+ signing_key:
214
214
  specification_version: 4
215
215
  summary: Ruby wrapper for the AvaTax API
216
216
  test_files: []
data/.travis.yml DELETED
@@ -1,19 +0,0 @@
1
- language: ruby
2
- sudo: false
3
- rvm:
4
- - 2.4
5
- - 2.3
6
- - 2.2
7
- - 2.1
8
- jobs:
9
- include:
10
- - rvm: 2.4
11
- stage: "Deploy"
12
- deploy:
13
- provider: rubygems
14
- api_key:
15
- secure: VnQH+Ffony43CPwrJ9vBVQ+/4aHFNvlGbXSKZL9Elm2P/FKwgjycwNZ+QtPmKbA9bVUtUkPjK3phJYeL//cTv+asrBBWM/ptBCBWVYB+ICeDXCfhB7id2hcSIWy9xQ4/KdCJxgeD+gwF1Ce95XK7epZLkhcr1OpgNO+cqnA1KlZ7fkZDtFEkXtY8H40oZZ6d5G7S3s+yBUEGHoiAiD2Gj/6RfWqT8iKykT4TzBtQSzyUDVel5/dt3MG2o4kUMcF3IS+HU2fOv61mCBpCP8Y6uDSe14TWPtYrsyR+Y5E5g7OetOq3/JxMacxG7fSo6KYtkL6qYqULgc3YtUoAPyULg4nWHO1aixdBbEiD7WNlBiSeRkUgRxunNHNFwnasW1g1zrkYdcqwkROjPfXChwmFK5ZFho6PpuWpEijttNjbmjwC/IWb/7X04MPwm2tzs5pdVVBsm+Hb1dstxWsm5nLZ+xzFDDfcKqM9ktRUeeRF9SlpY/1eNdedf76IVMcZRRRPvRIJwW/zU7MPGfBqJv1AM74150X4tyGHA+OCV7aUAh9NeJegYhHfi8gFAItjQWo59ZsWXhXjwxRJwKOKTreEmmDlFrdQ7OP6uEBLy+d+4rQgxmQsB/+8TDKV0TH9bhITAqYmue9uu0Fb0mJkSaUMJ4rGl0zGM+58nIwQ2YmoeoY=
16
- gem: avatax
17
- on:
18
- tags: true
19
- branch: master