spree_avatax_official 1.7.1 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +115 -0
  3. data/Gemfile +15 -6
  4. data/LICENSE +1 -1
  5. data/README.md +1 -1
  6. data/app/controllers/spree/admin/avatax_settings_controller.rb +1 -1
  7. data/app/models/avatax/request_decorator.rb +3 -1
  8. data/app/models/spree_avatax_official/spree/user_decorator.rb +1 -1
  9. data/app/services/spree_avatax_official/generate_transaction_cache_key_service.rb +1 -1
  10. data/app/views/spree/admin/avalara_entity_use_codes/edit.html.erb +1 -1
  11. data/app/views/spree/admin/avalara_entity_use_codes/new.html.erb +1 -1
  12. data/app/views/spree/admin/users/avalara_information.html.erb +2 -2
  13. data/lib/generators/spree_avatax_official/install/templates/config/initializers/spree_avatax_official.rb +11 -9
  14. data/lib/spree_avatax_official/configuration.rb +20 -0
  15. data/lib/spree_avatax_official/engine.rb +4 -2
  16. data/lib/spree_avatax_official/version.rb +1 -1
  17. data/spec/factories/spree/avatax_order_factory.rb +2 -0
  18. data/spec/factories/usa_address_factory.rb +1 -1
  19. data/spec/lib/spree_avatax_official/seeder_spec.rb +0 -1
  20. data/spec/spec_helper.rb +3 -0
  21. data/spec/support/vcr.rb +13 -0
  22. data/spec/vcr/SpreeAvataxOfficial_Transactions_FindOrderTransactionService/_call/with_Spree_Order/when_order_does_NOT_have_a_SalesInvoice_transaction/when_transaction_does_NOT_exist_in_avatax/returns_failure.yml +46 -2
  23. data/spec/vcr/SpreeAvataxOfficial_Transactions_FindOrderTransactionService/_call/with_Spree_Order/when_order_does_NOT_have_a_SalesInvoice_transaction/when_transaction_exists_in_avatax/returns_success_and_creates_a_new_SalesInvoice_transaction.yml +46 -2
  24. data/spree_avatax_official.gemspec +3 -3
  25. metadata +14 -32
  26. data/.travis.yml +0 -78
  27. data/Appraisals +0 -49
  28. data/gemfiles/spree_3_1.gemfile +0 -16
  29. data/gemfiles/spree_3_7.gemfile +0 -13
  30. data/gemfiles/spree_4_0.gemfile +0 -14
  31. data/gemfiles/spree_4_1.gemfile +0 -14
  32. data/gemfiles/spree_4_2.gemfile +0 -14
  33. data/gemfiles/spree_master.gemfile +0 -14
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c11e32278f060728b89bad98e554c869b8751b109ec0d991912160292c950440
4
- data.tar.gz: b5c21921f675f85d46fe99065eeaead6ddbfd0c580b77d35457fdefa1bb4e4a8
3
+ metadata.gz: d13bf7b694d8c9b6efe525686532f59b7e31549b53f0bd117f26b5064b95f70c
4
+ data.tar.gz: c54628d389689c43ef49bb7e408bc4dad98a2a19a6b9478f53b4ee1b71df2fe4
5
5
  SHA512:
6
- metadata.gz: 3f598d0d05a4a729b3fc7e2a0a2ae94ef166858ce7aac5c766197644589254d0cdca7aecd041b0679a8537ab9edc4c20fb38f1f7ec0d59b7229e92c62eb10fb0
7
- data.tar.gz: dc9688d27b5d809dadff25212deaed7231d1648fc4c0f7765048c92458d65f344ffb783c4f5ead8a91ad6a6cd828ce5387fc376e29d006d54c126d883ba893c2
6
+ metadata.gz: 8cc63f004da79486591e5f6ae4a55b9a412e9eb3bd0be3210d37eb24eca10c19654896fd7400b698a893c390c112869b256496d17122965e02519086d0cb5d61
7
+ data.tar.gz: ae4c87f21dcc95427abeedd6c9000ce29717c47604518c93626bc60e0d9acd9684777ab131a8c1820cf7c6eb098007de37608f089e05d2817f4584c2e51c9a13
@@ -0,0 +1,115 @@
1
+ version: 2.1
2
+
3
+ defaults: &defaults
4
+ environment: &environment
5
+ CIRCLE_TEST_REPORTS: /tmp/test-results
6
+ CIRCLE_ARTIFACTS: /tmp/test-artifacts
7
+ BUNDLE_JOBS: 4
8
+ BUNDLE_RETRY: 3
9
+ BUNDLE_PATH: ~/spree/vendor/bundle
10
+ working_directory: ~/spree
11
+ docker:
12
+ - image: &ruby_image cimg/ruby:3.3-browsers
13
+
14
+ run_tests: &run_tests
15
+ <<: *defaults
16
+ steps:
17
+ - checkout
18
+ - restore_cache:
19
+ keys:
20
+ - spree-bundle-{{ .Branch }}
21
+ - spree-bundle
22
+ - run:
23
+ name: Add keyserver
24
+ command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
25
+ - run:
26
+ name: Install libvips
27
+ command: sudo apt-get update && sudo apt-get install libvips
28
+ - run:
29
+ name: Set bundle path
30
+ command: bundle config --local path vendor/bundle
31
+ - run:
32
+ name: Ensure bundle Install
33
+ command: |
34
+ bundle check || bundle install
35
+ - run:
36
+ name: Create test app
37
+ command: |
38
+ bundle exec rake test_app
39
+ - run:
40
+ name: Run Rspec
41
+ command: |
42
+ TESTFILES=$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
43
+ bundle exec rspec --format documentation \
44
+ --format RspecJunitFormatter \
45
+ -o ~/rspec/rspec.xml \
46
+ -- ${TESTFILES}
47
+ - store_test_results:
48
+ path: ~/rspec
49
+ - store_artifacts:
50
+ path: tmp/capybara
51
+
52
+ jobs:
53
+ bundle:
54
+ <<: *defaults
55
+ steps:
56
+ - checkout
57
+ - restore_cache:
58
+ keys:
59
+ - spree-bundle-{{ .Branch }}
60
+ - spree-bundle
61
+ - run:
62
+ name: Add keyserver
63
+ command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4EB27DB2A3B88B8B
64
+ - run:
65
+ name: Install libvips
66
+ command: sudo apt-get update && sudo apt-get install libvips
67
+ - run:
68
+ name: Set bundle path
69
+ command: bundle config --local path vendor/bundle
70
+ - run:
71
+ name: Bundle Install
72
+ command: |
73
+ bundle check || bundle install
74
+ - save_cache:
75
+ paths:
76
+ - vendor/bundle
77
+ key: spree-bundle-{{ checksum "Gemfile.lock" }}
78
+
79
+ tests_postgres: &tests_postgres
80
+ <<: *run_tests
81
+ environment: &postgres_environment
82
+ <<: *environment
83
+ DB: postgres
84
+ DB_HOST: localhost
85
+ DB_USERNAME: postgres
86
+ docker:
87
+ - image: *ruby_image
88
+ - image: &postgres_image cimg/postgres:16.2
89
+ environment:
90
+ POSTGRES_USER: postgres
91
+
92
+ tests_mysql: &tests_mysql
93
+ <<: *run_tests
94
+ environment: &mysql_environment
95
+ <<: *environment
96
+ DB: mysql
97
+ DB_HOST: 127.0.0.1
98
+ DB_USERNAME: root
99
+ COVERAGE: true
100
+ COVERAGE_DIR: /tmp/workspace/simplecov
101
+ docker:
102
+ - image: *ruby_image
103
+ - image: &mysql_image cimg/mysql:8.0
104
+
105
+ workflows:
106
+ version: 2
107
+ main:
108
+ jobs:
109
+ - bundle
110
+ - tests_postgres:
111
+ requires:
112
+ - bundle
113
+ - tests_mysql:
114
+ requires:
115
+ - bundle
data/Gemfile CHANGED
@@ -6,11 +6,20 @@ git_source(:github) do |repo_name|
6
6
  end
7
7
 
8
8
  gem 'rails-controller-testing'
9
- gem 'rubocop', '~> 0.63.0', require: false
10
- gem 'rubocop-rspec', require: false
11
- gem 'spree_auth_devise'
12
- gem 'spree_backend'
13
- gem 'spree_core'
14
- gem 'sass-rails'
9
+ gem 'spree', github: 'spree/spree', branch: 'main'
10
+ gem 'spree_backend', github: 'spree/spree_backend', branch: 'main'
11
+ gem 'spree_emails', github: 'spree/spree', branch: 'main'
12
+ gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: 'main'
13
+
14
+ if ENV['DB'] == 'mysql'
15
+ gem 'mysql2'
16
+ elsif ENV['DB'] == 'postgres'
17
+ gem 'pg'
18
+ else
19
+ gem 'sqlite3', '~> 1.4'
20
+ end
21
+
22
+ gem 'webdrivers'
23
+ gem 'pry'
15
24
 
16
25
  gemspec
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2019 Spark Solutions
1
+ Copyright (c) 2019-2024 Spark Solutions Sp. z o.o.
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without modification,
data/README.md CHANGED
@@ -46,7 +46,7 @@ For more information, support and guidance on how to implement Spree AvaTax V2 e
46
46
 
47
47
  1. Add this extension to your `Gemfile` with this line:
48
48
  ```ruby
49
- gem 'spree_avatax_official', github: 'spree-contrib/spree_avatax_official'
49
+ gem 'spree_avatax_official'
50
50
  ```
51
51
 
52
52
  2. Install the gem using Bundler:
@@ -4,7 +4,7 @@ module Spree
4
4
  def edit
5
5
  @ship_from_address = SpreeAvataxOfficial::Config.ship_from_address
6
6
  @country = if @ship_from_address[:country].blank?
7
- Spree::Country.default
7
+ current_store.default_country
8
8
  else
