avatax 21.8.0 → 22.2.0

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.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +55 -55
  3. data/.rspec +1 -1
  4. data/.travis.yml +18 -18
  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 +94 -83
  16. data/lib/avatax/client/addresses.rb +22 -20
  17. data/lib/avatax/client/advancedrules.rb +46 -41
  18. data/lib/avatax/client/ageverification.rb +29 -0
  19. data/lib/avatax/client/avafileforms.rb +46 -41
  20. data/lib/avatax/client/batches.rb +70 -62
  21. data/lib/avatax/client/certexpressinvites.rb +30 -27
  22. data/lib/avatax/client/certificates.rb +126 -111
  23. data/lib/avatax/client/companies.rb +192 -152
  24. data/lib/avatax/client/compliance.rb +25 -14
  25. data/lib/avatax/client/contacts.rb +54 -48
  26. data/lib/avatax/client/customers.rb +110 -97
  27. data/lib/avatax/client/datasources.rb +54 -48
  28. data/lib/avatax/client/definitions.rb +620 -446
  29. data/lib/avatax/client/distancethresholds.rb +54 -48
  30. data/lib/avatax/client/ecms.rb +73 -73
  31. data/lib/avatax/client/ecommercetoken.rb +20 -18
  32. data/lib/avatax/client/errortransactions.rb +61 -61
  33. data/lib/avatax/client/filingcalendars.rb +44 -20
  34. data/lib/avatax/client/filings.rb +24 -20
  35. data/lib/avatax/client/firmclientlinkages.rb +78 -69
  36. data/lib/avatax/client/free.rb +14 -13
  37. data/lib/avatax/client/fundingrequests.rb +22 -20
  38. data/lib/avatax/client/items.rb +206 -181
  39. data/lib/avatax/client/jurisdictionoverrides.rb +54 -48
  40. data/lib/avatax/client/locations.rb +102 -90
  41. data/lib/avatax/client/multidocument.rb +86 -76
  42. data/lib/avatax/client/nexus.rb +146 -103
  43. data/lib/avatax/client/notices.rb +30 -26
  44. data/lib/avatax/client/notifications.rb +30 -27
  45. data/lib/avatax/client/onboarding.rb +55 -55
  46. data/lib/avatax/client/pointofsale.rb +21 -21
  47. data/lib/avatax/client/provisioning.rb +22 -20
  48. data/lib/avatax/client/registrar.rb +94 -83
  49. data/lib/avatax/client/reports.rb +38 -34
  50. data/lib/avatax/client/settings.rb +54 -48
  51. data/lib/avatax/client/shippingverification.rb +66 -0
  52. data/lib/avatax/client/subscriptions.rb +30 -27
  53. data/lib/avatax/client/taxcodes.rb +54 -48
  54. data/lib/avatax/client/taxcontent.rb +46 -41
  55. data/lib/avatax/client/taxprofiles.rb +42 -42
  56. data/lib/avatax/client/taxrules.rb +56 -50
  57. data/lib/avatax/client/transactions.rb +174 -153
  58. data/lib/avatax/client/upcs.rb +54 -48
  59. data/lib/avatax/client/userdefinedfields.rb +52 -0
  60. data/lib/avatax/client/users.rb +70 -62
  61. data/lib/avatax/client/utilities.rb +30 -27
  62. data/lib/avatax/client.rb +37 -35
  63. data/lib/avatax/configuration.rb +76 -76
  64. data/lib/avatax/connection.rb +49 -49
  65. data/lib/avatax/request.rb +51 -42
  66. data/lib/avatax/version.rb +3 -3
  67. data/lib/avatax.rb +26 -26
  68. data/spec/avatax/client/accounts_spec.rb +13 -13
  69. data/spec/avatax/client/transactions_spec.rb +80 -80
  70. data/spec/avatax/request_spec.rb +25 -25
  71. data/spec/avatax_spec.rb +45 -45
  72. data/spec/credentials.yaml.example +4 -4
  73. data/spec/fixtures/accounts.json +15 -15
  74. data/spec/spec_helper.rb +27 -27
  75. metadata +9 -13
