tax_cloud 0.3.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/test.yml +30 -0
  3. data/.rubocop.yml +9 -25
  4. data/.rubocop_todo.yml +47 -0
  5. data/CHANGELOG.md +85 -0
  6. data/CONTRIBUTORS.txt +3 -0
  7. data/Gemfile +15 -5
  8. data/LICENSE.md +21 -0
  9. data/README.md +200 -0
  10. data/Rakefile +5 -19
  11. data/lib/config/locales/en.yml +2 -2
  12. data/lib/hash.rb +3 -4
  13. data/lib/tasks/tax_cloud.rake +4 -4
  14. data/lib/tasks/tax_code_groups.rake +11 -11
  15. data/lib/tasks/tax_codes.rake +12 -12
  16. data/lib/tax_cloud/address.rb +10 -5
  17. data/lib/tax_cloud/cart_item.rb +2 -0
  18. data/lib/tax_cloud/client.rb +13 -3
  19. data/lib/tax_cloud/configuration.rb +13 -2
  20. data/lib/tax_cloud/errors/api_error.rb +3 -3
  21. data/lib/tax_cloud/errors/missing_config_error.rb +2 -1
  22. data/lib/tax_cloud/errors/missing_config_option_error.rb +2 -1
  23. data/lib/tax_cloud/errors/soap_error.rb +6 -6
  24. data/lib/tax_cloud/errors/tax_cloud_error.rb +5 -4
  25. data/lib/tax_cloud/errors/unexpected_soap_response_error.rb +3 -3
  26. data/lib/tax_cloud/errors.rb +2 -0
  27. data/lib/tax_cloud/record.rb +2 -0
  28. data/lib/tax_cloud/responses/authorized.rb +3 -1
  29. data/lib/tax_cloud/responses/authorized_with_capture.rb +3 -1
  30. data/lib/tax_cloud/responses/base.rb +5 -4
  31. data/lib/tax_cloud/responses/captured.rb +3 -1
  32. data/lib/tax_cloud/responses/cart_item.rb +6 -2
  33. data/lib/tax_cloud/responses/generic.rb +2 -0
  34. data/lib/tax_cloud/responses/lookup.rb +10 -8
  35. data/lib/tax_cloud/responses/ping.rb +3 -1
  36. data/lib/tax_cloud/responses/returned.rb +3 -1
  37. data/lib/tax_cloud/responses/tax_code_groups.rb +3 -1
  38. data/lib/tax_cloud/responses/tax_codes.rb +3 -1
  39. data/lib/tax_cloud/responses/tax_codes_by_group.rb +3 -1
  40. data/lib/tax_cloud/responses/verify_address.rb +3 -1
  41. data/lib/tax_cloud/responses.rb +2 -0
  42. data/lib/tax_cloud/tax_code.rb +2 -0
  43. data/lib/tax_cloud/tax_code_constants.rb +262 -260
  44. data/lib/tax_cloud/tax_code_group.rb +3 -1
  45. data/lib/tax_cloud/tax_code_group_constants.rb +2 -0
  46. data/lib/tax_cloud/tax_code_groups.rb +3 -1
  47. data/lib/tax_cloud/tax_codes.rb +3 -1
  48. data/lib/tax_cloud/transaction.rb +2 -0
  49. data/lib/tax_cloud/version.rb +3 -1
  50. data/lib/tax_cloud.rb +8 -3
  51. data/tax_cloud.gemspec +17 -18
  52. data/test/cassettes/authorized.yml +6 -6
  53. data/test/cassettes/authorized_with_capture.yml +6 -6
  54. data/test/cassettes/authorized_with_localized_time.yml +6 -6
  55. data/test/cassettes/captured.yml +7 -7
  56. data/test/cassettes/get_tic_groups.yml +5 -5
  57. data/test/cassettes/get_tics.yml +5 -5
  58. data/test/cassettes/get_tics_by_group.yml +5 -5
  59. data/test/cassettes/invalid_soap_call.yml +5 -5
  60. data/test/cassettes/lookup.yml +5 -5
  61. data/test/cassettes/lookup_ny.yml +5 -5
  62. data/test/cassettes/ping.yml +5 -5
  63. data/test/cassettes/ping_with_invalid_credentials.yml +5 -5
  64. data/test/cassettes/ping_with_invalid_response.yml +5 -5
  65. data/test/cassettes/returned.yml +7 -7
  66. data/test/cassettes/verify_bad_address.yml +5 -5
  67. data/test/cassettes/verify_good_address.yml +5 -5
  68. data/test/helper.rb +3 -1
  69. data/test/test_address.rb +7 -5
  70. data/test/test_cart_item.rb +3 -1
  71. data/test/test_client.rb +4 -2
  72. data/test/test_configuration_optional_keys.rb +44 -0
  73. data/test/{test_configuration.rb → test_configuration_required_keys.rb} +6 -4
  74. data/test/test_lookup_response.rb +22 -0
  75. data/test/test_setup.rb +3 -1
  76. data/test/test_soap.rb +3 -1
  77. data/test/test_tax_code_groups.rb +4 -2
  78. data/test/test_tax_codes.rb +3 -1
  79. data/test/test_transaction.rb +3 -1
  80. data/test/test_transaction_ny.rb +3 -1
  81. data/test/vcr_setup.rb +2 -0
  82. metadata +37 -91
  83. data/.travis.yml +0 -6
  84. data/CHANGELOG.rdoc +0 -42
  85. data/LICENSE.rdoc +0 -22
  86. data/README.rdoc +0 -140
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.taxcloud.net/1.0/?wsdl
5
+ uri: https://api.taxcloud.com/1.0/?wsdl
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -719,17 +719,17 @@ http_interactions:
719
719
  part=\"Body\" />\r\n </wsdl:output>\r\n </wsdl:operation>\r\n </wsdl:binding>\r\n