9
9
  Spree::Country.find_by(iso3: @ship_from_address[:country])
10
10
  end
@@ -2,10 +2,12 @@ module Avatax
2
2
  module RequestDecorator
3
3
  include ::SpreeAvataxOfficial::HttpHelper
4
4
 
5
- def request(method, path, model, options = {})
5
+ def request(method, path, model, options = {}, apiversion="", headers=Hash.new)
6
6
  max_retries ||= ::SpreeAvataxOfficial::Config.max_retries
7
7
  uri_encoded_path = URI.parse(path).to_s
8
8
  response = connection.send(method) do |request|
9
+ request.headers['X-Avalara-Client'] = request.headers['X-Avalara-Client'].gsub("API_VERSION", apiversion)
10
+ request.headers=request.headers.merge(headers) unless headers.empty?
9
11
  request.options['timeout'] ||= 1_200
10
12
  case method
11
13
  when :get, :delete
@@ -8,4 +8,4 @@ module SpreeAvataxOfficial
8
8
  end
9
9
  end
10
10
 
11
- ::Spree::User.prepend ::SpreeAvataxOfficial::Spree::UserDecorator
11
+ Spree.user_class.prepend ::SpreeAvataxOfficial::Spree::UserDecorator
@@ -82,7 +82,7 @@ module SpreeAvataxOfficial
82
82
  end
83
83
 
84
84
  def avatax_preferences_cache_key(order)
85
- ship_from_address_timestamp = ship_from_address_preference.try(:updated_at).try(:utc).try(:to_s, :number)
85
+ ship_from_address_timestamp = ship_from_address_preference.try(:updated_at).try(:utc).try(:to_i)
86
86
 
87
87
  "#{company_code(order)}-#{ship_from_address_timestamp}"
88
88
  end
@@ -2,7 +2,7 @@
2
2
  <%= Spree.t('avalara_entity_use_codes') %>
3
3
  <% end %>
4
4
 
5
- <%= render 'spree/shared/error_messages', target: @use_code %>
5
+ <%= render 'spree/admin/shared/error_messages', target: @use_code %>
6
6
 
7
7
  <%= form_for @use_code, url: admin_avalara_entity_use_code_path(@use_code), method: :put do |f| %>
8
8
  <fieldset>
@@ -2,7 +2,7 @@
2
2
  <%= Spree.t('avalara_entity_use_codes') %>
3
3
  <% end %>
4
4
 
5
- <%= render 'spree/shared/error_messages', target: @use_code %>
5
+ <%= render 'spree/admin/shared/error_messages', target: @use_code %>
6
6
 
7
7
  <%= form_for @use_code, url: admin_avalara_entity_use_codes_path, html: { multipart: true } do |f| %>
8
8
  <fieldset>
@@ -3,11 +3,11 @@
3
3
  <%= Spree.t('avalara_entity_use_codes') %>
4
4
  <% end %>
5
5
 
6
- <%= render partial: 'spree/admin/users/sidebar', locals: { current: :avalara_informtion } %>
6
+ <%#= render partial: 'spree/admin/users/sidebar', locals: { current: :avalara_informtion } %>
7
7
 
8
8
  <fieldset data-hook="admin_user_edit_general_settings" class="alpha twelve columns">
9
9
  <div data-hook="admin_user_edit_form_header">
10
- <%= render partial: 'spree/shared/error_messages', locals: { target: @user } %>
10
+ <%= render partial: 'spree/admin/shared/error_messages', locals: { target: @user } %>
11
11
  </div>
12
12
 
13
13
  <div data-hook="admin_user_edit_form">
@@ -1,9 +1,11 @@
1
- # Optional configuration fields
2
- SpreeAvataxOfficial::Config.log = true
3
- SpreeAvataxOfficial::Config.log_to_stdout = false
4
- SpreeAvataxOfficial::Config.log_file_name = 'avatax.log'
5
- SpreeAvataxOfficial::Config.log_frequency = 'weekly'
6
- SpreeAvataxOfficial::Config.max_retries = 2
7
- SpreeAvataxOfficial::Config.open_timeout = 2.0
8
- SpreeAvataxOfficial::Config.read_timeout = 6.0
9
- SpreeAvataxOfficial::Config.show_rate_in_label = false
1
+ Rails.application.config.after_initialize do
2
+ # Optional configuration fields
3
+ SpreeAvataxOfficial::Config.log = true
4
+ SpreeAvataxOfficial::Config.log_to_stdout = false
5
+ SpreeAvataxOfficial::Config.log_file_name = 'avatax.log'
6
+ SpreeAvataxOfficial::Config.log_frequency = 'weekly'
7
+ SpreeAvataxOfficial::Config.max_retries = 2
8
+ SpreeAvataxOfficial::Config.open_timeout = 2.0
9
+ SpreeAvataxOfficial::Config.read_timeout = 6.0
10
+ SpreeAvataxOfficial::Config.show_rate_in_label = false
11
+ end
@@ -0,0 +1,20 @@
1
+ module SpreeAvataxOfficial
2
+ class Configuration < ::Spree::Preferences::Configuration
3
+ preference :address_validation_enabled, :boolean, default: false
4
+ preference :company_code, :string, default: ''
5
+ preference :enabled, :boolean, default: false
6
+ preference :ship_from_address, :hash, default: {}
7
+ preference :log, :boolean, default: true
8
+ preference :log_to_stdout, :boolean, default: false
9
+ preference :log_file_name, :string, default: 'avatax.log'
10
+ preference :log_frequency, :string, default: 'weekly'
11
+ preference :max_retries, :integer, default: 2
12
+ preference :open_timeout, :decimal, default: 2.0
13
+ preference :read_timeout, :decimal, default: 6.0
14
+ preference :show_rate_in_label, :boolean, default: false
15
+ preference :account_number, :string, default: ''
16
+ preference :endpoint, :string, default: Rails.env.production? ? 'https://rest.avatax.com' : 'https://sandbox-rest.avatax.com'
17
+ preference :license_key, :string, default: ''
18
+ preference :commit_transaction_enabled, :boolean, default: true
19
+ end
20
+ end
@@ -1,3 +1,5 @@
1
+ require_relative 'configuration'
2
+
1
3
  module SpreeAvataxOfficial
