tax_cloud 0.3.0 → 0.5.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.
- checksums.yaml +5 -5
- data/.github/workflows/test.yml +30 -0
- data/.rubocop.yml +9 -25
- data/.rubocop_todo.yml +47 -0
- data/CHANGELOG.md +85 -0
- data/CONTRIBUTORS.txt +3 -0
- data/Gemfile +15 -5
- data/LICENSE.md +21 -0
- data/README.md +200 -0
- data/Rakefile +5 -19
- data/lib/config/locales/en.yml +2 -2
- data/lib/hash.rb +3 -4
- data/lib/tasks/tax_cloud.rake +4 -4
- data/lib/tasks/tax_code_groups.rake +11 -11
- data/lib/tasks/tax_codes.rake +12 -12
- data/lib/tax_cloud/address.rb +10 -5
- data/lib/tax_cloud/cart_item.rb +2 -0
- data/lib/tax_cloud/client.rb +13 -3
- data/lib/tax_cloud/configuration.rb +13 -2
- data/lib/tax_cloud/errors/api_error.rb +3 -3
- data/lib/tax_cloud/errors/missing_config_error.rb +2 -1
- data/lib/tax_cloud/errors/missing_config_option_error.rb +2 -1
- data/lib/tax_cloud/errors/soap_error.rb +6 -6
- data/lib/tax_cloud/errors/tax_cloud_error.rb +5 -4
- data/lib/tax_cloud/errors/unexpected_soap_response_error.rb +3 -3
- data/lib/tax_cloud/errors.rb +2 -0
- data/lib/tax_cloud/record.rb +2 -0
- data/lib/tax_cloud/responses/authorized.rb +3 -1
- data/lib/tax_cloud/responses/authorized_with_capture.rb +3 -1
- data/lib/tax_cloud/responses/base.rb +5 -4
- data/lib/tax_cloud/responses/captured.rb +3 -1
- data/lib/tax_cloud/responses/cart_item.rb +6 -2
- data/lib/tax_cloud/responses/generic.rb +2 -0
- data/lib/tax_cloud/responses/lookup.rb +10 -8
- data/lib/tax_cloud/responses/ping.rb +3 -1
- data/lib/tax_cloud/responses/returned.rb +3 -1
- data/lib/tax_cloud/responses/tax_code_groups.rb +3 -1
- data/lib/tax_cloud/responses/tax_codes.rb +3 -1
- data/lib/tax_cloud/responses/tax_codes_by_group.rb +3 -1
- data/lib/tax_cloud/responses/verify_address.rb +3 -1
- data/lib/tax_cloud/responses.rb +2 -0
- data/lib/tax_cloud/tax_code.rb +2 -0
- data/lib/tax_cloud/tax_code_constants.rb +262 -260
- data/lib/tax_cloud/tax_code_group.rb +3 -1
- data/lib/tax_cloud/tax_code_group_constants.rb +2 -0
- data/lib/tax_cloud/tax_code_groups.rb +3 -1
- data/lib/tax_cloud/tax_codes.rb +3 -1
- data/lib/tax_cloud/transaction.rb +2 -0
- data/lib/tax_cloud/version.rb +3 -1
- data/lib/tax_cloud.rb +8 -3
- data/tax_cloud.gemspec +17 -18
- data/test/cassettes/authorized.yml +6 -6
- data/test/cassettes/authorized_with_capture.yml +6 -6
- data/test/cassettes/authorized_with_localized_time.yml +6 -6
- data/test/cassettes/captured.yml +7 -7
- data/test/cassettes/get_tic_groups.yml +5 -5
- data/test/cassettes/get_tics.yml +5 -5
- data/test/cassettes/get_tics_by_group.yml +5 -5
- data/test/cassettes/invalid_soap_call.yml +5 -5
- data/test/cassettes/lookup.yml +5 -5
- data/test/cassettes/lookup_ny.yml +5 -5
- data/test/cassettes/ping.yml +5 -5
- data/test/cassettes/ping_with_invalid_credentials.yml +5 -5
- data/test/cassettes/ping_with_invalid_response.yml +5 -5
- data/test/cassettes/returned.yml +7 -7
- data/test/cassettes/verify_bad_address.yml +5 -5
- data/test/cassettes/verify_good_address.yml +5 -5
- data/test/helper.rb +3 -1
- data/test/test_address.rb +7 -5
- data/test/test_cart_item.rb +3 -1
- data/test/test_client.rb +4 -2
- data/test/test_configuration_optional_keys.rb +44 -0
- data/test/{test_configuration.rb → test_configuration_required_keys.rb} +6 -4
- data/test/test_lookup_response.rb +22 -0
- data/test/test_setup.rb +3 -1
- data/test/test_soap.rb +3 -1
- data/test/test_tax_code_groups.rb +4 -2
- data/test/test_tax_codes.rb +3 -1
- data/test/test_transaction.rb +3 -1
- data/test/test_transaction_ny.rb +3 -1
- data/test/vcr_setup.rb +2 -0
- metadata +37 -91
- data/.travis.yml +0 -6
- data/CHANGELOG.rdoc +0 -42
- data/LICENSE.rdoc +0 -22
- data/README.rdoc +0 -140
data/test/cassettes/returned.yml
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: https://api.taxcloud.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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 =
|
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
|
data/test/test_cart_item.rb
CHANGED
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
|
-
|
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 =
|
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
|
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
|
-
|
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
|
-
|
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
|
-
|
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
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
|
-
|
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
|
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
|
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
|
data/test/test_tax_codes.rb
CHANGED
data/test/test_transaction.rb
CHANGED
@@ -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(
|
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
|
data/test/test_transaction_ny.rb
CHANGED
@@ -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(
|
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
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.
|
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:
|
11
|
+
date: 2023-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
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: '
|
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:
|
42
|
+
name: net-smtp
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
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
|
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:
|
56
|
+
name: savon
|
113
57
|
requirement: !ruby/object:Gem::Requirement
|
114
58
|
requirements:
|
115
|
-
- -
|
59
|
+
- - ">="
|
116
60
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
118
|
-
type: :
|
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:
|
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
|
-
- .
|
133
|
-
- .
|
134
|
-
- .
|
135
|
-
-
|
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.
|
139
|
-
- README.
|
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/
|
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:
|
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
|
-
|
230
|
-
|
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
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.
|