720
720
  \ <wsdl:service name=\"TaxCloud\">\r\n <wsdl:documentation xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\">TaxCloud
721
721
  Web Service</wsdl:documentation>\r\n <wsdl:port name=\"TaxCloudSoap\" binding=\"tns:TaxCloudSoap\">\r\n
722
- \ <soap:address location=\"https://api.taxcloud.net/1.0/TaxCloud.asmx\"
722
+ \ <soap:address location=\"https://api.taxcloud.com/1.0/TaxCloud.asmx\"
723
723
  />\r\n </wsdl:port>\r\n <wsdl:port name=\"TaxCloudSoap12\" binding=\"tns:TaxCloudSoap12\">\r\n
724
- \ <soap12:address location=\"https://api.taxcloud.net/1.0/TaxCloud.asmx\"
724
+ \ <soap12:address location=\"https://api.taxcloud.com/1.0/TaxCloud.asmx\"
725
725
  />\r\n </wsdl:port>\r\n <wsdl:port name=\"TaxCloudHttpPost\" binding=\"tns:TaxCloudHttpPost\">\r\n
726
- \ <http:address location=\"https://api.taxcloud.net/1.0/TaxCloud.asmx\"
726
+ \ <http:address location=\"https://api.taxcloud.com/1.0/TaxCloud.asmx\"
727
727
  />\r\n </wsdl:port>\r\n </wsdl:service>\r\n</wsdl:definitions>"
728
728
  http_version:
729
729
  recorded_at: Thu, 09 Jan 2014 16:03:39 GMT
730
730
  - request:
731
731
  method: post
732
- uri: https://api.taxcloud.net/1.0/TaxCloud.asmx
732
+ uri: https://api.taxcloud.com/1.0/TaxCloud.asmx
733
733
  body:
734
734
  encoding: US-ASCII
735
735
  string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
@@ -779,7 +779,7 @@ http_interactions:
779
779
  recorded_at: Fri, 01 Mar 2013 22:58:21 GMT
780
780
  - request:
781
781
  method: post
782
- uri: https://api.taxcloud.net/1.0/TaxCloud.asmx
782
+ uri: https://api.taxcloud.com/1.0/TaxCloud.asmx
783
783
  body:
784
784
  encoding: US-ASCII
785
785
  string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
@@ -825,7 +825,7 @@ http_interactions:
825
825
  recorded_at: Fri, 01 Mar 2013 22:58:21 GMT
826
826
  - request:
827
827
  method: post
828
- uri: https://api.taxcloud.net/1.0/TaxCloud.asmx
828
+ uri: https://api.taxcloud.com/1.0/TaxCloud.asmx
829
829
  body:
830
830
  encoding: US-ASCII
831
831
  string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.taxcloud.net/1.0/?wsdl
5
+ uri: https://api.taxcloud.com/1.0/?wsdl
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -719,17 +719,17 @@ http_interactions:
719
719
  part=\"Body\" />\r\n </wsdl:output>\r\n </wsdl:operation>\r\n </wsdl:binding>\r\n
720
720
  \ <wsdl:service name=\"TaxCloud\">\r\n <wsdl:documentation xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\">TaxCloud
721
721
  Web Service</wsdl:documentation>\r\n <wsdl:port name=\"TaxCloudSoap\" binding=\"tns:TaxCloudSoap\">\r\n
722
- \ <soap:address location=\"https://api.taxcloud.net/1.0/TaxCloud.asmx\"
722
+ \ <soap:address location=\"https://api.taxcloud.com/1.0/TaxCloud.asmx\"
723
723
  />\r\n </wsdl:port>\r\n <wsdl:port name=\"TaxCloudSoap12\" binding=\"tns:TaxCloudSoap12\">\r\n
724
- \ <soap12:address location=\"https://api.taxcloud.net/1.0/TaxCloud.asmx\"
724
+ \ <soap12:address location=\"https://api.taxcloud.com/1.0/TaxCloud.asmx\"
725
725
  />\r\n </wsdl:port>\r\n <wsdl:port name=\"TaxCloudHttpPost\" binding=\"tns:TaxCloudHttpPost\">\r\n
726
- \ <http:address location=\"https://api.taxcloud.net/1.0/TaxCloud.asmx\"
726
+ \ <http:address location=\"https://api.taxcloud.com/1.0/TaxCloud.asmx\"
727
727
  />\r\n </wsdl:port>\r\n </wsdl:service>\r\n</wsdl:definitions>"
728
728
  http_version:
729
729
  recorded_at: Thu, 09 Jan 2014 16:03:39 GMT
730
730
  - request:
731
731
  method: post
732
- uri: https://api.taxcloud.net/1.0/TaxCloud.asmx
732
+ uri: https://api.taxcloud.com/1.0/TaxCloud.asmx
733
733
  body:
734
734
  encoding: UTF-8
735
735
  string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://api.taxcloud.net/1.0/?wsdl
5
+ uri: https://api.taxcloud.com/1.0/?wsdl
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -719,17 +719,17 @@ http_interactions:
719
719
  part=\"Body\" />\r\n </wsdl:output>\r\n </wsdl:operation>\r\n </wsdl:binding>\r\n
720
720
  \ <wsdl:service name=\"TaxCloud\">\r\n <wsdl:documentation xmlns:wsdl=\"http://schemas.xmlsoap.org/wsdl/\">TaxCloud
721
721
  Web Service</wsdl:documentation>\r\n <wsdl:port name=\"TaxCloudSoap\" binding=\"tns:TaxCloudSoap\">\r\n
722
- \ <soap:address location=\"https://api.taxcloud.net/1.0/TaxCloud.asmx\"
722
+ \ <soap:address location=\"https://api.taxcloud.com/1.0/TaxCloud.asmx\"
723
723
  />\r\n </wsdl:port>\r\n <wsdl:port name=\"TaxCloudSoap12\" binding=\"tns:TaxCloudSoap12\">\r\n
724
- \ <soap12:address location=\"https://api.taxcloud.net/1.0/TaxCloud.asmx\"
724
+ \ <soap12:address location=\"https://api.taxcloud.com/1.0/TaxCloud.asmx\"
725
725
  />\r\n </wsdl:port>\r\n <wsdl:port name=\"TaxCloudHttpPost\" binding=\"tns:TaxCloudHttpPost\">\r\n