2
4
  class Engine < Rails::Engine
3
5
  require 'spree/core'
@@ -12,8 +14,8 @@ module SpreeAvataxOfficial
12
14
  SpreeAvataxOfficial::Config = SpreeAvataxOfficial::Configuration.new
13
15
  end
14
16
 
15
- initializer 'spree.avatax_certified.calculators', after: 'spree.register.calculators' do |_app|
16
- Rails.application.config.spree.calculators.tax_rates << SpreeAvataxOfficial::Calculator::AvataxTransactionCalculator
17
+ config.after_initialize do |app|
18
+ app.config.spree.calculators.tax_rates << SpreeAvataxOfficial::Calculator::AvataxTransactionCalculator
17
19
  end
18
20
 
19
21
  # use rspec for tests
@@ -1,5 +1,5 @@
1
1
  module SpreeAvataxOfficial
2
- VERSION = '1.7.1'.freeze
2
+ VERSION = '1.9.0'.freeze
3
3
 
4
4
  module_function
5
5
 
@@ -6,6 +6,8 @@ FACTORY_BOT_CLASS.define do
6
6
  completed_at { nil }
7
7
  email { user.email }
8
8
  state { 'cart' }
9
+ currency { 'USD' }
10
+ store { Spree::Store.first || create(:store) }
9
11
 
10
12
  transient do
11
13
  line_items_price { 10.0 }
@@ -15,7 +15,7 @@ unless FACTORY_BOT_CLASS.factories.registered?(:usa_address)
15
15
 
16
16
  country do
17
17
  usa_attributes = { name: 'United States', iso_name: 'UNITED STATES', iso: 'US', iso3: 'USA' }
18
- Spree::Country.find_by(usa_attributes) || create(:country, usa_attributes)
18
+ Spree::Country.find_by(iso: 'US') || create(:country, usa_attributes)
19
19
  end
20
20
 
21
21
  trait :from_california do
@@ -4,7 +4,6 @@ describe SpreeAvataxOfficial::Seeder do
4
4
  describe '#seed!' do
5
5
  subject { described_class.new.seed! }
6
6
 
7
- let!(:usa) { create(:country, name: 'United States', iso3: 'USA') }
8
7
  let!(:pennslyvania) { create(:state, name: 'Pennsylvania', abbr: 'PA') }
9
8
  let!(:shipping_method) { create(:shipping_method, tax_category: nil) }
10
9
  let(:clothing_tax_category) { Spree::TaxCategory.find_by(name: 'Clothing') }
data/spec/spec_helper.rb CHANGED
@@ -92,6 +92,9 @@ RSpec.configure do |config|
92
92
 
93
93
  config.before do
94
94
  Rails.cache.clear
95
+
96
+ create(:country, name: 'United States', iso_name: 'UNITED STATES', iso: 'US', states_required: true)
97
+ create(:store, default_currency: 'USD', default_country_id: Spree::Country.first.id)
95
98
  end
96
99
 
97
100
  config.before(type: :feature) do
data/spec/support/vcr.rb CHANGED
@@ -1,3 +1,8 @@
1
+ require 'vcr'
2
+ require 'webmock/rspec'
3
+ require 'uri'
4
+ require 'webdrivers'
5
+
1
6
  VCR.configure do |config|
2
7
  config.allow_http_connections_when_no_cassette = false
3
8
  config.cassette_library_dir = 'spec/vcr'
@@ -7,6 +12,14 @@ VCR.configure do |config|
7
12
  config.configure_rspec_metadata!
8
13
  config.hook_into :webmock
9
14
 
15
+ # webdrivers fix
16
+ driver_hosts = Webdrivers::Common.subclasses.map { |driver| URI(driver.base_url).host }
17
+ driver_hosts << 'googlechromelabs.github.io'
18
+ driver_hosts << 'edgedl.me.gvt1.com'
19
+ driver_hosts << 'storage.googleapis.com'
20
+
21
+ config.ignore_hosts(*driver_hosts)
22
+
10
23
  config.filter_sensitive_data('<AVATAX_TOKEN>') do |interaction|
