tax_cloud 0.5.0 → 0.7.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 +4 -4
- data/.github/workflows/danger-comment.yml +18 -0
- data/.github/workflows/danger.yml +15 -0
- data/.github/workflows/lint.yml +29 -0
- data/.github/workflows/release.yml +27 -0
- data/.github/workflows/test.yml +29 -23
- data/.gitignore +1 -0
- data/.rubocop.yml +82 -6
- data/.rubocop_todo.yml +176 -23
- data/.spellcheck.txt +90 -0
- data/CHANGELOG.md +50 -61
- data/CONTRIBUTING.md +88 -0
- data/CONTRIBUTORS.txt +6 -6
- data/Dangerfile +7 -0
- data/Gemfile +16 -2
- data/LICENSE.md +3 -15
- data/README.md +48 -77
- data/RELEASING.md +39 -0
- data/Rakefile +22 -3
- data/lib/config/locales/en.yml +4 -0
- data/lib/tax_cloud/address.rb +3 -1
- data/lib/tax_cloud/errors/missing_cart_items_error.rb +13 -0
- data/lib/tax_cloud/errors/soap_error.rb +1 -1
- data/lib/tax_cloud/errors.rb +1 -0
- data/lib/tax_cloud/transaction.rb +4 -1
- data/lib/tax_cloud/version.rb +1 -1
- data/script/release.rb +15 -0
- data/tax_cloud.gemspec +1 -2
- data/test/cassettes/verify_bad_address.yml +772 -769
- data/test/cassettes/verify_good_address_with_rdi.yml +1650 -0
- data/test/test_address.rb +15 -0
- data/test/test_release.rb +82 -0
- data/test/test_transaction.rb +8 -0
- metadata +15 -3
data/lib/tax_cloud/errors.rb
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
require 'tax_cloud/errors/tax_cloud_error'
|
|
4
4
|
require 'tax_cloud/errors/missing_config_error'
|
|
5
5
|
require 'tax_cloud/errors/missing_config_option_error'
|
|
6
|
+
require 'tax_cloud/errors/missing_cart_items_error'
|
|
6
7
|
require 'tax_cloud/errors/soap_error'
|
|
7
8
|
require 'tax_cloud/errors/unexpected_soap_response_error'
|
|
8
9
|
require 'tax_cloud/errors/api_error'
|
|
@@ -28,7 +28,10 @@ module TaxCloud #:nodoc:
|
|
|
28
28
|
|
|
29
29
|
# Lookup the tax rate for the transaction.
|
|
30
30
|
# The returned information is based on the originating address, destination address, and cart items.
|
|
31
|
+
# Raises <tt>TaxCloud::Errors::MissingCartItems</tt> without calling TaxCloud when there are no cart items.
|
|
31
32
|
def lookup
|
|
33
|
+
raise TaxCloud::Errors::MissingCartItems if cart_items.nil? || cart_items.empty?
|
|
34
|
+
|
|
32
35
|
request_params = {
|
|
33
36
|
'customerID' => customer_id,
|
|
34
37
|
'cartID' => cart_id,
|
|
@@ -98,7 +101,7 @@ module TaxCloud #:nodoc:
|
|
|
98
101
|
# Marks any included cart items as returned.
|
|
99
102
|
#
|
|
100
103
|
# === Options
|
|
101
|
-
# [returned_date] The date the return
|
|
104
|
+
# [returned_date] The date the return occurred. Default is today.
|
|
102
105
|
def returned(options = {})
|
|
103
106
|
options = { returned_date: Date.today }.merge(options)
|
|
104
107
|
request_params = {
|
data/lib/tax_cloud/version.rb
CHANGED
data/script/release.rb
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'ruby-gem-release/changelog'
|
|
4
|
+
require 'ruby-gem-release/workflow/ruby_gem'
|
|
5
|
+
|
|
6
|
+
# Builds the ruby-gem-release workflow used by the Rakefile, the Release GitHub Actions workflow, and test/test_release.rb.
|
|
7
|
+
module TaxCloudRelease
|
|
8
|
+
def self.workflow(**options)
|
|
9
|
+
RubyGemRelease::Workflow::RubyGem.new(
|
|
10
|
+
version: RubyGemRelease::Version::RubyConstant.new(path: 'lib/tax_cloud/version.rb', constant: 'VERSION'),
|
|
11
|
+
changelog: RubyGemRelease::Changelog::Intridea.new(placeholder: '* Your contribution here.'),
|
|
12
|
+
**options
|
|
13
|
+
)
|
|
14
|
+
end
|
|
15
|
+
end
|