726
- \ <http:address location=\"https://api.taxcloud.net/1.0/TaxCloud.asmx\"
726
+ \ <http:address location=\"https://api.taxcloud.com/1.0/TaxCloud.asmx\"
727
727
  />\r\n </wsdl:port>\r\n </wsdl:service>\r\n</wsdl:definitions>"
728
728
  http_version:
729
729
  recorded_at: Thu, 09 Jan 2014 16:03:39 GMT
730
730
  - request:
731
731
  method: post
732
- uri: https://api.taxcloud.net/1.0/TaxCloud.asmx
732
+ uri: https://api.taxcloud.com/1.0/TaxCloud.asmx
733
733
  body:
734
734
  encoding: UTF-8
735
735
  string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
data/test/helper.rb CHANGED
@@ -1,4 +1,6 @@
1
- require 'test/unit'
1
+ # frozen_string_literal: true
2
+
3
+ require 'minitest/autorun'
2
4
  require 'tax_cloud'
3
5
  require 'json'
4
6
 
data/test/test_address.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'helper'
2
4
 
3
5
  class TestAddress < TestSetup
@@ -8,11 +10,11 @@ class TestAddress < TestSetup
8
10
 
9
11
  def test_initialize
10
12
  assert_equal '888 6th Ave', @address.address1
11
- assert_equal nil, @address.address2
13
+ assert_nil @address.address2
12
14
  assert_equal 'New York', @address.city
13
15
  assert_equal 'New York', @address.state
14
16
  assert_equal '10001', @address.zip5
15
- assert_equal nil, @address.zip4
17
+ assert_nil @address.zip4
16
18
  end
17
19
 
18
20
  def test_zip
@@ -22,7 +24,7 @@ class TestAddress < TestSetup
22
24
  assert_equal '10001-1234', @address.zip
23
25
  # only 4-digit zip, which is invalid
24
26
  @address.zip5 = nil
25
- assert_equal nil, @address.zip
27
+ assert_nil @address.zip
26
28
  end
27
29
 
28
30
  def test_address_respond_to_verify
@@ -34,7 +36,7 @@ class TestAddress < TestSetup
34
36
  verified = @address.verify
35
37
  assert_instance_of TaxCloud::Address, verified
36
38
  assert_equal '888 6TH AVE', verified.address1
37
- assert_equal nil, verified.address2
39
+ assert_nil verified.address2
38
40
  assert_equal 'NEW YORK', verified.city
39
41
  assert_equal 'NY', verified.state
40
42
  assert_equal '10001', verified.zip5
@@ -43,7 +45,7 @@ class TestAddress < TestSetup
43
45
  end
44
46
 
45
47
  def test_verify_bad_address
46
- e = assert_raise TaxCloud::Errors::ApiError do
48
+ e = assert_raises TaxCloud::Errors::ApiError do
47
49
  VCR.use_cassette('verify bad address') do
48
50
  bad_address = TaxCloud::Address.new address1: '10001 Test Street', city: 'New York', state: 'New York', zip5: '99999'
49
51
  bad_address.verify
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'helper'
2
4
 
3
- class TestCartItem < Test::Unit::TestCase
5
+ class TestCartItem < Minitest::Test
4
6
  def setup
5
7
  @cart_item = TaxCloud::CartItem.new index: 0, item_id: 'SKU-100', tic: '0000', price: 50.00, quantity: 3
6
8
  end
data/test/test_client.rb CHANGED
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'helper'
2
4
 
3
5
  class TestClient < TestSetup
4
6
  def test_ping_with_invalid_credentials
5
- assert_raise TaxCloud::Errors::ApiError do
7
+ assert_raises TaxCloud::Errors::ApiError do
6
8
  VCR.use_cassette('ping_with_invalid_credentials') do
7
9
  TaxCloud.client.ping
8
10
  end