11
24
  interaction.request.headers['Authorization'].first
12
25
  end
@@ -39,6 +39,50 @@ http_interactions:
39
39
  string: '{"error":{"code":"EntityNotFoundError","message":"Transaction not found.","target":"HttpRequest","details":[{"code":"EntityNotFoundError","number":4,"message":"Transaction
40
40
  not found.","description":"The Transaction with code ''test1:not-existing-number''
41
41
  was not found.","faultCode":"Client","helpLink":"http://developer.avalara.com/avatax/errors/EntityNotFoundError","severity":"Error"}]}}'
42
- http_version:
43
42
  recorded_at: Fri, 20 Sep 2019 09:03:57 GMT
44
- recorded_with: VCR 4.0.0
43
+ - request:
44
+ method: get
45
+ uri: https://sandbox-rest.avatax.com/api/v2/companies/test1/transactions/NOT-EXISTING-NUMBER
46
+ body:
47
+ encoding: US-ASCII
48
+ string: ''
49
+ headers:
50
+ Accept:
51
+ - application/json; charset=utf-8
52
+ User-Agent:
53
+ - AvaTax Ruby Gem 24.4.2
54
+ X-Avalara-Client:
55
+ - a0o0b000005HsXPAA0;Spree by Spark;RubySdk;24.4.2;
56
+ Authorization:
57
+ - "<AVATAX_TOKEN>"
58
+ Accept-Encoding:
59
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
60
+ response:
61
+ status:
62
+ code: 401
63
+ message: Unauthorized
64
+ headers:
65
+ Date:
66
+ - Wed, 24 Apr 2024 18:01:04 GMT
67
+ Content-Type:
68
+ - application/json
69
+ Transfer-Encoding:
70
+ - chunked
71
+ Connection:
72
+ - keep-alive
73
+ Strict-Transport-Security:
74
+ - max-age=31536000; includeSubdomains; preload
75
+ X-Content-Type-Options:
76
+ - nosniff
77
+ X-Correlation-Id:
78
+ - 62404d35-57bf-4a26-9f10-339d39d221e5
79
+ X-Avalara-Uid:
80
+ - 62404d35-57bf-4a26-9f10-339d39d221e5
81
+ body:
82
+ encoding: UTF-8
83
+ string: '{"error": {"code": "AuthenticationException","message": "Authentication
84
+ failed.","details": [{"code": "AuthenticationException","message": "Authentication
85
+ failed.","description": "Missing authentication or unable to authenticate
86
+ the user or the account.","faultCode": "Client","helpLink": "http://developer.avalara.com/avatax/errors/AuthenticationException"}]}}'
87
+ recorded_at: Wed, 24 Apr 2024 18:01:04 GMT
88
+ recorded_with: VCR 6.2.0
@@ -43,6 +43,50 @@ http_interactions:
43
43
  Market St","line2":"","line3":"","city":"San Francisco","region":"CA","postalCode":"94111","country":"US","taxRegionId":2128434,"latitude":"37.793815","longitude":"-122.395832"},{"id":11594662439,"transactionId":4810140820,"boundaryLevel":"Zip5","line1":"123
44
44
  Main Street","line2":"","line3":"","city":"Irvine","region":"CA","postalCode":"92615","country":"US","taxRegionId":2127863,"latitude":"33.657808","longitude":"-117.968489"}],"locationTypes":[{"documentLocationTypeId":10848111441,"documentId":4810140820,"documentAddressId":11594662439,"locationTypeCode":"ShipFrom"},{"documentLocationTypeId":4644330636,"documentId":4810140820,"documentAddressId":9389168836,"locationTypeCode":"ShipTo"}],"summary":[{"country":"US","region":"CA","jurisType":"State","jurisCode":"06","jurisName":"CALIFORNIA","taxAuthorityType":45,"stateAssignedNo":"","taxType":"Sales","taxSubType":"S","taxName":"CA
45
45
  STATE TAX","rateType":"General","taxable":0.00,"rate":0.000000,"tax":0.00,"taxCalculated":0.00,"nonTaxable":120.00,"exemption":0.00}]}'
46
- http_version:
47
46
  recorded_at: Fri, 20 Sep 2019 09:03:59 GMT
