tax_cloud 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +9 -0
- data/CHANGELOG.rdoc +28 -0
- data/CONTRIBUTORS.txt +20 -0
- data/Gemfile +1 -1
- data/LICENSE.rdoc +22 -0
- data/README.rdoc +112 -28
- data/Rakefile +10 -2
- data/lib/config/locales/en.yml +34 -0
- data/lib/hash.rb +8 -6
- data/lib/savon_soap_xml.rb +33 -0
- data/lib/tasks/tax_cloud.rake +20 -0
- data/lib/tasks/tax_code_groups.rake +39 -0
- data/lib/tasks/tax_codes.rake +45 -0
- data/lib/tax_cloud.rb +43 -16
- data/lib/tax_cloud/address.rb +30 -17
- data/lib/tax_cloud/cart_item.rb +13 -19
- data/lib/tax_cloud/client.rb +48 -0
- data/lib/tax_cloud/configuration.rb +17 -2
- data/lib/tax_cloud/errors.rb +6 -0
- data/lib/tax_cloud/errors/api_error.rb +18 -0
- data/lib/tax_cloud/errors/missing_config_error.rb +13 -0
- data/lib/tax_cloud/errors/missing_config_option_error.rb +19 -0
- data/lib/tax_cloud/errors/soap_error.rb +33 -0
- data/lib/tax_cloud/errors/tax_cloud_error.rb +86 -0
- data/lib/tax_cloud/errors/unexpected_soap_response_error.rb +23 -0
- data/lib/tax_cloud/record.rb +14 -0
- data/lib/tax_cloud/responses.rb +13 -0
- data/lib/tax_cloud/responses/authorized.rb +10 -0
- data/lib/tax_cloud/responses/authorized_with_capture.rb +10 -0
- data/lib/tax_cloud/responses/base.rb +88 -0
- data/lib/tax_cloud/responses/captured.rb +11 -0
- data/lib/tax_cloud/responses/cart_item.rb +24 -0
- data/lib/tax_cloud/responses/generic.rb +35 -0
- data/lib/tax_cloud/responses/lookup.rb +41 -0
- data/lib/tax_cloud/responses/ping.rb +10 -0
- data/lib/tax_cloud/responses/returned.rb +10 -0
- data/lib/tax_cloud/responses/tax_code_groups.rb +33 -0
- data/lib/tax_cloud/responses/tax_codes.rb +33 -0
- data/lib/tax_cloud/responses/tax_codes_by_group.rb +33 -0
- data/lib/tax_cloud/responses/verify_address.rb +29 -0
- data/lib/tax_cloud/tax_code.rb +11 -0
- data/lib/tax_cloud/tax_code_constants.rb +562 -0
- data/lib/tax_cloud/tax_code_group.rb +30 -0
- data/lib/tax_cloud/tax_code_group_constants.rb +31 -0
- data/lib/tax_cloud/tax_code_groups.rb +28 -0
- data/lib/tax_cloud/tax_codes.rb +24 -47
- data/lib/tax_cloud/transaction.rb +39 -34
- data/lib/tax_cloud/version.rb +3 -3
- data/tax_cloud.gemspec +7 -5
- data/test/cassettes/authorized.yml +70 -45
- data/test/cassettes/authorized_with_capture.yml +70 -45
- data/test/cassettes/captured.yml +101 -67
- data/test/cassettes/get_tic_groups.yml +656 -0
- data/test/cassettes/get_tics.yml +952 -0
- data/test/cassettes/get_tics_by_group.yml +49 -0
- data/test/cassettes/invalid_soap_call.yml +651 -0
- data/test/cassettes/lookup.yml +644 -25
- data/test/cassettes/lookup_ny.yml +651 -0
- data/test/cassettes/ping.yml +647 -0
- data/test/cassettes/ping_with_invalid_credentials.yml +647 -0
- data/test/cassettes/ping_with_invalid_response.yml +647 -0
- data/test/cassettes/returned.yml +101 -67
- data/test/cassettes/verify_bad_address.yml +578 -976
- data/test/cassettes/verify_good_address.yml +36 -23
- data/test/helper.rb +4 -19
- data/test/test_address.rb +25 -7
- data/test/test_client.rb +29 -0
- data/test/test_configuration.rb +33 -0
- data/test/test_setup.rb +18 -0
- data/test/test_soap.rb +13 -0
- data/test/test_tax_code_groups.rb +31 -0
- data/test/test_tax_codes.rb +19 -0
- data/test/test_transaction.rb +22 -11
- data/test/test_transaction_ny.rb +27 -0
- data/test/vcr_setup.rb +9 -0
- metadata +134 -24
- data/lib/savon_xml_override.rb +0 -30
data/lib/savon_xml_override.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
# Hack Savon to work properly with arrays
|
2
|
-
module Savon #:nodoc:
|
3
|
-
module SOAP #:nodoc:
|
4
|
-
class XML #:nodoc:
|
5
|
-
private
|
6
|
-
old_add_namespaces_to_body = self.instance_method(:add_namespaces_to_body)
|
7
|
-
|
8
|
-
def add_namespaces_to_body(hash, path = [input[1].to_s])
|
9
|
-
return unless hash
|
10
|
-
return hash if hash.kind_of? Array
|
11
|
-
return hash.to_s unless hash.kind_of? Hash
|
12
|
-
|
13
|
-
hash.inject({}) do |newhash, (key, value)|
|
14
|
-
camelcased_key = Gyoku::XMLKey.create(key)
|
15
|
-
newpath = path + [camelcased_key]
|
16
|
-
|
17
|
-
if used_namespaces[newpath]
|
18
|
-
newhash.merge(
|
19
|
-
"#{used_namespaces[newpath]}:#{camelcased_key}" =>
|
20
|
-
add_namespaces_to_body(value, types[newpath] ? [types[newpath]] : newpath)
|
21
|
-
)
|
22
|
-
else
|
23
|
-
newhash.merge(key => value)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|