@@ -10,7 +12,7 @@ class TestClient < TestSetup
10
12
  end
11
13
 
12
14
  def test_ping_with_invalid_response
13
- e = assert_raise TaxCloud::Errors::UnexpectedSoapResponse do
15
+ e = assert_raises TaxCloud::Errors::UnexpectedSoapResponse do
14
16
  VCR.use_cassette('ping_with_invalid_response') do
15
17
  TaxCloud.client.ping
16
18
  end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'helper'
4
+
5
+ describe 'TaxCloud::Configuration' do
6
+ def request
7
+ TaxCloud.client.instance_variable_get('@wsdl').request
8
+ end
9
+
10
+ def reset_and_configure(options = {})
11
+ TaxCloud.reset!
12
+ TaxCloud.configure do |config|
13
+ config.api_key = 'stubbed_api_key'
14
+ config.api_login_id = 'stubbed_api_login_id'
15
+ options.each do |key, value|
16
+ config.public_send("#{key}=", value)
17
+ end
18
+ end
19
+ end
20
+
21
+ describe 'open_timeout option' do
22
+ it 'has set default to 2' do
23
+ reset_and_configure
24
+ assert_equal 2, request.open_timeout
25
+ end
26
+
27
+ it 'can be changed via configuration' do
28
+ reset_and_configure(open_timeout: 3)
29
+ assert_equal 3, request.open_timeout
30
+ end
31
+ end
32
+
33
+ describe 'read_timeout option' do
34
+ it 'has set default to 2' do
35
+ reset_and_configure
36
+ assert_equal 2, request.read_timeout
37
+ end
38
+
39
+ it 'can be changed via configuration' do
40
+ reset_and_configure(read_timeout: 3)
41
+ assert_equal 3, request.read_timeout
42
+ end
43
+ end
44
+ end
@@ -1,12 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'helper'
2
4
 
3
- class TestConfiguration < Test::Unit::TestCase
5
+ class TestConfigurationRequiredKeys < Minitest::Test
4
6
  def setup
5
7
  TaxCloud.reset!
6
8
  end
7
9
 
8
10
  def test_missing_configuration
9
- assert_raise TaxCloud::Errors::MissingConfig do
11
+ assert_raises TaxCloud::Errors::MissingConfig do
10
12
  TaxCloud.client.request :dummy, body: {}
11
13
  end
12
14
  end
@@ -15,7 +17,7 @@ class TestConfiguration < Test::Unit::TestCase
15
17
  TaxCloud.configure do |config|
16
18
  config.api_key = 'taxcloud_api_key'
17
19
  end
18
- assert_raise TaxCloud::Errors::MissingConfigOption do
20
+ assert_raises TaxCloud::Errors::MissingConfigOption do
19
21
  TaxCloud.client.request :dummy, body: {}
20
22
  end
21
23
  end
@@ -24,7 +26,7 @@ class TestConfiguration < Test::Unit::TestCase
24
26
  TaxCloud.configure do |config|
25
27
  config.api_login_id = 'taxcloud_api_login_id'
26
28
  end
27
- assert_raise TaxCloud::Errors::MissingConfigOption do
29
+ assert_raises TaxCloud::Errors::MissingConfigOption do
28
30
  TaxCloud.client.request :dummy, body: {}
29
31
  end
30
32
  end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'helper'
4
+
5
+ class TestLookupResponse < TestSetup
6
+ class MockLookup < TaxCloud::Responses::Lookup
7
+ def initialize; end
8
+ end
9
+
10
+ def test_tax_amount_handles_decimal_addition_properly
11
+ response = TestLookupResponse::MockLookup.new
12
+
13
+ # `tax_amount`s chosen to provoke floating point arithmetic error
14
+ mock_savon_cart_items = [
15
+ { cart_item_index: '0', tax_amount: '0.35' },
16
+ { cart_item_index: '1', tax_amount: '0.7' }
17
+ ]
18
+ response.cart_items = mock_savon_cart_items.map { |i| TaxCloud::Responses::CartItem.new(i) }
19
+
20
+ assert_equal 1.05, response.tax_amount
21
+ end
22
+ end
data/test/test_setup.rb CHANGED
@@ -1,4 +1,6 @@
1
- class TestSetup < Test::Unit::TestCase
1
+ # frozen_string_literal: true
2
+
3
+ class TestSetup < Minitest::Test
2
4
  def default_test