48
- recorded_with: VCR 4.0.0
47
+ - request:
48
+ method: get
49
+ uri: https://sandbox-rest.avatax.com/api/v2/companies/test1/transactions/TEST123
50
+ body:
51
+ encoding: US-ASCII
52
+ string: ''
53
+ headers:
54
+ Accept:
55
+ - application/json; charset=utf-8
56
+ User-Agent:
57
+ - AvaTax Ruby Gem 24.4.2
58
+ X-Avalara-Client:
59
+ - a0o0b000005HsXPAA0;Spree by Spark;RubySdk;24.4.2;
60
+ Authorization:
61
+ - "<AVATAX_TOKEN>"
62
+ Accept-Encoding:
63
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
64
+ response:
65
+ status:
66
+ code: 401
67
+ message: Unauthorized
68
+ headers:
69
+ Date:
70
+ - Wed, 24 Apr 2024 18:01:03 GMT
71
+ Content-Type:
72
+ - application/json
73
+ Transfer-Encoding:
74
+ - chunked
75
+ Connection:
76
+ - keep-alive
77
+ Strict-Transport-Security:
78
+ - max-age=31536000; includeSubdomains; preload
79
+ X-Content-Type-Options:
80
+ - nosniff
81
+ X-Correlation-Id:
82
+ - ab04f5ef-e37e-429f-bf3c-b83abce27784
83
+ X-Avalara-Uid:
84
+ - ab04f5ef-e37e-429f-bf3c-b83abce27784
85
+ body:
86
+ encoding: UTF-8
87
+ string: '{"error": {"code": "AuthenticationException","message": "Authentication
88
+ failed.","details": [{"code": "AuthenticationException","message": "Authentication
89
+ failed.","description": "Missing authentication or unable to authenticate
90
+ the user or the account.","faultCode": "Client","helpLink": "http://developer.avalara.com/avatax/errors/AuthenticationException"}]}}'
91
+ recorded_at: Wed, 24 Apr 2024 18:01:03 GMT
92
+ recorded_with: VCR 6.2.0
@@ -19,7 +19,7 @@ Gem::Specification.new do |s| # rubocop:disable Metrics/BlockLength
19
19
  s.metadata = {
20
20
  "bug_tracker_uri" => "https://github.com/spree/spree_avatax_official/issues",
21
21
  "changelog_uri" => "https://github.com/spree/spree_avatax_official/releases/tag/v#{s.version}",
22
- "documentation_uri" => "https://guides.spreecommerce.org/",
22
+ "documentation_uri" => "https://github.com/spree-contrib/spree_avatax_official",
23
23
  "source_code_uri" => "https://github.com/spree/spree_avatax_official/tree/v#{s.version}",
24
24
  }
25
25
 
@@ -28,9 +28,9 @@ Gem::Specification.new do |s| # rubocop:disable Metrics/BlockLength
28
28
  s.require_path = 'lib'
29
29
  s.requirements << 'none'
30
30
 
31
- s.add_dependency 'avatax', '~> 19.3'
31
+ s.add_dependency 'avatax', '>= 19.3'
32
32
 
33
- spree_version = '>= 2.1.0', '< 5.0'
33
+ spree_version = '>= 4.3'
34
34
 
35
35
  s.add_dependency 'spree_backend', spree_version
36
36
  s.add_dependency 'spree_core', spree_version
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_avatax_official
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Spark Solutions
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-28 00:00:00.000000000 Z
11
+ date: 2024-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avatax
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '19.3'
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
26
  version: '19.3'
27
27
  - !ruby/object:Gem::Dependency
@@ -30,40 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 2.1.0
34
- - - "<"
35
- - !ruby/object:Gem::Version
36
- version: '5.0'
33
+ version: '4.3'
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
38
  - - ">="
42
39
  - !ruby/object:Gem::Version
43
- version: 2.1.0
44
- - - "<"
45
- - !ruby/object:Gem::Version
46
- version: '5.0'
40
+ version: '4.3'
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: spree_core
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
45
  - - ">="
52
46
  - !ruby/object:Gem::Version
53
- version: 2.1.0
54
- - - "<"
55
- - !ruby/object:Gem::Version
56
- version: '5.0'
47
+ version: '4.3'
57
48
  type: :runtime
58
49
  prerelease: false
59
50
  version_requirements: !ruby/object:Gem::Requirement
60
51
  requirements:
61
52
  - - ">="
62
53
  - !ruby/object:Gem::Version
63
- version: 2.1.0
64
- - - "<"
65
- - !ruby/object:Gem::Version
66
- version: '5.0'
54
+ version: '4.3'
67
55
  - !ruby/object:Gem::Dependency
68
56
  name: spree_extension
69
57
  requirement: !ruby/object:Gem::Requirement
@@ -141,12 +129,11 @@ executables: []
141
129
  extensions: []
142
130
  extra_rdoc_files: []
143
131
  files:
132
+ - ".circleci/config.yml"
144
133
  - ".env-sample"
145
134
  - ".gitignore"
146
135
  - ".rspec"
147
136
  - ".rubocop.yml"
148
- - ".travis.yml"
149
- - Appraisals
150
137
  - Gemfile
151
138
  - LICENSE
152
139
  - README.md
@@ -219,15 +206,10 @@ files:
219
206
  - db/migrate/20191001085458_remove_spree_avalara_entity_use_codes_table.rb
220
207
  - db/migrate/20191001092353_create_spree_avatax_official_entity_use_codes_table.rb
221
208
  - db/seeds.rb
