solidus_tax_cloud 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.circleci/config.yml +35 -0
- data/.gem_release.yml +5 -0
- data/.gitignore +20 -0
- data/.rspec +2 -0
- data/.rubocop.yml +7 -0
- data/.rubocop_todo.yml +132 -0
- data/CHANGELOG.md +52 -0
- data/Gemfile +33 -0
- data/LICENSE +26 -0
- data/README.md +130 -0
- data/Rakefile +6 -0
- data/TaxCloudImplementationVerificationGuide.pdf +0 -0
- data/app/assets/javascripts/spree/backend/solidus_tax_cloud.js +2 -0
- data/app/assets/javascripts/spree/frontend/solidus_tax_cloud.js +2 -0
- data/app/assets/stylesheets/spree/backend/solidus_tax_cloud.css +4 -0
- data/app/assets/stylesheets/spree/backend/solidus_tax_cloud.scss +0 -0
- data/app/assets/stylesheets/spree/frontend/solidus_tax_cloud.css +4 -0
- data/app/decorators/models/solidus_tax_cloud/spree/app_configuration_decorator.rb +18 -0
- data/app/decorators/models/solidus_tax_cloud/spree/line_item_decorator.rb +47 -0
- data/app/decorators/models/solidus_tax_cloud/spree/order_decorator.rb +42 -0
- data/app/decorators/models/solidus_tax_cloud/spree/product_decorator.rb +25 -0
- data/app/decorators/models/solidus_tax_cloud/spree/shipment_decorator.rb +27 -0
- data/app/models/spree/calculator/tax_cloud_calculator.rb +111 -0
- data/app/models/spree/tax_cloud.rb +66 -0
- data/app/overrides/spree/admin/products/_form.rb +9 -0
- data/app/overrides/spree/admin/shared/_configuration_menu.rb +9 -0
- data/bin/console +17 -0
- data/bin/r +15 -0
- data/bin/rails +15 -0
- data/bin/rake +7 -0
- data/bin/sandbox +84 -0
- data/bin/sandbox_rails +18 -0
- data/bin/setup +8 -0
- data/config/initializers/tax_cloud_usps_username.rb +5 -0
- data/config/locales/en.yml +13 -0
- data/config/routes.rb +7 -0
- data/db/migrate/20121220192438_create_spree_tax_cloud_transactions.rb +13 -0
- data/db/migrate/20121220193944_create_spree_tax_cloud_cart_items.rb +22 -0
- data/db/migrate/20130829215819_fix_scale_of_cart_item_prices.rb +15 -0
- data/db/migrate/20140623225628_add_tic_to_products.rb +11 -0
- data/lib/assets/javascripts/spree/frontend/solidus_tax_cloud.js.erb +1 -0
- data/lib/assets/stylesheets/spree/frontend/solidus_tax_cloud.css.erb +5 -0
- data/lib/controllers/backend/spree/admin/tax_cloud_settings_controller.rb +29 -0
- data/lib/decorators/backend/controllers/solidus_tax_cloud/spree/admin/orders_controller_decorator.rb +21 -0
- data/lib/decorators/frontend/controllers/solidus_tax_cloud/spree/checkout_controller_decorator.rb +24 -0
- data/lib/generators/solidus_tax_cloud/install/install_generator.rb +29 -0
- data/lib/generators/solidus_tax_cloud/templates/ca-bundle.crt +3895 -0
- data/lib/solidus_tax_cloud.rb +10 -0
- data/lib/solidus_tax_cloud/engine.rb +23 -0
- data/lib/solidus_tax_cloud/error.rb +6 -0
- data/lib/solidus_tax_cloud/factories.rb +4 -0
- data/lib/solidus_tax_cloud/version.rb +5 -0
- data/lib/tasks/.gitkeep +0 -0
- data/lib/tasks/tax_cloud.rake +74 -0
- data/lib/views/backend/spree/admin/products/_edit_tax_cloud_tic.html.erb +6 -0
- data/lib/views/backend/spree/admin/tax_cloud_settings/edit.html.erb +32 -0
- data/solidus_tax_cloud.gemspec +39 -0
- data/spec/features/checkout_spec.rb +511 -0
- data/spec/models/tax_cloud_api_spec.rb +192 -0
- data/spec/spec_helper.rb +27 -0
- data/spec/support/capybara.rb +20 -0
- data/spec/support/tax_cloud.rb +20 -0
- data/spec/support/transactions.rb +5 -0
- metadata +204 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 20b4d66520389e051076fdd58aa7de4080eeeffee2babf41452b45b8689a63f8
|
4
|
+
data.tar.gz: 001a5eef20c3bff00fc4f13a187e48e5c4f5c359cc67e1fd306b8f5d824982f8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: eb8ad3bafea4e12d9a02d5662cce6b6d1bb5bf1023de66823d4a564d16e4d50ba28df5333208bced389c6fd47216154d5f1633f4f3232080ea0942fd061ec412
|
7
|
+
data.tar.gz: c5d9c12d8dc9e6c84815fac5aa6bcb9fa56d011099ffd4deb50c03c311b866ef61eba86a6655f46759e0b0fe41e74df01ec5c232918c804f3c6ae8f57db15f7a
|
@@ -0,0 +1,35 @@
|
|
1
|
+
version: 2.1
|
2
|
+
|
3
|
+
orbs:
|
4
|
+
# Always take the latest version of the orb, this allows us to
|
5
|
+
# run specs against Solidus supported versions only without the need
|
6
|
+
# to change this configuration every time a Solidus version is released
|
7
|
+
# or goes EOL.
|
8
|
+
solidusio_extensions: solidusio/extensions@volatile
|
9
|
+
|
10
|
+
jobs:
|
11
|
+
run-specs-with-postgres:
|
12
|
+
executor: solidusio_extensions/postgres
|
13
|
+
steps:
|
14
|
+
- solidusio_extensions/run-tests
|
15
|
+
run-specs-with-mysql:
|
16
|
+
executor: solidusio_extensions/mysql
|
17
|
+
steps:
|
18
|
+
- solidusio_extensions/run-tests
|
19
|
+
|
20
|
+
workflows:
|
21
|
+
"Run specs on supported Solidus versions":
|
22
|
+
jobs:
|
23
|
+
- run-specs-with-postgres
|
24
|
+
- run-specs-with-mysql
|
25
|
+
"Weekly run specs against master":
|
26
|
+
triggers:
|
27
|
+
- schedule:
|
28
|
+
cron: "0 0 * * 4" # every Thursday
|
29
|
+
filters:
|
30
|
+
branches:
|
31
|
+
only:
|
32
|
+
- master
|
33
|
+
jobs:
|
34
|
+
- run-specs-with-postgres
|
35
|
+
- run-specs-with-mysql
|
data/.gem_release.yml
ADDED
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,132 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2020-01-21 15:17:04 +0100 using RuboCop version 0.76.0.
|
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: 7
|
10
|
+
# Cop supports --auto-correct.
|
11
|
+
Capybara/CurrentPathExpectation:
|
12
|
+
Exclude:
|
13
|
+
- 'spec/features/checkout_spec.rb'
|
14
|
+
|
15
|
+
# Offense count: 1
|
16
|
+
Lint/AmbiguousOperator:
|
17
|
+
Exclude:
|
18
|
+
- 'lib/solidus_tax_cloud/engine.rb'
|
19
|
+
|
20
|
+
# Offense count: 1
|
21
|
+
# Configuration parameters: AllowComments.
|
22
|
+
Lint/HandleExceptions:
|
23
|
+
Exclude:
|
24
|
+
- 'app/models/spree/tax_cloud.rb'
|
25
|
+
|
26
|
+
# Offense count: 1
|
27
|
+
Lint/ShadowingOuterLocalVariable:
|
28
|
+
Exclude:
|
29
|
+
- 'spec/support/tax_cloud.rb'
|
30
|
+
|
31
|
+
# Offense count: 1
|
32
|
+
Lint/UselessAssignment:
|
33
|
+
Exclude:
|
34
|
+
- 'spec/features/checkout_spec.rb'
|
35
|
+
|
36
|
+
# Offense count: 1
|
37
|
+
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist, MethodDefinitionMacros.
|
38
|
+
# NamePrefix: is_, has_, have_
|
39
|
+
# NamePrefixBlacklist: is_, has_, have_
|
40
|
+
# NameWhitelist: is_a?
|
41
|
+
# MethodDefinitionMacros: define_method, define_singleton_method
|
42
|
+
Naming/PredicateName:
|
43
|
+
Exclude:
|
44
|
+
- 'spec/**/*'
|
45
|
+
- 'app/decorators/models/solidus_tax_cloud/spree/order_decorator.rb'
|
46
|
+
|
47
|
+
# Offense count: 2
|
48
|
+
RSpec/DescribeClass:
|
49
|
+
Exclude:
|
50
|
+
- 'spec/features/checkout_spec.rb'
|
51
|
+
- 'spec/models/tax_cloud_api_spec.rb'
|
52
|
+
|
53
|
+
# Offense count: 14
|
54
|
+
RSpec/LetSetup:
|
55
|
+
Exclude:
|
56
|
+
- 'spec/features/checkout_spec.rb'
|
57
|
+
|
58
|
+
# Offense count: 21
|
59
|
+
# Configuration parameters: AggregateFailuresByDefault.
|
60
|
+
RSpec/MultipleExpectations:
|
61
|
+
Max: 11
|
62
|
+
|
63
|
+
# Offense count: 4
|
64
|
+
RSpec/RepeatedExample:
|
65
|
+
Exclude:
|
66
|
+
- 'spec/features/checkout_spec.rb'
|
67
|
+
- 'spec/models/tax_cloud_api_spec.rb'
|
68
|
+
|
69
|
+
# Offense count: 1
|
70
|
+
# Configuration parameters: EnforcedStyle.
|
71
|
+
# SupportedStyles: slashes, arguments
|
72
|
+
Rails/FilePath:
|
73
|
+
Exclude:
|
74
|
+
- 'lib/tasks/tax_cloud.rake'
|
75
|
+
|
76
|
+
# Offense count: 1
|
77
|
+
# Cop supports --auto-correct.
|
78
|
+
# Configuration parameters: Include.
|
79
|
+
# Include: app/models/**/*.rb
|
80
|
+
Rails/FindBy:
|
81
|
+
Exclude:
|
82
|
+
- 'app/models/spree/tax_cloud.rb'
|
83
|
+
|
84
|
+
# Offense count: 2
|
85
|
+
# Configuration parameters: Include.
|
86
|
+
# Include: **/Rakefile, **/*.rake
|
87
|
+
Rails/RakeEnvironment:
|
88
|
+
Exclude:
|
89
|
+
- 'lib/tasks/tax_cloud.rake'
|
90
|
+
|
91
|
+
# Offense count: 1
|
92
|
+
# Configuration parameters: Blacklist, Whitelist.
|
93
|
+
# Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters
|
94
|
+
Rails/SkipsModelValidations:
|
95
|
+
Exclude:
|
96
|
+
- 'spec/features/checkout_spec.rb'
|
97
|
+
|
98
|
+
# Offense count: 1
|
99
|
+
# Cop supports --auto-correct.
|
100
|
+
# Configuration parameters: AutoCorrect, EnforcedStyle.
|
101
|
+
# SupportedStyles: nested, compact
|
102
|
+
Style/ClassAndModuleChildren:
|
103
|
+
Exclude:
|
104
|
+
- 'app/models/spree/calculator/tax_cloud_calculator.rb'
|
105
|
+
|
106
|
+
# Offense count: 6
|
107
|
+
# Configuration parameters: MinBodyLength.
|
108
|
+
Style/GuardClause:
|
109
|
+
Exclude:
|
110
|
+
- 'app/controllers/spree/admin/tax_cloud_settings_controller.rb'
|
111
|
+
- 'app/decorators/models/solidus_tax_cloud/spree/line_item_decorator.rb'
|
112
|
+
- 'app/decorators/models/solidus_tax_cloud/spree/shipment_decorator.rb'
|
113
|
+
- 'app/models/spree/calculator/tax_cloud_calculator.rb'
|
114
|
+
- 'lib/solidus_tax_cloud/engine.rb'
|
115
|
+
|
116
|
+
# Offense count: 1
|
117
|
+
# Configuration parameters: AllowIfModifier.
|
118
|
+
Style/IfInsideElse:
|
119
|
+
Exclude:
|
120
|
+
- 'lib/tasks/tax_cloud.rake'
|
121
|
+
|
122
|
+
# Offense count: 1
|
123
|
+
Style/MixinUsage:
|
124
|
+
Exclude:
|
125
|
+
- 'lib/tasks/tax_cloud.rake'
|
126
|
+
|
127
|
+
# Offense count: 62
|
128
|
+
# Cop supports --auto-correct.
|
129
|
+
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
130
|
+
# URISchemes: http, https
|
131
|
+
Metrics/LineLength:
|
132
|
+
Max: 260
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## [v1.0.0](https://github.com/solidusio-contrib/solidus_tax_cloud/tree/v1.0.0) (2020-06-05)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/solidusio-contrib/solidus_tax_cloud/compare/aaf557d4c0635f5e7d4211fff6c519f95d6e882c...v1.0.0)
|
6
|
+
|
7
|
+
**Fixed bugs:**
|
8
|
+
|
9
|
+
- Revert removal of `require 'tax\_cloud'` in \#34 [\#37](https://github.com/solidusio-contrib/solidus_tax_cloud/pull/37) ([brchristian](https://github.com/brchristian))
|
10
|
+
|
11
|
+
**Closed issues:**
|
12
|
+
|
13
|
+
- DEPRECATION WARNING: SolidusSupport::EngineExtensions::Decorators is deprecated! [\#42](https://github.com/solidusio-contrib/solidus_tax_cloud/issues/42)
|
14
|
+
- PR \#34 Broke Extension [\#36](https://github.com/solidusio-contrib/solidus_tax_cloud/issues/36)
|
15
|
+
- Dependabot couldn't find a Gemfile-local for this project [\#35](https://github.com/solidusio-contrib/solidus_tax_cloud/issues/35)
|
16
|
+
- Dependabot can't resolve your Ruby dependency files [\#33](https://github.com/solidusio-contrib/solidus_tax_cloud/issues/33)
|
17
|
+
- Dependabot can't resolve your Ruby dependency files [\#32](https://github.com/solidusio-contrib/solidus_tax_cloud/issues/32)
|
18
|
+
- Dependabot can't resolve your Ruby dependency files [\#31](https://github.com/solidusio-contrib/solidus_tax_cloud/issues/31)
|
19
|
+
- Dependabot can't resolve your Ruby dependency files [\#29](https://github.com/solidusio-contrib/solidus_tax_cloud/issues/29)
|
20
|
+
- Dependabot can't resolve your Ruby dependency files [\#28](https://github.com/solidusio-contrib/solidus_tax_cloud/issues/28)
|
21
|
+
- Dependabot can't resolve your Ruby dependency files [\#27](https://github.com/solidusio-contrib/solidus_tax_cloud/issues/27)
|
22
|
+
- solids\_tax\_cloud does not work for Rails version 5.2.0 and above [\#18](https://github.com/solidusio-contrib/solidus_tax_cloud/issues/18)
|
23
|
+
- Tests don't pass on Solidus 2.6 [\#14](https://github.com/solidusio-contrib/solidus_tax_cloud/issues/14)
|
24
|
+
- Configuration is wiped every time I restart server [\#4](https://github.com/solidusio-contrib/solidus_tax_cloud/issues/4)
|
25
|
+
- USPS ID is no longer required by TaxCloud API [\#3](https://github.com/solidusio-contrib/solidus_tax_cloud/issues/3)
|
26
|
+
- Translations missing for form labels [\#2](https://github.com/solidusio-contrib/solidus_tax_cloud/issues/2)
|
27
|
+
- Compatibility with Solidus 2.1.0? [\#1](https://github.com/solidusio-contrib/solidus_tax_cloud/issues/1)
|
28
|
+
|
29
|
+
**Merged pull requests:**
|
30
|
+
|
31
|
+
- Update extension template with solidus\_dev\_support [\#43](https://github.com/solidusio-contrib/solidus_tax_cloud/pull/43) ([aldesantis](https://github.com/aldesantis))
|
32
|
+
- Handle combined Address first name and last name [\#41](https://github.com/solidusio-contrib/solidus_tax_cloud/pull/41) ([filippoliverani](https://github.com/filippoliverani))
|
33
|
+
- Relax Solidus Support dependency [\#40](https://github.com/solidusio-contrib/solidus_tax_cloud/pull/40) ([kennyadsl](https://github.com/kennyadsl))
|
34
|
+
- Fix Dependabot looking for Gemfile-local [\#38](https://github.com/solidusio-contrib/solidus_tax_cloud/pull/38) ([aldesantis](https://github.com/aldesantis))
|
35
|
+
- Upgrade the extension using solidus\_dev\_support [\#34](https://github.com/solidusio-contrib/solidus_tax_cloud/pull/34) ([blocknotes](https://github.com/blocknotes))
|
36
|
+
- rename solidus\_extension\_dev\_tools -\> solidus\_dev\_support [\#30](https://github.com/solidusio-contrib/solidus_tax_cloud/pull/30) ([brchristian](https://github.com/brchristian))
|
37
|
+
- Fix grammar/syntax in checkout\_spec [\#26](https://github.com/solidusio-contrib/solidus_tax_cloud/pull/26) ([brchristian](https://github.com/brchristian))
|
38
|
+
- Adopt solidus\_extension\_dev\_tools [\#25](https://github.com/solidusio-contrib/solidus_tax_cloud/pull/25) ([aldesantis](https://github.com/aldesantis))
|
39
|
+
- Fix CircleCI build [\#22](https://github.com/solidusio-contrib/solidus_tax_cloud/pull/22) ([aldesantis](https://github.com/aldesantis))
|
40
|
+
- Adopt CircleCI instead of Travis [\#21](https://github.com/solidusio-contrib/solidus_tax_cloud/pull/21) ([aldesantis](https://github.com/aldesantis))
|
41
|
+
- Fix Travis build [\#20](https://github.com/solidusio-contrib/solidus_tax_cloud/pull/20) ([aitbw](https://github.com/aitbw))
|
42
|
+
- Fix race conditions with asynchronous cache stores [\#19](https://github.com/solidusio-contrib/solidus_tax_cloud/pull/19) ([aldesantis](https://github.com/aldesantis))
|
43
|
+
- Add deface dependency [\#17](https://github.com/solidusio-contrib/solidus_tax_cloud/pull/17) ([alepore](https://github.com/alepore))
|
44
|
+
- Adds Travis test matrix for versions supported by master [\#15](https://github.com/solidusio-contrib/solidus_tax_cloud/pull/15) ([jeffreyguenther](https://github.com/jeffreyguenther))
|
45
|
+
- Revises tax calculations to account for discounts [\#13](https://github.com/solidusio-contrib/solidus_tax_cloud/pull/13) ([jeffreyguenther](https://github.com/jeffreyguenther))
|
46
|
+
- Fixes whitespace matches [\#12](https://github.com/solidusio-contrib/solidus_tax_cloud/pull/12) ([jeffreyguenther](https://github.com/jeffreyguenther))
|
47
|
+
- Adds puma to Gemfile [\#11](https://github.com/solidusio-contrib/solidus_tax_cloud/pull/11) ([jeffreyguenther](https://github.com/jeffreyguenther))
|
48
|
+
- Adding missing translations for the form labels [\#5](https://github.com/solidusio-contrib/solidus_tax_cloud/pull/5) ([funwhilelost](https://github.com/funwhilelost))
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
|
data/Gemfile
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
5
|
+
|
6
|
+
branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
|
7
|
+
gem 'solidus', github: 'solidusio/solidus', branch: branch
|
8
|
+
|
9
|
+
# Needed to help Bundler figure out how to resolve dependencies,
|
10
|
+
# otherwise it takes forever to resolve them.
|
11
|
+
# See https://github.com/bundler/bundler/issues/6677
|
12
|
+
gem 'rails', '>0.a'
|
13
|
+
|
14
|
+
# Provides basic authentication functionality for testing parts of your engine
|
15
|
+
gem 'solidus_auth_devise'
|
16
|
+
|
17
|
+
case ENV['DB']
|
18
|
+
when 'mysql'
|
19
|
+
gem 'mysql2'
|
20
|
+
when 'postgresql'
|
21
|
+
gem 'pg'
|
22
|
+
else
|
23
|
+
gem 'sqlite3'
|
24
|
+
end
|
25
|
+
|
26
|
+
gemspec
|
27
|
+
|
28
|
+
# Use a local Gemfile to include development dependencies that might not be
|
29
|
+
# relevant for the project or for other contributors, e.g. pry-byebug.
|
30
|
+
#
|
31
|
+
# We use `send` instead of calling `eval_gemfile` to work around an issue with
|
32
|
+
# how Dependabot parses projects: https://github.com/dependabot/dependabot-core/issues/1658.
|
33
|
+
send(:eval_gemfile, 'Gemfile-local') if File.exist? 'Gemfile-local'
|
data/LICENSE
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
Copyright (c) 2012 Jerrold Thompson
|
2
|
+
All rights reserved.
|
3
|
+
|
4
|
+
Redistribution and use in source and binary forms, with or without modification,
|
5
|
+
are permitted provided that the following conditions are met:
|
6
|
+
|
7
|
+
* Redistributions of source code must retain the above copyright notice,
|
8
|
+
this list of conditions and the following disclaimer.
|
9
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
10
|
+
this list of conditions and the following disclaimer in the documentation
|
11
|
+
and/or other materials provided with the distribution.
|
12
|
+
* Neither the name Solidus nor the names of its contributors may be used to
|
13
|
+
endorse or promote products derived from this software without specific
|
14
|
+
prior written permission.
|
15
|
+
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
20
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
21
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
22
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
23
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
24
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
25
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
26
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.md
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
# Solidus::TaxCloud
|
2
|
+
|
3
|
+
[![CircleCI](https://circleci.com/gh/solidusio-contrib/solidus_tax_cloud.svg?style=svg)](https://circleci.com/gh/solidusio-contrib/solidus_tax_cloud)
|
4
|
+
|
5
|
+
Solidus::TaxCloud is a US sales tax extension for Solidus using the Tax Cloud service.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
### Set up your TaxCloud account
|
10
|
+
|
11
|
+
If you don't have TaxCloud credentials, now is the time to create them. Sign up for a
|
12
|
+
[TaxCloud](https://taxcloud.com) account and note your API ID and API key.
|
13
|
+
|
14
|
+
Once you have the credentials, go to Your Account -> Tax States in the TaxCloud dashboard and turn
|
15
|
+
on sales tax collection for the states where you wish to collect sales tax.
|
16
|
+
|
17
|
+
### Set up Solidus::TaxCloud
|
18
|
+
|
19
|
+
Once you have an account, add this extension to your Gemfile:
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
gem 'solidus_tax_cloud', github: 'solidusio-contrib/solidus_tax_cloud'
|
23
|
+
```
|
24
|
+
|
25
|
+
Install the gem:
|
26
|
+
|
27
|
+
```console
|
28
|
+
$ bundle install
|
29
|
+
```
|
30
|
+
|
31
|
+
Run the installer:
|
32
|
+
|
33
|
+
```console
|
34
|
+
$ bundle exec rails g solidus_tax_cloud:install
|
35
|
+
```
|
36
|
+
|
37
|
+
Configure the extension with your TaxCloud credentials:
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
TaxCloud.configure do |config|
|
41
|
+
config.api_login_id = 'YOUR_TAX_CLOUD_API_ID'
|
42
|
+
config.api_key = 'YOUR_TAX_CLOUD_API_KEY'
|
43
|
+
end
|
44
|
+
```
|
45
|
+
|
46
|
+
Finally, go to the Solidus backend and create a tax rate in order to apply rates obtained from
|
47
|
+
TaxCloud to your line items and shipments. You can use the following configuration:
|
48
|
+
|
49
|
+
- Name: Sales Tax
|
50
|
+
- Zone: USA
|
51
|
+
- Rate: 0.0 (because the actual rates will be applied by the calculator)
|
52
|
+
- Tax Category: Taxable
|
53
|
+
- Included in Price: no
|
54
|
+
- Show Rate in Label: no
|
55
|
+
- Calculator: Tax Cloud
|
56
|
+
|
57
|
+
If you wish, you may also configure the default Product TIC and Shipping TIC for TaxCloud to use in
|
58
|
+
Settings -> Store -> TaxCloud Settings. It is recommended to leave the defaults (`00000` for
|
59
|
+
products and `11010` for shipping) unless you know what you're doing.
|
60
|
+
|
61
|
+
## Usage
|
62
|
+
|
63
|
+
Product-level TICs may be specified in the Products section of the Solidus backend. If you are
|
64
|
+
uncertain about the correct TIC for a product, you can get the TIC from
|
65
|
+
[TaxCloud](https://taxcloud.com/tic).
|
66
|
+
|
67
|
+
Other than that, everything should work automatically! Sales tax rates will be retrieved from
|
68
|
+
TaxCloud and applied to your orders.
|
69
|
+
|
70
|
+
### Gotchas
|
71
|
+
|
72
|
+
Here are a few things to keep in mind:
|
73
|
+
|
74
|
+
- Solidus::TaxCloud is designed to function in a single TaxCategory. It is expected that all
|
75
|
+
products and shipping methods are in the same tax category as the one configured for the TaxCloud
|
76
|
+
tax rate.
|
77
|
+
- Solidus::TaxCloud is designed to perform all US-related tax calculation itself, and does not use
|
78
|
+
Solidus configurations like tax categories to determine whether goods are taxable, tax-exempt etc.
|
79
|
+
- Solidus::TaxCloud does not use the Solidus configuration `tax_address` (which specifies whether
|
80
|
+
the shipping or billing address should be used to compute tax). Instead, it _always_ uses the
|
81
|
+
shipping address if possible, only falling back to the billing address if the shipping address is
|
82
|
+
`nil`.
|
83
|
+
|
84
|
+
## Testing
|
85
|
+
|
86
|
+
First bundle your dependencies, then run `bin/rake`. `bin/rake` will default to building the dummy
|
87
|
+
app if it does not exist, then it will run specs. The dummy app can be regenerated by using
|
88
|
+
`bin/rake extension:test_app`.
|
89
|
+
|
90
|
+
```shell
|
91
|
+
bundle
|
92
|
+
bin/rake
|
93
|
+
```
|
94
|
+
|
95
|
+
To run [Rubocop](https://github.com/bbatsov/rubocop) static code analysis run
|
96
|
+
|
97
|
+
```shell
|
98
|
+
bundle exec rubocop
|
99
|
+
```
|
100
|
+
|
101
|
+
When testing your application's integration with this extension you may use its factories.
|
102
|
+
Simply add this require statement to your spec_helper:
|
103
|
+
|
104
|
+
```ruby
|
105
|
+
require '<%= file_name %>/factories'
|
106
|
+
```
|
107
|
+
|
108
|
+
## Sandbox app
|
109
|
+
|
110
|
+
To run this extension in a sandboxed Solidus application, you can run `bin/sandbox`. The path for
|
111
|
+
the sandbox app is `./sandbox` and `bin/rails` will forward any Rails command to
|
112
|
+
`sandbox/bin/rails`. Here's an example:
|
113
|
+
|
114
|
+
```shell
|
115
|
+
$ bin/rails server
|
116
|
+
=> Booting Puma
|
117
|
+
=> Rails 6.0.2.1 application starting in development
|
118
|
+
* Listening on tcp://127.0.0.1:3000
|
119
|
+
Use Ctrl-C to stop
|
120
|
+
```
|
121
|
+
|
122
|
+
## Releasing
|
123
|
+
|
124
|
+
New extension versions can be released using `gem-release` like this:
|
125
|
+
|
126
|
+
```shell
|
127
|
+
bundle exec gem bump -v VERSION --tag --push --remote upstream && gem release
|
128
|
+
```
|
129
|
+
|
130
|
+
Copyright (c) 2012 Jerrold Thompson, released under the New BSD License.
|