3
5
  # placeholder to avoid error under Ruby 1.8.7
4
6
  end
data/test/test_soap.rb CHANGED
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'helper'
2
4
 
3
5
  class TestSoap < TestSetup
4
6
  def test_invalid_soap_call
5
- assert_raise Savon::UnknownOperationError do
7
+ assert_raises Savon::UnknownOperationError do
6
8
  VCR.use_cassette('invalid_soap_call') do
7
9
  TaxCloud.client.request :invalid, body: {}
8
10
  end
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'helper'
2
4
 
3
5
  class TestTaxCodeGroups < TestSetup
4
6
  def test_all
5
7
  VCR.use_cassette('get_tic_groups') do
6
- assert TaxCloud::TaxCode::Groups.all.count > 0
8
+ assert TaxCloud::TaxCode::Groups.all.count.positive?
7
9
  end
8
10
  end
9
11
 
@@ -20,7 +22,7 @@ class TestTaxCodeGroups < TestSetup
20
22
  TaxCloud::TaxCode::Groups[TaxCloud::TaxCode::Groups::SCHOOL_RELATED_PRODUCTS]
21
23
  end
22
24
  VCR.use_cassette('get_tics_by_group') do
23
- assert tax_code_group.tax_codes.count > 0
25
+ assert tax_code_group.tax_codes.count.positive?
24
26
  tax_code = tax_code_group[TaxCloud::TaxCodes::SCHOOL_INSTRUCTIONAL_MATERIAL]
25
27
  assert_equal TaxCloud::TaxCodes::SCHOOL_INSTRUCTIONAL_MATERIAL, tax_code.ticid
26
28
  assert_equal 'School instructional material', tax_code.description
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'helper'
2
4
 
3
5
  class TestTaxCode < TestSetup
4
6
  def test_all
5
7
  VCR.use_cassette('get_tics') do
6
- assert TaxCloud::TaxCodes.all.count > 0
8
+ assert TaxCloud::TaxCodes.all.count.positive?
7
9
  end
8
10
  end
9
11
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'helper'
2
4
 
3
5
  class TestTransaction < TestSetup
@@ -8,7 +10,7 @@ class TestTransaction < TestSetup
8
10
  cart_items = []
9
11
  cart_items << TaxCloud::CartItem.new(index: 0, item_id: 'SKU-TEST', tic: TaxCloud::TaxCodes::GENERAL, quantity: 1, price: 50.00)
10
12
  cart_items << TaxCloud::CartItem.new(index: 1, item_id: 'SKU-TEST1', tic: TaxCloud::TaxCodes::GENERAL, quantity: 1, price: 100.00)
11
- @transaction = TaxCloud::Transaction.new(customer_id: 42, cart_id: rand(18446744073709551616), order_id: rand(18446744073709551616), cart_items: cart_items, origin: origin, destination: destination)
13
+ @transaction = TaxCloud::Transaction.new(customer_id: 42, cart_id: rand(18_446_744_073_709_551_616), order_id: rand(18_446_744_073_709_551_616), cart_items: cart_items, origin: origin, destination: destination)
12
14
  end
13
15
 
14
16
  def test_lookup
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'helper'
2
4
 
3
5
  class TestTransactionNy < TestSetup
@@ -6,7 +8,7 @@ class TestTransactionNy < TestSetup
6
8
  origin = TaxCloud::Address.new address1: '888 6th Ave', city: 'New York', state: 'NY', zip5: '10001'
7
9
  destination = TaxCloud::Address.new address1: '888 6th Ave', city: 'New York', state: 'NY', zip5: '10001'