222
- - gemfiles/spree_3_1.gemfile
223
- - gemfiles/spree_3_7.gemfile
224
- - gemfiles/spree_4_0.gemfile
225
- - gemfiles/spree_4_1.gemfile
226
- - gemfiles/spree_4_2.gemfile
227
- - gemfiles/spree_master.gemfile
228
209
  - lib/generators/spree_avatax_official/install/install_generator.rb
229
210
  - lib/generators/spree_avatax_official/install/templates/config/initializers/spree_avatax_official.rb
230
211
  - lib/spree_avatax_official.rb
212
+ - lib/spree_avatax_official/configuration.rb
231
213
  - lib/spree_avatax_official/engine.rb
232
214
  - lib/spree_avatax_official/factories.rb
233
215
  - lib/spree_avatax_official/seeder.rb
@@ -350,9 +332,9 @@ licenses:
350
332
  - BSD-3-Clause
351
333
  metadata:
352
334
  bug_tracker_uri: https://github.com/spree/spree_avatax_official/issues
353
- changelog_uri: https://github.com/spree/spree_avatax_official/releases/tag/v1.7.1
354
- documentation_uri: https://guides.spreecommerce.org/
355
- source_code_uri: https://github.com/spree/spree_avatax_official/tree/v1.7.1
335
+ changelog_uri: https://github.com/spree/spree_avatax_official/releases/tag/v1.9.0
336
+ documentation_uri: https://github.com/spree-contrib/spree_avatax_official
337
+ source_code_uri: https://github.com/spree/spree_avatax_official/tree/v1.9.0
356
338
  post_install_message:
357
339
  rdoc_options: []
358
340
  require_paths:
@@ -369,7 +351,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
369
351
  version: '0'
370
352
  requirements:
371
353
  - none
372
- rubygems_version: 3.2.3
354
+ rubygems_version: 3.5.3
373
355
  signing_key:
374
356
  specification_version: 4
375
357
  summary: The official certified Spree Avatax