data/README.md CHANGED
@@ -1,98 +1,98 @@
1
- The AvaTax Ruby Gem
2
- ====================
3
- A Ruby wrapper for the AvaTax REST V2 APIs
4
-
5
- Installation
6
- ------------
7
- gem install avatax
8
-
9
- Simple Code Example
10
- -------------------------
11
- ```ruby
12
- @client = AvaTax::Client.new(:logger => true)
13
-
14
- createTransactionModel = {
15
- "type" => 'SalesInvoice',
16
- "companyCode" => '12670',
17
- "date" => '2017-06-05',
18
- "customerCode" => 'ABC',
19
- "addresses" => {
20
- "ShipFrom" => {
21
- "line1" => "123 Main Street",
22
- "city" => "Irvine",
23
- "region" => "CA",
24
- "country" => "US",
25
- "postalCode" => "92615"
26
- },
27
- "ShipTo" => {
28
- "line1" => "100 Market Street",
29
- "city" => "San Francisco",
30
- "region" => "CA",
31
- "country" => "US",
32
- "postalCode" => "94105"
33
- }
34
- },
35
- "lines" => [ { "amount" => 100 }]
36
- }
37
-
38
- transaction = @client.create_transaction(createTransactionModel)
39
- ```
40
-
41
- If you'd like to see a more complete code example with credentials, check out our [example folder](/example).
42
-
43
- AvaTax REST and Search APIs
44
- ------------------------------
45
- Our [developer site](https://developer.avalara.com/) documents all the AvaTax REST and other APIs. Subscribe to the [RSS feed](developer.avalara.com/feed.xml) to stay up to date on the lates news and announcements.
46
-
47
- [API docs](http://www.rubydoc.info/github/avadev/AvaTax-REST-V2-Ruby-SDK/)
48
-
49
- Blog
50
- ----------------------------
51
- The [Developer Blog](https://developer.avalara.com/blog/) features news and important announcements about the AvaTax Platform and SDKs. You will also find tutorials and best practices to help you build great platform integrations.
52
-
53
- Contributing
54
- ------------
55
- In the spirit of [free software](http://www.fsf.org/licensing/essays/free-sw.html), **everyone** is encouraged to help improve this project.
56
-
57
- Here are some ways *you* can contribute:
58
-
59
- * by using alpha, beta, and prerelease versions
60
- * by reporting bugs
61
- * by suggesting new features
62
- * by writing or editing documentation
63
- * by writing specifications
64
- * by writing code (**no patch is too small**: fix typos, add comments, clean up inconsistent whitespace)
65
- * by refactoring code
66
- * by closing [issues](https://github.com/avadev/AvaTax-REST-V2-Ruby-SDK/issues)
67
- * by reviewing patches
68
-
69
-
70
- Submitting an Issue
71
- -------------------
72
- We use the [GitHub issue tracker](https://github.com/avadev/AvaTax-REST-V2-Ruby-SDK/issues) to track bugs and
73
- features. Before submitting a bug report or feature request, check to make sure it hasn't already
74
- been submitted. You can indicate support for an existing issue by voting it up. When submitting a
75
- bug report, please include a [Gist](http://gist.github.com/) that includes a stack trace and any
76
- details that may be necessary to reproduce the bug, including your gem version, Ruby version, and
77
- operating system. Ideally, a bug report should include a pull request with failing specs.
78
-
79
- Submitting a Pull Request
80
- -------------------------
81
- 1. Fork the project.
82
- 2. Create a topic branch.
83
- 3. Implement your feature or bug fix.
84
- 4. Add documentation for your feature or bug fix.
85
- 5. Run <tt>rake doc:yard</tt>. If your changes are not 100% documented, go back to step 4.
86
- 6. Add specs for your feature or bug fix.
87
- 7. Commit and push your changes.
88
- 8. Submit a pull request. Please do not include changes to the gemspec, version, or history file. (If you want to create your own version for some reason, please do so in a separate commit.)
89
-
90
- Build Status
91
- ------------
92
- [![Build Status](https://travis-ci.org/avadev/AvaTax-REST-V2-Ruby-SDK.svg?branch=master)](https://travis-ci.org/avadev/AvaTax-REST-V2-Ruby-SDK)
93
-
94
- Copyright
95
- ---------
96
- Copyright (c) 2017, Avalara, Inc. All rights reserved.
97
- By contributing to AvaTax Ruby Gem, you agree that your contributions will be licensed under its Apache License.
98
- See [LICENSE](https://github.com/avadev/AvaTax-REST-V2-Ruby-SDK/) for details.
1
+ The AvaTax Ruby Gem
2
+ ====================
3
+ A Ruby wrapper for the AvaTax REST V2 APIs
4
+
5
+ Installation
6
+ ------------
7
+ gem install avatax
8
+
9
+ Simple Code Example
10
+ -------------------------
11
+ ```ruby
12
+ @client = AvaTax::Client.new(:logger => true)
13
+
14
+ createTransactionModel = {
15
+ "type" => 'SalesInvoice',
16
+ "companyCode" => '12670',
17
+ "date" => '2017-06-05',
18
+ "customerCode" => 'ABC',
19
+ "addresses" => {
20
+ "ShipFrom" => {
21
+ "line1" => "123 Main Street",
22
+ "city" => "Irvine",
23
+ "region" => "CA",
24
+ "country" => "US",
25
+ "postalCode" => "92615"
26
+ },
27
+ "ShipTo" => {
28
+ "line1" => "100 Market Street",
29
+ "city" => "San Francisco",
30
+ "region" => "CA",
31
+ "country" => "US",
32
+ "postalCode" => "94105"
33
+ }
34
+ },
35
+ "lines" => [ { "amount" => 100 }]
36
+ }
37
+
38
+ transaction = @client.create_transaction(createTransactionModel)
39
+ ```
40
+
41
+ If you'd like to see a more complete code example with credentials, check out our [example folder](/example).
42
+
43
+ AvaTax REST and Search APIs
44
+ ------------------------------
45
+ Our [developer site](https://developer.avalara.com/) documents all the AvaTax REST and other APIs. Subscribe to the [RSS feed](developer.avalara.com/feed.xml) to stay up to date on the lates news and announcements.
46
+
47
+ [API docs](http://www.rubydoc.info/github/avadev/AvaTax-REST-V2-Ruby-SDK/)
48
+
49
+ Blog
50
+ ----------------------------
51
+ The [Developer Blog](https://developer.avalara.com/blog/) features news and important announcements about the AvaTax Platform and SDKs. You will also find tutorials and best practices to help you build great platform integrations.
52
+
53
+ Contributing
54
+ ------------
55
+ In the spirit of [free software](http://www.fsf.org/licensing/essays/free-sw.html), **everyone** is encouraged to help improve this project.
56
+
57
+ Here are some ways *you* can contribute:
58
+
59
+ * by using alpha, beta, and prerelease versions
60
+ * by reporting bugs
61
+ * by suggesting new features
62
+ * by writing or editing documentation
63
+ * by writing specifications
64
+ * by writing code (**no patch is too small**: fix typos, add comments, clean up inconsistent whitespace)
65
+ * by refactoring code
66
+ * by closing [issues](https://github.com/avadev/AvaTax-REST-V2-Ruby-SDK/issues)
67
+ * by reviewing patches
68
+
69
+
70
+ Submitting an Issue
71
+ -------------------
72
+ We use the [GitHub issue tracker](https://github.com/avadev/AvaTax-REST-V2-Ruby-SDK/issues) to track bugs and
73
+ features. Before submitting a bug report or feature request, check to make sure it hasn't already
74
+ been submitted. You can indicate support for an existing issue by voting it up. When submitting a
75
+ bug report, please include a [Gist](http://gist.github.com/) that includes a stack trace and any
76
+ details that may be necessary to reproduce the bug, including your gem version, Ruby version, and
77
+ operating system. Ideally, a bug report should include a pull request with failing specs.
78
+
79
+ Submitting a Pull Request
80
+ -------------------------
81
+ 1. Fork the project.
82
+ 2. Create a topic branch.
83
+ 3. Implement your feature or bug fix.
84
+ 4. Add documentation for your feature or bug fix.
85
+ 5. Run <tt>rake doc:yard</tt>. If your changes are not 100% documented, go back to step 4.
86
+ 6. Add specs for your feature or bug fix.
87
+ 7. Commit and push your changes.
88
+ 8. Submit a pull request. Please do not include changes to the gemspec, version, or history file. (If you want to create your own version for some reason, please do so in a separate commit.)
89
+
90
+ Build Status
91
+ ------------
92
+ [![Build Status](https://travis-ci.org/avadev/AvaTax-REST-V2-Ruby-SDK.svg?branch=master)](https://travis-ci.org/avadev/AvaTax-REST-V2-Ruby-SDK)
93
+
94
+ Copyright
95
+ ---------
96
+ Copyright (c) 2017, Avalara, Inc. All rights reserved.
97
+ By contributing to AvaTax Ruby Gem, you agree that your contributions will be licensed under its Apache License.
98
+ See [LICENSE](https://github.com/avadev/AvaTax-REST-V2-Ruby-SDK/) for details.
data/Rakefile CHANGED
@@ -1,9 +1,9 @@
1
- begin
2
- require 'rspec/core/rake_task'
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
7
- rescue LoadError
8
- # no rspec available
9
- end
1
+ begin
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
7
+ rescue LoadError
8
+ # no rspec available
9
+ end
data/avatax.gemspec CHANGED
@@ -1,38 +1,38 @@
1
- require File.expand_path('../lib/avatax/version', __FILE__)
2
-
3
- Gem::Specification.new do |s|
4
- s.add_development_dependency('rake', '~> 12.0.0')
5
- s.add_development_dependency('rspec', '~> 3.5.0')
6
- s.add_development_dependency('webmock', '>= 2.0.0')
7
- s.add_runtime_dependency('faraday', '>= 0.10')
8
- s.add_runtime_dependency('faraday_middleware', '>= 0.10')
9
- s.add_runtime_dependency('multi_json', '>= 1.0.3')
10
- s.authors = ["Marcus Vorwaller"]
11
- s.description = %q{A Ruby wrapper for the AvaTax REST and Search APIs}
12
- s.post_install_message =<<eos
13
- ********************************************************************************
14
-
15
- AvaTax REST API
16
- ------------------------------
17
- Our developer site documents the AvaTax REST API.
18
- (http://developer.avatax.com).
19
- Blog
20
- ----------------------------
21
- The Developer Blog is a great place to learn more about the API and AvaTax integrations
22
- Subscribe to the RSS feed be notified of new posts:
23
- (http://developer.avatax.com/blog).
24
-
25
- ********************************************************************************
26
- eos
27
- s.email = ['marcus.vorwaller@avalara.com']
28
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
29
- s.files = `git ls-files`.split("\n")
30
- s.homepage = 'https://github.com/avadev/AvaTax-REST-V2-Ruby-SDK'
31
- s.name = 'avatax'
32
- s.platform = Gem::Platform::RUBY
33
- s.require_paths = ['lib']
34
- s.required_rubygems_version = Gem::Requirement.new('>= 2.0.0') if s.respond_to? :required_rubygems_version=
35
- s.summary = %q{Ruby wrapper for the AvaTax API}
36
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
37
- s.version = AvaTax::VERSION.dup
38
- end
1
+ require File.expand_path('../lib/avatax/version', __FILE__)
2
+
3
+ Gem::Specification.new do |s|
4
+ s.add_development_dependency('rake', '~> 12.0.0')
5
+ s.add_development_dependency('rspec', '~> 3.5.0')
6
+ s.add_development_dependency('webmock', '>= 2.0.0')
7
+ s.add_runtime_dependency('faraday', '>= 0.10')
8
+ s.add_runtime_dependency('faraday_middleware', '>= 0.10')
9
+ s.add_runtime_dependency('multi_json', '>= 1.0.3')
10
+ s.authors = ["Marcus Vorwaller"]
11
+ s.description = %q{A Ruby wrapper for the AvaTax REST and Search APIs}
12
+ s.post_install_message =<<eos
13
+ ********************************************************************************
14
+
15
+ AvaTax REST API
16
+ ------------------------------
17
+ Our developer site documents the AvaTax REST API.
18
+ (http://developer.avatax.com).
19
+ Blog
20
+ ----------------------------
21
+ The Developer Blog is a great place to learn more about the API and AvaTax integrations
22
+ Subscribe to the RSS feed be notified of new posts:
23
+ (http://developer.avatax.com/blog).
24
+
25
+ ********************************************************************************
26
+ eos
27
+ s.email = ['marcus.vorwaller@avalara.com']
28
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
29
+ s.files = `git ls-files`.split("\n")
30
+ s.homepage = 'https://github.com/avadev/AvaTax-REST-V2-Ruby-SDK'
31
+ s.name = 'avatax'
32
+ s.platform = Gem::Platform::RUBY
33
+ s.require_paths = ['lib']
34
+ s.required_rubygems_version = Gem::Requirement.new('>= 2.0.0') if s.respond_to? :required_rubygems_version=
35
+ s.summary = %q{Ruby wrapper for the AvaTax API}
36
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
37
+ s.version = AvaTax::VERSION.dup
38
+ end
data/example/avatax.rb CHANGED
@@ -1,47 +1,47 @@
1
- require 'yaml'
2
- require File.expand_path('../../lib/avatax', __FILE__)
3
-
4
- credentials = YAML.load_file(File.expand_path('../credentials.yaml', __FILE__))
5
-
6
- AvaTax.configure do |config|
7
- begin
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
- rescue
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(:logger => true)
20
-
21
- # puts @client.query_companies
22
-
23
- createTransactionModel = {
24
- "type" => 'SalesInvoice',
25
- "companyCode" => '12670',
26
- "date" => '2017-06-05',
27
- "customerCode" => 'ABC',
28
- "addresses" => {
29
- "ShipFrom" => {
30
- "line1" => "123 Main Street",
31
- "city" => "Irvine",
32
- "region" => "CA",
33
- "country" => "US",
34
- "postalCode" => "92615"
35
- },
36
- "ShipTo" => {
37
- "line1" => "100 Market Street",
38
- "city" => "San Francisco",
39
- "region" => "CA",
40
- "country" => "US",
41
- "postalCode" => "94105"
42
- }
43
- },
44
- "lines" => [ { "amount" => 100 }]
45
- }
46
- transaction = @client.create_transaction(createTransactionModel)
47
- puts JSON.pretty_generate(transaction)
1
+ require 'yaml'
2
+ require File.expand_path('../../lib/avatax', __FILE__)
3
+
4
+ credentials = YAML.load_file(File.expand_path('../credentials.yaml', __FILE__))
5
+
6
+ AvaTax.configure do |config|
7
+ begin
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
+ rescue
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(:logger => true)
20
+
21
+ # puts @client.query_companies
22
+
23
+ createTransactionModel = {
24
+ "type" => 'SalesInvoice',
25
+ "companyCode" => '12670',
26
+ "date" => '2017-06-05',
27
+ "customerCode" => 'ABC',
28
+ "addresses" => {
29
+ "ShipFrom" => {
30
+ "line1" => "123 Main Street",
31
+ "city" => "Irvine",
32
+ "region" => "CA",
33
+ "country" => "US",
34
+ "postalCode" => "92615"
35
+ },
36
+ "ShipTo" => {
37
+ "line1" => "100 Market Street",
38
+ "city" => "San Francisco",
39
+ "region" => "CA",
40
+ "country" => "US",
41
+ "postalCode" => "94105"
42
+ }
43
+ },
44
+ "lines" => [ { "amount" => 100 }]
45
+ }
46
+ transaction = @client.create_transaction(createTransactionModel)
47
+ puts JSON.pretty_generate(transaction)
@@ -1,5 +1,5 @@
1
- # Copy this file as credentials.yaml and update the values to match your account
2
- ---
3
- endpoint: https://sandbox-rest.avatax.com
4
- username: 'example_user'
5
- password: 'abcd1234'
1
+ # Copy this file as credentials.yaml and update the values to match your account
2
+ ---
3
+ endpoint: https://sandbox-rest.avatax.com
4
+ username: 'example_user'
5
+ password: 'abcd1234'
data/lib/avatax/api.rb CHANGED
@@ -1,27 +1,27 @@
1
- require File.expand_path('../connection', __FILE__)
2
- require File.expand_path('../request', __FILE__)
3
-
4
- module AvaTax
5
- class API
6
-
7
- attr_accessor *Configuration::VALID_OPTIONS_KEYS
8
-
9
- def initialize(options={})
10
- options = AvaTax.options.merge(options)
11
- Configuration::VALID_OPTIONS_KEYS.each do |key|
12
- send("#{key}=", options[key])
13
- end
14
- end
15
-
16
- def config
17
- conf = {}
18
- Configuration::VALID_OPTIONS_KEYS.each do |key|
19
- conf[key] = send key
20
- end
21
- conf
22
- end
23
-
24
- include Connection
25
- include Request
26
- end
27
- end
1
+ require File.expand_path('../connection', __FILE__)
2
+ require File.expand_path('../request', __FILE__)
3
+
4
+ module AvaTax
5
+ class API
6
+
7
+ attr_accessor *Configuration::VALID_OPTIONS_KEYS
8
+
9
+ def initialize(options={})
10
+ options = AvaTax.options.merge(options)
11
+ Configuration::VALID_OPTIONS_KEYS.each do |key|
12
+ send("#{key}=", options[key])
13
+ end
14
+ end
15
+
16
+ def config
17
+ conf = {}
18
+ Configuration::VALID_OPTIONS_KEYS.each do |key|
19
+ conf[key] = send key
20
+ end
21
+ conf
22
+ end
23
+
24
+ include Connection
25
+ include Request
26
+ end
27
+ end