8
10
  cart_items = [TaxCloud::CartItem.new(index: 0, item_id: 'SKU-TEST', tic: TaxCloud::TaxCodes::GENERAL, quantity: 1, price: 50.00)]
9
- @transaction = TaxCloud::Transaction.new(customer_id: 42, cart_id: 708, order_id: rand(18446744073709551616), cart_items: cart_items, origin: origin, destination: destination)
11
+ @transaction = TaxCloud::Transaction.new(customer_id: 42, cart_id: 708, order_id: rand(18_446_744_073_709_551_616), cart_items: cart_items, origin: origin, destination: destination)
10
12
  end
11
13
 
12
14
  def test_lookup_non_ssuta_state
data/test/vcr_setup.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'vcr'
2
4
 
3
5
  VCR.configure do |c|
metadata CHANGED
@@ -1,127 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tax_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Drew Tempelmeyer
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-09 00:00:00.000000000 Z
11
+ date: 2023-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: savon
14
+ name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: '3.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '2.0'
26
+ version: '3.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: i18n
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: activesupport
42
+ name: net-smtp
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
53
- - !ruby/object:Gem::Version
54
- version: '3.0'
55
- - !ruby/object:Gem::Dependency
56
- name: rake
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - '>='
60
- - !ruby/object:Gem::Version
61
- version: '0.9'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - '>='
52
+ - - ">="
67
53
  - !ruby/object:Gem::Version
68
- version: '0.9'
69
- - !ruby/object:Gem::Dependency
70
- name: rdoc
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - '>='
74
- - !ruby/object:Gem::Version
75
- version: 2.5.0
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - '>='
81
- - !ruby/object:Gem::Version
82
- version: 2.5.0
83
- - !ruby/object:Gem::Dependency
84
- name: vcr
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ~>
88
- - !ruby/object:Gem::Version
89
- version: '2.3'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ~>
95
- - !ruby/object:Gem::Version
96
- version: '2.3'
97
- - !ruby/object:Gem::Dependency
98
- name: webmock
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ~>
102
- - !ruby/object:Gem::Version
103
- version: 1.8.0
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ~>
109
- - !ruby/object:Gem::Version
110
- version: 1.8.0
54
+ version: '0'
111
55
  - !ruby/object:Gem::Dependency
112
- name: rubocop
56
+ name: savon
113
57
  requirement: !ruby/object:Gem::Requirement
114
58
  requirements:
115
- - - ~>
59
+ - - ">="
116
60
  - !ruby/object:Gem::Version
117
- version: 0.16.0
118
- type: :development
61
+ version: '2.0'
62
+ type: :runtime
119
63
  prerelease: false
120
64
  version_requirements: !ruby/object:Gem::Requirement
121
65
  requirements:
122
- - - ~>
66
+ - - ">="
123
67
  - !ruby/object:Gem::Version
124
- version: 0.16.0
68
+ version: '2.0'
125
69
  description: Calculate sales tax using the TaxCloud.net API
126
70
  email:
127
71
  - drewtemp@gmail.com
@@ -129,14 +73,15 @@ executables: []
129
73
  extensions: []
130
74
  extra_rdoc_files: []
131
75
  files:
132
- - .gitignore
133
- - .rubocop.yml
134
- - .travis.yml
135
- - CHANGELOG.rdoc
76
+ - ".github/workflows/test.yml"
77
+ - ".gitignore"
78
+ - ".rubocop.yml"
79
+ - ".rubocop_todo.yml"
80
+ - CHANGELOG.md
136
81
  - CONTRIBUTORS.txt
137
82
  - Gemfile
138
- - LICENSE.rdoc
139
- - README.rdoc
83
+ - LICENSE.md
84
+ - README.md
140
85
  - Rakefile
141
86
  - lib/config/locales/en.yml
142
87
  - lib/hash.rb
@@ -199,7 +144,9 @@ files:
199
144
  - test/test_address.rb
200
145
  - test/test_cart_item.rb
201
146
  - test/test_client.rb
202
- - test/test_configuration.rb
147
+ - test/test_configuration_optional_keys.rb
148
+ - test/test_configuration_required_keys.rb
149
+ - test/test_lookup_response.rb
203
150
  - test/test_setup.rb
