tax_cloud 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop.yml +8 -25
  3. data/.rubocop_todo.yml +47 -0
  4. data/.travis.yml +5 -5
  5. data/CHANGELOG.rdoc +11 -0
  6. data/CONTRIBUTORS.txt +3 -0
  7. data/Gemfile +16 -5
  8. data/LICENSE.rdoc +1 -1
  9. data/README.rdoc +12 -8
  10. data/Rakefile +7 -11
  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.rb +8 -3
  17. data/lib/tax_cloud/address.rb +10 -5
  18. data/lib/tax_cloud/cart_item.rb +2 -0
  19. data/lib/tax_cloud/client.rb +13 -3
  20. data/lib/tax_cloud/configuration.rb +13 -2
  21. data/lib/tax_cloud/errors.rb +2 -0
  22. data/lib/tax_cloud/errors/api_error.rb +3 -3
  23. data/lib/tax_cloud/errors/missing_config_error.rb +2 -1
  24. data/lib/tax_cloud/errors/missing_config_option_error.rb +2 -1
  25. data/lib/tax_cloud/errors/soap_error.rb +6 -6
  26. data/lib/tax_cloud/errors/tax_cloud_error.rb +4 -3
  27. data/lib/tax_cloud/errors/unexpected_soap_response_error.rb +3 -3
  28. data/lib/tax_cloud/record.rb +2 -0
  29. data/lib/tax_cloud/responses.rb +2 -0
  30. data/lib/tax_cloud/responses/authorized.rb +3 -1
  31. data/lib/tax_cloud/responses/authorized_with_capture.rb +3 -1
  32. data/lib/tax_cloud/responses/base.rb +5 -4
  33. data/lib/tax_cloud/responses/captured.rb +3 -1
  34. data/lib/tax_cloud/responses/cart_item.rb +6 -2
  35. data/lib/tax_cloud/responses/generic.rb +2 -0
  36. data/lib/tax_cloud/responses/lookup.rb +10 -8
  37. data/lib/tax_cloud/responses/ping.rb +3 -1
  38. data/lib/tax_cloud/responses/returned.rb +3 -1
  39. data/lib/tax_cloud/responses/tax_code_groups.rb +3 -1
  40. data/lib/tax_cloud/responses/tax_codes.rb +3 -1
  41. data/lib/tax_cloud/responses/tax_codes_by_group.rb +3 -1
  42. data/lib/tax_cloud/responses/verify_address.rb +3 -1
  43. data/lib/tax_cloud/tax_code.rb +2 -0
  44. data/lib/tax_cloud/tax_code_constants.rb +262 -260
  45. data/lib/tax_cloud/tax_code_group.rb +3 -1
  46. data/lib/tax_cloud/tax_code_group_constants.rb +2 -0
  47. data/lib/tax_cloud/tax_code_groups.rb +3 -1
  48. data/lib/tax_cloud/tax_codes.rb +3 -1
  49. data/lib/tax_cloud/transaction.rb +2 -0
  50. data/lib/tax_cloud/version.rb +3 -1
  51. data/tax_cloud.gemspec +16 -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 +3 -1
  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 +28 -96
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: dce34f03969027431c16d3504d5f02106ae8c086
4
- data.tar.gz: c55d7e4fa58df6cc206994e42ad2f0bfff8ead2b
2
+ SHA256:
3
+ metadata.gz: 2460bb8644d05b7169cd48c66cf45044c83d85b3bd9a4294f8a89b4313890774
4
+ data.tar.gz: f2e119009a8f5e45f379ed3a0b39d7417897504e502b21bf8e32b03dc02d5843
5
5
  SHA512:
6
- metadata.gz: 4c0b46885a58ebf4ba0d807d32e7b342d57b5057824d024cc60ab699e32ec5ff9ea2f815ad466362d91e468f962c1bb9b198052052adfed99b74829d4308efc7
7
- data.tar.gz: 4b909e99313bfcb962d44d124cdaf1b8d2d4c27d1d067549ad00f823d474fbd1c6fe0ffc5912f3fc38aeb7cd6da9677cf89637844c7870b9bdd709642bfb1521
6
+ metadata.gz: ab1f5b780aa0a1e6bc8b8f3345c15d9ea93bb9ce822805fb1a842d2c7fb42a4fc1cb17eb84206dc818af9131e498315abf17f360fb9e1a777e48083bae6607f6
7
+ data.tar.gz: 3eeb12ff2d77868a321fafbc81d52f7cd2abcd7ae8dd24f1ca8800b72db8a47b58e1ceb5f33bd5f0535e87b98f20954dd169e7cf58bc8e19ff00b8ebf141c84c
@@ -1,29 +1,12 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
1
3
  AllCops:
2
- Excludes:
4
+ TargetRubyVersion: 2.6
5
+ NewCops: enable
6
+ Exclude:
3
7
  - vendor/**
4
8
  - bin/**
5
9
 
6
- LineLength:
7
- Enabled: false
8
-
9
- MethodLength:
10
- Enabled: false
11
-
12
- ClassLength:
13
- Enabled: false
14
-
15
- Documentation:
16
- # don't require classes to be documented
17
- Enabled: false
18
-
19
- NumericLiterals:
20
- # don't separate numeric literals with _
21
- Enabled: false
22
-
23
- RaiseArgs:
24
- # don't need to provide an exception class and message, SoapError takes care of that
25
- Enabled: false
26
-
27
- Encoding:
28
- # missing UTF-8 comment
29
- Enabled: false
10
+ Style/NumericLiteralPrefix:
11
+ Enabled: true
12
+ EnforcedOctalStyle: zero_only
@@ -0,0 +1,47 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2020-10-14 20:47:01 UTC using RuboCop version 0.93.1.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ Lint/MissingSuper:
11
+ Exclude:
12
+ - 'test/test_lookup_response.rb'
13
+
14
+ # Offense count: 3
15
+ # Configuration parameters: IgnoredMethods.
16
+ Metrics/AbcSize:
17
+ Max: 23
18
+
19
+ # Offense count: 5
20
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
21
+ # ExcludedMethods: refine
22
+ Metrics/BlockLength:
23
+ Max: 39
24
+
25
+ # Offense count: 1
26
+ # Configuration parameters: CountComments, CountAsOne.
27
+ Metrics/ClassLength:
28
+ Max: 261
29
+
30
+ # Offense count: 2
31
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
32
+ Metrics/MethodLength:
33
+ Max: 14
34
+
35
+ # Offense count: 1
36
+ Style/Documentation:
37
+ Exclude:
38
+ - 'spec/**/*'
39
+ - 'test/**/*'
40
+ - 'lib/tax_cloud/tax_codes.rb'
41
+
42
+ # Offense count: 61
43
+ # Cop supports --auto-correct.
44
+ # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
45
+ # URISchemes: http, https
46
+ Layout/LineLength:
47
+ Max: 235
@@ -1,6 +1,6 @@
1
+ language: ruby
2
+ before_install:
3
+ - gem update bundler
1
4
  rvm:
2
- - 1.9.3
3
- - 2.0.0
4
- - 2.1.0
5
- - jruby-19mode
6
- - rbx-2.1.1
5
+ - 2.6.0
6
+ - 2.7.0
@@ -1,3 +1,14 @@
1
+ === 0.4.0 (12/7/2020)
2
+
3
+ * Add <tt>open_timeout</tt> and <tt>read_timeout</tt> options into configuration - @ka8725.
4
+ * Switch to using BigDecimal for <tt>tax_amount</tt> to avoid floating point arithmetic errors - @paulhenrich.
5
+ * Require ruby 2.6.0+
6
+ * Upgrade to rubocop latest
7
+ * Add `TargetRubyVersion: 2.6` to rubocop config (based on https://www.ruby-lang.org/en/downloads/branches/ oldest "normal maintenance" version)
8
+ * Add `required_ruby_version` to gemspec
9
+ * addresses rubocop violations
10
+ * Update WSDL endpoint URL as recommended by TaxCloud to https://asmx.taxcloud.com/1.0/?wsdl - @brchristian.
11
+
1
12
  === 0.3.0 (1/9/2014)
2
13
 
3
14
  * #19: Support Savon 2 - @drewtempelmeyer.
@@ -21,3 +21,6 @@ Contributors
21
21
 
22
22
  * Bradley Schaefer
23
23
  * Github: soulcutter
24
+
25
+ * Gary Hepting
26
+ * Github: ghepting
data/Gemfile CHANGED
@@ -1,9 +1,20 @@
1
- source "http://rubygems.org"
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
2
4
 
3
5
  gemspec
4
6
 
5
- platform :rbx do
6
- gem 'rubysl', '~> 2.0'
7
- gem 'racc'
8
- gem 'iconv'
7
+ group :development do
8
+ gem 'rubocop', '~> 0.93.1'
9
+ end
10
+
11
+ group :test do
12
+ gem 'minitest'
13
+ gem 'vcr'
14
+ gem 'webmock'
15
+ end
16
+
17
+ group :development, :test do
18
+ gem 'rake', '~>12.2.1'
19
+ gem 'rdoc'
9
20
  end
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2011-2012 Drew Tempelmeyer & Contributors
3
+ Copyright (c) 2011-2020 Drew Tempelmeyer & Contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
@@ -1,16 +1,16 @@
1
1
  = TaxCloud
2
2
 
3
- {<img src="https://travis-ci.org/drewtempelmeyer/tax_cloud.png" />}[https://travis-ci.org/drewtempelmeyer/tax_cloud]
3
+ {<img src="https://travis-ci.org/txcrb/tax_cloud.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/txcrb/tax_cloud]
4
4
 
5
5
  TaxCloud[http://www.taxcloud.com] is a free service to calculate sales tax and generate tax reports. The <tt>tax_cloud</tt> gem allows you to easily integrate with TaxCloud's API.
6
6
 
7
7
  === Getting Started
8
8
  Create a TaxCloud[http://www.taxcloud.com] merchant account at http://www.taxcloud.net. Add a website to your account under Locations[https://taxcloud.net/account/locations]. This will generate an API ID and API Key that you will need to use the service.
9
9
 
10
- TaxCloud[http://www.taxcloud.com] also offers an optional address verification API. To use it, you need a USPS (United States Postal Service) Address API UserID. To obtain your USPS UserID:
11
- 1. Download and Install the USPS Shipping Assistant from http://www.usps.com/shippingassistant.
12
- 2. Launch the USPS Shipping Assistant and go through the Shipping Assistant registration process.
13
- 3. Once you have registered for your Shipping Assistant account, you can find your USPS Shipping Assistant UserID in the "About" box, in parentheses to the right of the name of the registered user.
10
+ TaxCloud[http://www.taxcloud.com] also offers an optional address verification API. To use it, you need a USPS (United States Postal Service) Address API Username. To obtain your USPS Username:
11
+ 1. Go through the Web Tools API Portal registration process at https://registration.shippingapis.com/
12
+ 2. Once you have registered for your account, you will receive an email with your USPS username and password.
13
+ 3. Enter your USPS username in your TaxCloud initializer (see below).
14
14
 
15
15
  === Setup
16
16
  Add the gem to your Gemfile.
@@ -22,9 +22,13 @@ Configure your environment. For example, create an initializer in Rails in <tt>c
22
22
  TaxCloud.configure do |config|
23
23
  config.api_login_id = 'your_tax_cloud_api_login_id'
24
24
  config.api_key = 'your_tax_cloud_api_key'
25
- config.usps_username = 'your_usps_username'
25
+ config.usps_username = 'your_usps_username' # optional
26
+ config.open_timeout = 1 # optional
27
+ config.read_timeout = 1 # optional
26
28
  end
27
29
 
30
+ The <tt>open_timeout</tt> and <tt>read_timeout</tt> options are used to specify waiting time for the TaxCloud web service response in seconds. Default values: <tt>open_timeout = 2</tt> and <tt>read_timeout = 2</tt>.
31
+
28
32
  === Using TaxCloud
29
33
  Define the destination and origin addresses using <tt>TaxCloud::Address</tt>.
30
34
 
@@ -116,7 +120,7 @@ Tax code constants are defined in <tt>tax_code_constants.rb</tt> and tax code gr
116
120
  TAXCLOUD_API_LOGIN_ID=... TAXCLOUD_API_KEY=... TAXCLOUD_USPS_USERNAME=... tax_cloud:tax_code_groups
117
121
 
118
122
  === Tax States
119
- TaxCloud manages a list of states in which you can calculate sales tax. The default setup will only have SSUTA (Streamlined Sales and Use Tax Agreement) states enabled. All other states will return $0 for tax values. To enable other states, go to https://taxcloud.net/account/states. You can find more information about SSUTA here[http://www.streamlinedsalestax.org/index.php?page=About-Us].
123
+ TaxCloud manages a list of states in which you can calculate sales tax. The default setup will only have SSUTA (Streamlined Sales and Use Tax Agreement) states enabled. All other states will return $0 for tax values. To enable other states, go to https://taxcloud.com/go/states-management/. You can find more information about SSUTA here[http://www.streamlinedsalestax.org/index.php?page=About-Us].
120
124
 
121
125
  === Running Tests
122
126
  * VCR and WebMock are used to replay requests and avoid hitting the API each time. To refresh the mocks, simply delete the <tt>test/cassettes</tt> directory.
@@ -135,6 +139,6 @@ TaxCloud manages a list of states in which you can calculate sales tax. The defa
135
139
 
136
140
  === License
137
141
 
138
- Copyright Drew Tempelmeyer and contributors, 2011-2014.
142
+ Copyright Drew Tempelmeyer and contributors, 2011-2020.
139
143
 
140
144
  This gem is licensed under the MIT license.
data/Rakefile CHANGED
@@ -1,8 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rake/testtask'
3
5
  require 'rdoc/task'
6
+ require 'vcr'
4
7
 
5
- gemspec = eval(File.read(Dir["*.gemspec"].first))
8
+ README = 'README.rdoc'
6
9
 
7
10
  Rake::TestTask.new(:test) do |test|
8
11
  test.libs << 'lib' << 'test'
@@ -11,25 +14,18 @@ Rake::TestTask.new(:test) do |test|
11
14
  end
12
15
 
13
16
  RDoc::Task.new do |rd|
14
- README = 'README.rdoc'
15
17
  rd.main = README
16
- rd.rdoc_files.include(README, 'CHANGELOG.rdoc', 'LICENSE.rdoc', "lib/**/*.rb")
18
+ rd.rdoc_files.include(README, 'CHANGELOG.rdoc', 'LICENSE.rdoc', 'lib/**/*.rb')
17
19
  rd.rdoc_dir = 'doc'
18
20
  rd.title = 'tax_cloud'
19
21
  end
20
22
 
21
- desc "Validate the gemspec."
22
- task :gemspec do
23
- puts gemspec.validate
24
- end
25
-
26
23
  load 'lib/tasks/tax_cloud.rake'
27
24
  load 'lib/tasks/tax_codes.rake'
28
25
  load 'lib/tasks/tax_code_groups.rake'
29
-
30
26
  load 'vcr/tasks/vcr.rake'
31
27
 
32
28
  require 'rubocop/rake_task'
33
- Rubocop::RakeTask.new(:rubocop)
29
+ RuboCop::RakeTask.new(:rubocop)
34
30
 
35
- task default: [:rubocop, :test]
31
+ task default: %i[rubocop test]
@@ -16,7 +16,7 @@ en:
16
16
  \_\_end\n"
17
17
  missing_config_option:
18
18
  message: "Missing configuration option: %{name}."
19
- summary: "A configuration option was not provided when configuration TaxCloud."
19
+ summary: "A configuration option was not provided when configuring TaxCloud."
20
20
  resolution: "Review your `TaxCloud.configure` code. Are you using an environment
21
21
  variable that has not been set?"
22
22
  soap_error:
@@ -31,4 +31,4 @@ en:
31
31
  api_error:
32
32
  message: "%{message}"
33
33
  summary: "The TaxCloud server returned an error in the response: `%{raw}`"
34
- resolution: "Check the request parameters."
34
+ resolution: "Check the request parameters."
@@ -1,9 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Hash #:nodoc: all
2
4
  # Downcase the keys. Use this because <tt>TaxCloud::Address.verify</tt> requires downcased keys
3
5
  def downcase_keys
4
- reduce({}) do |h, (k, v)|
5
- h[k.downcase] = v
6
- h
7
- end
6
+ transform_keys(&:downcase)
8
7
  end
9
8
  end
@@ -1,20 +1,20 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'tax_cloud'
2
4
 
3
5
  namespace :tax_cloud do
4
-
5
- desc "Configure TaxCloud."
6
+ desc 'Configure TaxCloud.'
6
7
  task :configure do
7
8
  unless TaxCloud.configured?
8
9
  TaxCloud.configure do |config|
9
10
  config.api_login_id = ENV['TAXCLOUD_API_LOGIN_ID']
10
11
  config.api_key = ENV['TAXCLOUD_API_KEY']
11
12
  config.usps_username = ENV['TAXCLOUD_USPS_USERNAME']
12
- end
13
+ end
13
14
  Savon.configure do |config|
14
15
  config.log = false
15
16
  end
16
17
  HTTPI.log = false
17
18
  end
18
19
  end
19
-
20
20
  end
@@ -1,13 +1,14 @@
1
- namespace :tax_cloud do
1
+ # frozen_string_literal: true
2
2
 
3
- desc "Generate tax code groups."
4
- task :tax_code_groups => :configure do
5
- filename = "lib/tax_cloud/tax_code_group_constants.rb"
3
+ namespace :tax_cloud do
4
+ desc 'Generate tax code groups.'
5
+ task tax_code_groups: :configure do
6
+ filename = 'lib/tax_cloud/tax_code_group_constants.rb'
6
7
 
7
8
  begin
8
9
  groups = TaxCloud::TaxCode::Groups.all.values
9
10
 
10
- File.open filename, "wt" do |f|
11
+ File.open filename, 'wt' do |f|
11
12
  f.write "module TaxCloud\n"
12
13
  f.write " class TaxCode\n"
13
14
  f.write " # Tax Code Groups.\n"
@@ -16,9 +17,9 @@ namespace :tax_cloud do
16
17
  groups.each do |group|
17
18
  puts " #{group.description}"
18
19
  code = group.description.upcase
19
- code.gsub! /[^A-Z0-9]/, '_'
20
- code.gsub! /_$/, ''
21
- code.gsub! /\_+/, '_'
20
+ code.gsub!(/[^A-Z0-9]/, '_')
21
+ code.gsub!(/_$/, '')
22
+ code.gsub!(/_+/, '_')
22
23
  f.write " \# #{group.description}\n"
23
24
  f.write " #{code} = #{group.group_id}\n"
24
25
  end
@@ -29,11 +30,10 @@ namespace :tax_cloud do
29
30
  end
30
31
 
31
32
  puts "Done, #{filename}."
32
- rescue => e
33
- puts "ERROR: Unable to generate a new list of tax codes."
33
+ rescue StandardError => e
34
+ puts 'ERROR: Unable to generate a new list of tax codes.'
34
35
  puts e.message
35
36
  raise e
36
37
  end
37
38
  end
38
-
39
39
  end
@@ -1,15 +1,16 @@
1
- namespace :tax_cloud do
1
+ # frozen_string_literal: true
2
2
 
3
- desc "Generate tax codes."
4
- task :tax_codes => :configure do
5
- filename = "lib/tax_cloud/tax_code_constants.rb"
3
+ namespace :tax_cloud do
4
+ desc 'Generate tax codes.'
5
+ task tax_codes: :configure do
6
+ filename = 'lib/tax_cloud/tax_code_constants.rb'
6
7
 
7
8
  begin
8
9
  groups = TaxCloud::TaxCode::Groups.all.values
9
10
  groups_and_tax_codes = Hash[groups.map do |group|
10
- [ group, group.tax_codes.values ]
11
+ [group, group.tax_codes.values]
11
12
  end]
12
- File.open filename, "wt" do |f|
13
+ File.open filename, 'wt' do |f|
13
14
  f.write "module TaxCloud\n"
14
15
  f.write " # Tax Codes.\n"
15
16
  f.write " class TaxCodes\n"
@@ -20,9 +21,9 @@ namespace :tax_cloud do
20
21
  f.write " \# #{group.description}\n\n"
21
22
  tax_codes.each do |tax_code|
22
23
  code = tax_code.description.upcase
23
- code.gsub! /[^A-Z0-9]/, '_'
24
- code.gsub! /\_+$/, ''
25
- code.gsub! /\_+/, '_'
24
+ code.gsub!(/[^A-Z0-9]/, '_')
25
+ code.gsub!(/_+$/, '')
26
+ code.gsub!(/_+/, '_')
26
27
  # avoid duplicates
27
28
  code_id = codes[code] ? "#{code}_#{codes[code]}" : code
28
29
  codes[code] = (codes[code] || 0) + 1
@@ -35,11 +36,10 @@ namespace :tax_cloud do
35
36
  f.write "end\n"
36
37
  end
37
38
  puts "Done, #{filename}."
38
- rescue => e
39
- puts "ERROR: Unable to generate a new list of tax codes."
39
+ rescue StandardError => e
40
+ puts 'ERROR: Unable to generate a new list of tax codes.'
40
41
  puts e.message
41
42
  raise e
42
43
  end
43
-
44
44
  end
45
45
  end
@@ -1,6 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'savon'
2
4
  require 'i18n'
3
5
  require 'hash'
6
+
7
+ require 'active_support'
4
8
  require 'active_support/core_ext'
5
9
 
6
10
  require 'tax_cloud/version'
@@ -25,7 +29,7 @@ I18n.load_path << File.join(File.dirname(__FILE__), 'config', 'locales', 'en.yml
25
29
  # For information on configuring and using the TaxCloud API, look at the <tt>README</tt> file.
26
30
  module TaxCloud
27
31
  # WSDL location for TaxCloud API.
28
- WSDL_URL = 'https://api.taxcloud.net/1.0/?wsdl'
32
+ WSDL_URL = 'https://asmx.taxcloud.com/1.0/?wsdl'
29
33
 
30
34
  # TaxCloud API version.
31
35
  API_VERSION = '1.0'
@@ -36,7 +40,7 @@ module TaxCloud
36
40
 
37
41
  # Returns true if the gem has been configured.
38
42
  def configured?
39
- !!configuration
43
+ configuration.present?
40
44
  end
41
45
 
42
46
  # Configure the gem.
@@ -60,7 +64,8 @@ module TaxCloud
60
64
  private
61
65
 
62
66
  def check_configuration!
63
- fail TaxCloud::Errors::MissingConfig.new unless self.configuration
67
+ raise TaxCloud::Errors::MissingConfig unless self.configuration
68
+
64
69
  self.configuration.check!
65
70
  end
66
71
  end