data/.travis.yml DELETED
@@ -1,78 +0,0 @@
1
- os: linux
2
- dist: bionic
3
-
4
- addons:
5
- apt:
6
- sources:
7
- - google-chrome
8
- packages:
9
- - google-chrome-stable
10
-
11
- services:
12
- - mysql
13
- - postgresql
14
-
15
- language: ruby
16
-
17
- rvm:
18
- - 3.0
19
- - 2.7
20
- - 2.5
21
- - 2.3
22
-
23
- env:
24
- - DB=mysql
25
- - DB=postgres
26
-
27
- gemfile:
28
- - gemfiles/spree_3_1.gemfile
29
- - gemfiles/spree_3_7.gemfile
30
- - gemfiles/spree_4_0.gemfile
31
- - gemfiles/spree_4_1.gemfile
32
- - gemfiles/spree_4_2.gemfile
33
- - gemfiles/spree_master.gemfile
34
-
35
- jobs:
36
- fast_finish: true
37
- allow_failures:
38
- - gemfile: gemfiles/spree_master.gemfile
39
- exclude:
40
- - rvm: 3.0
41
- gemfile: gemfiles/spree_3_1.gemfile
42
- - rvm: 3.0
43
- gemfile: gemfiles/spree_3_7.gemfile
44
- - rvm: 3.0
45
- gemfile: gemfiles/spree_4_0.gemfile
46
- - rvm: 3.0
47
- gemfile: gemfiles/spree_4_1.gemfile
48
- - rvm: 2.7
49
- gemfile: gemfiles/spree_3_1.gemfile
50
- - rvm: 2.5
51
- gemfile: gemfiles/spree_3_1.gemfile
52
- - rvm: 2.5
53
- gemfile: gemfiles/spree_master.gemfile
54
- - rvm: 2.3
55
- gemfile: gemfiles/spree_3_7.gemfile
56
- - rvm: 2.3
57
- gemfile: gemfiles/spree_4_0.gemfile
58
- - rvm: 2.3
59
- gemfile: gemfiles/spree_4_1.gemfile
60
- - rvm: 2.3
61
- gemfile: gemfiles/spree_4_2.gemfile
62
- - rvm: 2.3
63
- gemfile: gemfiles/spree_master.gemfile
64
-
65
- before_script:
66
- - CHROME_MAIN_VERSION=`google-chrome-stable --version | sed -E 's/(^Google Chrome |\.[0-9]+ )//g'`
67
- - CHROMEDRIVER_VERSION=`curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_MAIN_VERSION"`
68
- - curl "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip" -O
69
- - unzip chromedriver_linux64.zip -d ~/bin
70
- - nvm install 14
71
-
72
- script:
73
- - bundle exec rake test_app
74
- - bundle exec rake spec
75
-
76
- before_install:
77
- - sudo apt-get install libmysqlclient-dev
78
- - mysql -u root -e "GRANT ALL ON *.* TO 'travis'@'%';"
data/Appraisals DELETED
@@ -1,49 +0,0 @@
1
- appraise 'spree-3-1' do
2
- gem 'spree_core', '~> 3.1.0'
3
- gem 'spree_backend', '~> 3.1.0'
4
- gem 'pg', '~> 0.18'
5
- gem 'spree_auth_devise', '~> 3.3'
6
- gem 'factory_girl'
7
- gem 'rails_test_params_backport'
8
- end
9
-
10
- appraise 'spree-3-7' do
11
- gem 'spree_core', '~> 3.7.0'
12
- gem 'spree_backend', '~> 3.7.0'
13
- gem 'spree_auth_devise', '~> 3.5'
14
- gem 'rails-controller-testing'
15
- gem 'sass-rails'
16
- end
17
-
18
- appraise 'spree-4-0' do
19
- gem 'spree_core', '~> 4.0.0.rc1'
20
- gem 'spree_backend', '~> 4.0.0'
21
- gem 'spree_auth_devise', '~> 4.0.0.rc2'
22
- gem 'rails-controller-testing'
23
- gem 'rspec-rails', '~> 4.0.0.beta2'
24
- end
25
-
26
- appraise 'spree-4-1' do
27
- gem 'spree_core', '~> 4.1.0'
28
- gem 'spree_backend', '~> 4.1.0'
29
- gem 'spree_auth_devise', '~> 4.1.0'
30
- gem 'rails-controller-testing'
31
- gem 'rspec-rails', '~> 4.0.0.beta2'
32
- end
33
-
34
- appraise 'spree-4-2' do
35
- gem 'spree_core', '~> 4.2.0.beta'
36
- gem 'spree_backend', '~> 4.2.0.beta'
37
- gem 'spree_auth_devise', '~> 4.2.0'
38
- gem 'rails-controller-testing'
39
- gem 'sass-rails'
40
- gem 'rspec-rails', '~> 4.0.0.beta2'
41
- end
42
-
43
- appraise 'spree-master' do
44
- gem 'spree_core', github: 'spree/spree', branch: 'master'
45
- gem 'spree_backend', github: 'spree/spree', branch: 'master'
46
- gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: 'master'
47
- gem 'rails-controller-testing'
48
- gem 'rspec-rails', '~> 4.0.0.beta2'
49
- end
@@ -1,16 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails-controller-testing"
6
- gem "rubocop", "~> 0.63.0", require: false
7
- gem "rubocop-rspec", require: false
8
- gem "spree_auth_devise", "~> 3.3"
9
- gem "spree_backend", "~> 3.1.0"
10
- gem "spree_core", "~> 3.1.0"
11
- gem "sass-rails"
12
- gem "pg", "~> 0.18"
13
- gem "factory_girl"
14
- gem "rails_test_params_backport"
15
-
16
- gemspec path: "../"
@@ -1,13 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails-controller-testing"
6
- gem "rubocop", "~> 0.63.0", require: false
7
- gem "rubocop-rspec", require: false
8
- gem "spree_auth_devise", "~> 3.5"
9
- gem "spree_backend", "~> 3.7.0"
10
- gem "spree_core", "~> 3.7.0"
11
- gem "sass-rails"
12
-
13
- gemspec path: "../"
@@ -1,14 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails-controller-testing"
6
- gem "rubocop", "~> 0.63.0", require: false
7
- gem "rubocop-rspec", require: false
8
- gem "spree_auth_devise", "~> 4.0.0.rc2"
9
- gem "spree_backend", "~> 4.0.0"
10
- gem "spree_core", "~> 4.0.0.rc1"
11
- gem "sass-rails"
12
- gem "rspec-rails", "~> 4.0.0.beta2"
13
-
14
- gemspec path: "../"
@@ -1,14 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails-controller-testing"
6
- gem "rubocop", "~> 0.63.0", require: false
7
- gem "rubocop-rspec", require: false
8
- gem "spree_auth_devise", "~> 4.1.0"
9
- gem "spree_backend", "~> 4.1.0"
10
- gem "spree_core", "~> 4.1.0"
11
- gem "sass-rails"
12
- gem "rspec-rails", "~> 4.0.0.beta2"
13
-
14
- gemspec path: "../"
@@ -1,14 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails-controller-testing"
6
- gem "rubocop", "~> 0.63.0", require: false
7
- gem "rubocop-rspec", require: false
8
- gem "spree_auth_devise", "~> 4.2.0"
9
- gem "spree_backend", "~> 4.2.0.beta"
10
- gem "spree_core", "~> 4.2.0.beta"
11
- gem "sass-rails"
12
- gem "rspec-rails", "~> 4.0.0.beta2"
13
-
14
- gemspec path: "../"
@@ -1,14 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails-controller-testing"
6
- gem "rubocop", "~> 0.63.0", require: false
7
- gem "rubocop-rspec", require: false
8
- gem "spree_auth_devise", branch: "master", git: "https://github.com/spree/spree_auth_devise.git"
9
- gem "spree_backend", branch: "master", git: "https://github.com/spree/spree.git"
10
- gem "spree_core", branch: "master", git: "https://github.com/spree/spree.git"
11
- gem "sass-rails"
12
- gem "rspec-rails", "~> 4.0.0.beta2"
13
-
14
- gemspec path: "../"