204
151
  - test/test_soap.rb
205
152
  - test/test_tax_code_groups.rb
@@ -211,24 +158,23 @@ homepage: https://github.com/drewtempelmeyer/tax_cloud
211
158
  licenses:
212
159
  - MIT
213
160
  metadata: {}
214
- post_install_message:
161
+ post_install_message:
215
162
  rdoc_options: []
216
163
  require_paths:
217
164
  - lib
218
165
  required_ruby_version: !ruby/object:Gem::Requirement
219
166
  requirements:
220
- - - '>='
167
+ - - ">="
221
168
  - !ruby/object:Gem::Version
222
- version: '0'
169
+ version: 2.6.0
223
170
  required_rubygems_version: !ruby/object:Gem::Requirement
224
171
  requirements:
225
- - - '>='
172
+ - - ">="
226
173
  - !ruby/object:Gem::Version
227
174
  version: 1.3.6
228
175
  requirements: []
229
- rubyforge_project:
230
- rubygems_version: 2.1.11
231
- signing_key:
176
+ rubygems_version: 3.3.7
177
+ signing_key:
232
178
  specification_version: 4
233
179
  summary: Calculate sales tax using TaxCloud
234
180
  test_files: []
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- rvm:
2
- - 1.9.3
3
- - 2.0.0
4
- - 2.1.0
5
- - jruby-19mode
6
- - rbx-2.1.1
data/CHANGELOG.rdoc DELETED
@@ -1,42 +0,0 @@
1
- === 0.3.0 (1/9/2014)
2
-
3
- * #19: Support Savon 2 - @drewtempelmeyer.
4
- * Implemented Rubocop, Ruby style linter - @dblock.
5
- * Ruby 1.8.7 and 1.9.2 are no longer supported - @dblock.
6
-
7
- === 0.2.2 (4/29/2013)
8
-
9
- * Relaxed thirdparty gem dependency versions - @mperham.
10
-
11
- === 0.2.1 (3/3/2013)
12
-
13
- * Fixed date formatting in API requests with localized applications - @soulcutter.
14
-
15
- === 0.2.0 (11/26/2012)
16
-
17
- * The gem is now licensed under the MIT license - @dblock.
18
- * Raise specialized configuration and SOAP errors - @dblock.
19
- * Added <tt>TaxCloud::Client.ping</tt> - @dblock.
20
- * Returning a verified <tt>TaxCloud::Address</tt> from <tt>TaxCloud::Address.verify</tt> - @dblock.
21
- * Added <tt>TaxCloud::Address.zip</tt> that returns a 9-digit address zip code, when available - @dblock.
22
- * Returning a <tt>TaxCloud::Responses::Lookup</tt> from <tt>TaxCloud::Transaction.lookup</tt> - @dblock.
23
- * Returning transaction state, ie. <tt>"OK"</tt> from all other TaxCloud transactions. Exceptions are raised on error - @dblock.
24
- * Added support for tax codes and tax code groups lookup with <tt>TaxCloud::TaxCodes</tt> and <tt>TaxCloud::TaxCode::Groups</tt> - @dblock.
25
-
26
- === 0.1.5 (5/9/2012)
27
-
28
- * Fixed compatibility with Ruby 1.8.7 and 1.9.3, removed super from constructors for classes which inherit from <tt>Object</tt> - @gfmurphy.
29
-
30
- === 0.1.4 (10/20/2011)
31
-
32
- * Upgraded rdoc - @drewtempelmeyer.
33
- * Fixed <tt>.gemspec</tt> dependency declaration for savon - @drewtempelmeyer.
34
-
35
- === 0.1.3 (9/19/2011)
36
-
37
- * Added support for the "returned" request - @danielmorrison.
38
- * Refactoreted tests to use vcr and webmock - @danielmorrison.
39
-
40
- === 0.1.0 (8/23/2011)
41
-
42
- * Initial public release - @drewtempelmeyer.