solidus_braintree 3.0.1 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +3 -3
  3. data/.rspec +1 -1
  4. data/Gemfile +1 -5
  5. data/README.md +3 -3
  6. data/Rakefile +3 -0
  7. data/bin/dummy-app +1 -3
  8. data/bin/rspec +1 -0
  9. data/bin/sandbox +2 -2
  10. data/lib/generators/solidus_braintree/install/install_generator.rb +1 -1
  11. data/lib/solidus_braintree/engine.rb +16 -6
  12. data/lib/solidus_braintree/version.rb +1 -1
  13. data/solidus_braintree.gemspec +1 -0
  14. data/spec/controllers/solidus_braintree/checkouts_controller_spec.rb +1 -1
  15. data/spec/controllers/solidus_braintree/client_tokens_controller_spec.rb +1 -1
  16. data/spec/controllers/solidus_braintree/configurations_controller_spec.rb +1 -1
  17. data/spec/controllers/solidus_braintree/transactions_controller_spec.rb +1 -1
  18. data/spec/helpers/solidus_braintree/braintree_admin_helper_spec.rb +1 -1
  19. data/spec/helpers/solidus_braintree/braintree_checkout_helper_spec.rb +1 -1
  20. data/spec/models/solidus_braintree/address_spec.rb +1 -1
  21. data/spec/models/solidus_braintree/avs_result_spec.rb +1 -1
  22. data/spec/models/solidus_braintree/gateway_spec.rb +1 -1
  23. data/spec/models/solidus_braintree/response_spec.rb +1 -1
  24. data/spec/models/solidus_braintree/source_spec.rb +1 -1
  25. data/spec/models/solidus_braintree/transaction_address_spec.rb +1 -1
  26. data/spec/models/solidus_braintree/transaction_import_spec.rb +1 -1
  27. data/spec/models/solidus_braintree/transaction_spec.rb +1 -1
  28. data/spec/models/spree/store_spec.rb +1 -1
  29. data/spec/requests/spree/api/orders_controller_spec.rb +1 -1
  30. data/spec/{solidus_braintree_helper.rb → solidus_braintree_spec_helper.rb} +3 -1
  31. data/spec/support/solidus_braintree/order_ready_for_payment.rb +1 -1
  32. data/spec/support/solidus_braintree/vcr.rb +0 -4
  33. data/spec/system/backend/configuration_spec.rb +1 -1
  34. data/spec/system/backend/new_payment_spec.rb +1 -1
  35. data/spec/system/frontend/braintree_credit_card_checkout_spec.rb +1 -1
  36. data/spec/system/frontend/paypal_checkout_spec.rb +1 -1
  37. data/spec/system/frontend/venmo_checkout_spec.rb +1 -1
  38. metadata +25 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f340c33dec5f35dd03bac9f9a2bf3095427830660f1734a2d935bc67a467f50
4
- data.tar.gz: ab812a051e994167f02e06ed837ab787bb04f066b28c70fb7722ef5df69926f2
3
+ metadata.gz: b7ae76586a99aff5a6eb02f0ab111d2d7d204c2e4b69cdb67b076b462a724baa
4
+ data.tar.gz: 4af1563fbbfe0de86743e720779e6afcb229a90d6fa68be6d2528a1ad5aed2a2
5
5
  SHA512:
6
- metadata.gz: 2e76189208e65294af94852934d92336abebead463a9d5cff9d0fa3f2143a4180695d44aae868df09edd7442c1d405d5c110d76604fa966f271b28467d954375
7
- data.tar.gz: 9ca05b003010435f31f98d7d48bdfaeed1276854759d9e213252c68936e0eb23c7dd0524d808c7d9a5640d0da1e57e8fe7e26e417be7733fbf4ab2af82e1fb42
6
+ metadata.gz: 845b6fccabb214dfbda78b8d5480e2efc8c9ecffebb3d41084f57a4c7bd3008f81333f84e43024b9e019006458888cc3d5a46f26073c60ffee9b63c2abd7ecc6
7
+ data.tar.gz: 00bfd9d0d54cdd8b9abd65d0dd8f9e3b99d6bdcbc4ea3d4540339dad8e584e44c053c1da927e9706ae3898cad6e5f9fbc11fce9f981ce69e3317ea530d2256ef
data/.circleci/config.yml CHANGED
@@ -20,7 +20,7 @@ commands:
20
20
  sudo apt-get update
21
21
  sudo apt-get install -yq libvips-dev
22
22
  - solidusio_extensions/test-branch:
23
- branch: master
23
+ branch: main
24
24
  command: |
25
25
  export FRONTEND=starter
26
26
  sudo gem update --system
@@ -66,14 +66,14 @@ workflows:
66
66
  - run-specs-with-sqlite
67
67
  - lint-code
68
68
 
69
- "Weekly run specs against master":
69
+ "Weekly run specs against main":
70
70
  triggers:
71
71
  - schedule:
72
72
  cron: "0 0 * * 4" # every Thursday
73
73
  filters:
74
74
  branches:
75
75
  only:
76
- - master
76
+ - main
77
77
  jobs:
78
78
  - run-specs-with-postgres
79
79
  - run-specs-with-mysql
data/.rspec CHANGED
@@ -1,2 +1,2 @@
1
1
  --color
2
- --require spec_helper
2
+ --require solidus_braintree_spec_helper
data/Gemfile CHANGED
@@ -3,13 +3,9 @@
3
3
  source 'https://rubygems.org'
4
4
  git_source(:github) { |repo| "https://github.com/#{repo}.git" }
5
5
 
6
- branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
6
+ branch = ENV.fetch('SOLIDUS_BRANCH', 'main')
7
7
  gem 'solidus', github: 'solidusio/solidus', branch: branch
8
8
 
9
- # The solidus_frontend gem has been pulled out since v3.2
10
- gem 'solidus_frontend', github: 'solidusio/solidus_frontend' if branch == 'master'
11
- gem 'solidus_frontend' if branch >= 'v3.2' # rubocop:disable Bundler/DuplicatedGem
12
-
13
9
  # Needed to help Bundler figure out how to resolve dependencies,
14
10
  # otherwise it takes forever to resolve them.
15
11
  # See https://github.com/bundler/bundler/issues/6677
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # SolidusBraintree
2
2
 
3
3
  [![CircleCI](https://circleci.com/gh/solidusio/solidus_braintree.svg?style=shield)](https://circleci.com/gh/solidusio/solidus_braintree)
4
- [![codecov](https://codecov.io/gh/solidusio/solidus_braintree/branch/master/graph/badge.svg)](https://codecov.io/gh/solidusio/solidus_braintree)
4
+ [![codecov](https://codecov.io/gh/solidusio/solidus_braintree/branch/main/graph/badge.svg)](https://codecov.io/gh/solidusio/solidus_braintree)
5
5
 
6
6
  `solidus_braintree` is an extension that adds support for using [Braintree](https://www.braintreepayments.com) as a payment source in your [Solidus](https://solidus.io/) store. It uses Braintree's [JavaScript v3 SDK](https://braintree.github.io/braintree-web/current/) to support the following Braintree payment method types:
7
7
 
@@ -35,13 +35,13 @@ Here are the versions of SolidusBraintree and their compatible Solidus and front
35
35
 
36
36
  | Version | Maintenance Status | Frontend | Branch |
37
37
  |----------------------|-----------------------------|------------------------|----------|
38
- | SolidusBraintree 3.0 | New features | SolidusStarterFrontend | [master] |
38
+ | SolidusBraintree 3.0 | New features | SolidusStarterFrontend | [main] |
39
39
  | SolidusBraintree 2.0 | Security patches, bug fixes | SolidusFrontend | [v2.x] |
40
40
  | SolidusBraintree 1.2 | Deprecated | SolidusFrontend | [v1.x] |
41
41
 
42
42
  [v1.x]: https://github.com/solidusio/solidus_braintree/tree/v1.x
43
43
  [v2.x]: https://github.com/solidusio/solidus_braintree/tree/v2.x
44
- [master]: https://github.com/solidusio/solidus_braintree/tree/master
44
+ [main]: https://github.com/solidusio/solidus_braintree/tree/main
45
45
 
46
46
  ## Basic Setup
47
47
 
data/Rakefile CHANGED
@@ -10,3 +10,6 @@ task :default do
10
10
  sh 'bin/rspec'
11
11
  end
12
12
  end
13
+
14
+ CLOBBER.include('dummy-app')
15
+ CLOBBER.include('sandbox')
data/bin/dummy-app CHANGED
@@ -28,10 +28,8 @@ if [ ! -d "dummy-app" ]; then
28
28
  fi
29
29
 
30
30
  cd ./dummy-app
31
- unbundled bundle add solidus --github solidusio/solidus --branch "${BRANCH:-master}" --version '> 0.a'
31
+ unbundled bundle add solidus --github solidusio/solidus --branch "${BRANCH:-main}" --version '> 0.a'
32
32
  unbundled bundle exec rake db:drop db:create
33
33
  unbundled bundle exec rails generate solidus:install --auto-accept --payment-method=none --no-seed --no-sample "$@"
34
34
  unbundled bundle add $extension_name --path ..
35
35
  unbundled bundle exec rails generate $extension_name:install --migrate --specs=all
36
-
37
-
data/bin/rspec CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  set -e
4
4
 
5
+ echo "Updating the dummy app..."
5
6
  bin/rails-dummy-app generate solidus_braintree:install --force --migrate --specs=all
6
7
 
7
8
  cd dummy-app/
data/bin/sandbox CHANGED
@@ -22,7 +22,7 @@ if [ ! -z $SOLIDUS_BRANCH ]
22
22
  then
23
23
  BRANCH=$SOLIDUS_BRANCH
24
24
  else
25
- BRANCH="master"
25
+ BRANCH="main"
26
26
  fi
27
27
 
28
28
  extension_name="solidus_braintree"
@@ -47,7 +47,7 @@ if [ ! -d "sandbox" ]; then
47
47
  fi
48
48
 
49
49
  cd ./sandbox
50
- unbundled bundle add solidus --github solidusio/solidus --branch "${BRANCH:-master}" --version '> 0.a'
50
+ unbundled bundle add solidus --github solidusio/solidus --branch "${BRANCH:-main}" --version '> 0.a'
51
51
  unbundled bundle exec rake db:drop db:create
52
52
  unbundled bundle exec rails generate solidus:install --payment-method=none --auto-accept "$@"
53
53
  unbundled bundle add ${extension_name} --path '../'
@@ -119,7 +119,7 @@ module SolidusBraintree
119
119
  when 'all' then %w[spec]
120
120
  when 'frontend'
121
121
  %w[
122
- spec/solidus_braintree_helper.rb
122
+ spec/solidus_braintree_spec_helper.rb
123
123
  spec/system/frontend
124
124
  spec/support
125
125
  spec/fixtures
@@ -56,12 +56,22 @@ module SolidusBraintree
56
56
 
57
57
  initializer "solidus_braintree_admin_menu_item", after: "register_solidus_braintree_gateway" do
58
58
  Spree::Backend::Config.configure do |config|
59
- config.menu_items << config.class::MenuItem.new(
60
- [:braintree],
61
- 'cc-paypal',
62
- url: '/solidus_braintree/configurations/list',
63
- condition: -> { can?(:list, SolidusBraintree::Configuration) }
64
- )
59
+ config.menu_items <<
60
+ if Spree.solidus_gem_version >= Gem::Version.new('4.2')
61
+ config.class::MenuItem.new(
62
+ label: :braintree,
63
+ icon: 'cc-paypal',
64
+ url: '/solidus_braintree/configurations/list',
65
+ condition: -> { can?(:list, SolidusBraintree::Configuration) }
66
+ )
67
+ else
68
+ config.class::MenuItem.new(
69
+ [:braintree],
70
+ 'cc-paypal',
71
+ url: '/solidus_braintree/configurations/list',
72
+ condition: -> { can?(:list, SolidusBraintree::Configuration) }
73
+ )
74
+ end
65
75
  end
66
76
  end
67
77
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusBraintree
4
- VERSION = '3.0.1'
4
+ VERSION = '3.1.0'
5
5
  end
@@ -32,6 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.add_dependency 'activemerchant', '~> 1.48'
33
33
  spec.add_dependency 'braintree', '~> 3.4'
34
34
  spec.add_dependency 'solidus_api', ['>= 3.4.0.dev', '< 5']
35
+ spec.add_dependency 'solidus_backend', ['>= 3.4.0.dev', '< 5']
35
36
  spec.add_dependency 'solidus_core', ['>= 3.4.0.dev', '< 5']
36
37
  spec.add_dependency 'solidus_support', ['>= 0.8.1', '< 1']
37
38
 
@@ -1,4 +1,4 @@
1
- require 'solidus_braintree_helper'
1
+ require 'solidus_braintree_spec_helper'
2
2
  require 'support/solidus_braintree/order_ready_for_payment'
3
3
 
4
4
  RSpec.describe SolidusBraintree::CheckoutsController, type: :controller do
@@ -1,4 +1,4 @@
1
- require 'solidus_braintree_helper'
1
+ require 'solidus_braintree_spec_helper'
2
2
 
3
3
  RSpec.describe SolidusBraintree::ClientTokensController do
4
4
  routes { SolidusBraintree::Engine.routes }
@@ -1,4 +1,4 @@
1
- require 'solidus_braintree_helper'
1
+ require 'solidus_braintree_spec_helper'
2
2
 
3
3
  RSpec.describe SolidusBraintree::ConfigurationsController, type: :controller do
4
4
  routes { SolidusBraintree::Engine.routes }
@@ -1,4 +1,4 @@
1
- require 'solidus_braintree_helper'
1
+ require 'solidus_braintree_spec_helper'
2
2
 
3
3
  RSpec.describe SolidusBraintree::TransactionsController, type: :controller do
4
4
  routes { SolidusBraintree::Engine.routes }
@@ -1,4 +1,4 @@
1
- require 'solidus_braintree_helper'
1
+ require 'solidus_braintree_spec_helper'
2
2
 
3
3
  RSpec.describe SolidusBraintree::BraintreeAdminHelper do
4
4
  describe '#braintree_transaction_link' do
@@ -1,4 +1,4 @@
1
- require 'solidus_braintree_helper'
1
+ require 'solidus_braintree_spec_helper'
2
2
 
3
3
  RSpec.describe SolidusBraintree::BraintreeCheckoutHelper do
4
4
  let!(:store) { create :store }
@@ -1,4 +1,4 @@
1
- require 'solidus_braintree_helper'
1
+ require 'solidus_braintree_spec_helper'
2
2
 
3
3
  RSpec.describe SolidusBraintree::Address do
4
4
  describe "::split_name" do
@@ -1,4 +1,4 @@
1
- require 'solidus_braintree_helper'
1
+ require 'solidus_braintree_spec_helper'
2
2
 
3
3
  RSpec.describe SolidusBraintree::AVSResult do
4
4
  describe 'AVS response message' do
@@ -1,4 +1,4 @@
1
- require 'solidus_braintree_helper'
1
+ require 'solidus_braintree_spec_helper'
2
2
  require 'webmock'
3
3
  require 'support/solidus_braintree/order_ready_for_payment'
4
4
 
@@ -1,4 +1,4 @@
1
- require 'solidus_braintree_helper'
1
+ require 'solidus_braintree_spec_helper'
2
2
 
3
3
  RSpec.describe SolidusBraintree::Response do
4
4
  let(:failed_transaction) { nil }
@@ -1,4 +1,4 @@
1
- require 'solidus_braintree_helper'
1
+ require 'solidus_braintree_spec_helper'
2
2
  require 'support/solidus_braintree/order_ready_for_payment'
3
3
 
4
4
  RSpec.describe SolidusBraintree::Source, type: :model do
@@ -1,4 +1,4 @@
1
- require 'solidus_braintree_helper'
1
+ require 'solidus_braintree_spec_helper'
2
2
 
3
3
  RSpec.describe SolidusBraintree::TransactionAddress do
4
4
  describe "#valid?" do
@@ -1,4 +1,4 @@
1
- require 'solidus_braintree_helper'
1
+ require 'solidus_braintree_spec_helper'
2
2
 
3
3
  RSpec.describe SolidusBraintree::TransactionImport do
4
4
  let(:order) { Spree::Order.new }
@@ -1,4 +1,4 @@
1
- require 'solidus_braintree_helper'
1
+ require 'solidus_braintree_spec_helper'
2
2
 
3
3
  RSpec.describe SolidusBraintree::Transaction do
4
4
  describe "#valid?" do
@@ -1,4 +1,4 @@
1
- require 'solidus_braintree_helper'
1
+ require 'solidus_braintree_spec_helper'
2
2
 
3
3
  RSpec.describe Spree::Store do
4
4
  describe 'before_create :build_default_configuration' do
@@ -1,4 +1,4 @@
1
- require 'solidus_braintree_helper'
1
+ require 'solidus_braintree_spec_helper'
2
2
 
3
3
  RSpec.describe Spree::Api::OrdersController, type: :request do
4
4
  stub_authorization!
@@ -1,7 +1,9 @@
1
- require 'solidus_starter_frontend_helper'
1
+ require 'solidus_starter_frontend_spec_helper'
2
2
 
3
3
  require 'support/solidus_braintree/capybara'
4
4
  require 'support/solidus_braintree/factories'
5
5
  require 'support/solidus_braintree/gateway_helpers'
6
6
  require 'support/solidus_braintree/order_walkthrough'
7
7
  require 'support/solidus_braintree/vcr'
8
+
9
+ Braintree::Configuration.logger = Rails.logger
@@ -21,7 +21,7 @@ RSpec.shared_context 'when order is ready for payment' do
21
21
 
22
22
  let(:order) do
23
23
  order = Spree::Order.create!(
24
- line_items: [create(:line_item, price: 50)],
24
+ line_items: create_list(:line_item, 1, price: 50),
25
25
  email: 'test@example.com',
26
26
  bill_address: address,
27
27
  ship_address: address,
@@ -35,8 +35,4 @@ VCR.configure do |c|
35
35
 
36
36
  !r1_resource.nil? && r1_resource == r2_resource
37
37
  end
38
-
39
- # https://github.com/titusfortner/webdrivers/wiki/Using-with-VCR-or-WebMock
40
- driver_hosts = Webdrivers::Common.subclasses.map { |driver| URI(driver.base_url).host }
41
- c.ignore_hosts(*driver_hosts)
42
38
  end
@@ -1,4 +1,4 @@
1
- require 'solidus_braintree_helper'
1
+ require 'solidus_braintree_spec_helper'
2
2
 
3
3
  RSpec.describe "viewing the configuration interface", type: :feature do
4
4
  stub_authorization!
@@ -1,4 +1,4 @@
1
- require 'solidus_braintree_helper'
1
+ require 'solidus_braintree_spec_helper'
2
2
 
3
3
  RSpec.shared_context "with backend checkout setup" do
4
4
  let(:braintree) { new_gateway(active: true) }
@@ -1,4 +1,4 @@
1
- require 'solidus_braintree_helper'
1
+ require 'solidus_braintree_spec_helper'
2
2
 
3
3
  RSpec.shared_context "with frontend checkout setup" do
4
4
  let(:braintree) { new_gateway(active: true) }
@@ -1,4 +1,4 @@
1
- require 'solidus_braintree_helper'
1
+ require 'solidus_braintree_spec_helper'
2
2
  require 'support/solidus_braintree/with_prepended_view_fixtures'
3
3
 
4
4
  RSpec.describe "Checkout", type: :feature, js: true do
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'solidus_braintree_helper'
3
+ require 'solidus_braintree_spec_helper'
4
4
 
5
5
  RSpec.describe "Checkout", type: :feature, js: true do
6
6
  let(:braintree_preferences) { { venmo: true }.merge(preferences) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_braintree
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stembolt
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-08 00:00:00.000000000 Z
11
+ date: 2023-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant
@@ -58,6 +58,26 @@ dependencies:
58
58
  - - "<"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '5'
61
+ - !ruby/object:Gem::Dependency
62
+ name: solidus_backend
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: 3.4.0.dev
68
+ - - "<"
69
+ - !ruby/object:Gem::Version
70
+ version: '5'
71
+ type: :runtime
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: 3.4.0.dev
78
+ - - "<"
79
+ - !ruby/object:Gem::Version
80
+ version: '5'
61
81
  - !ruby/object:Gem::Dependency
62
82
  name: solidus_core
63
83
  requirement: !ruby/object:Gem::Requirement
@@ -305,7 +325,7 @@ files:
305
325
  - spec/models/solidus_braintree/transaction_spec.rb
306
326
  - spec/models/spree/store_spec.rb
307
327
  - spec/requests/spree/api/orders_controller_spec.rb
308
- - spec/solidus_braintree_helper.rb
328
+ - spec/solidus_braintree_spec_helper.rb
309
329
  - spec/support/solidus_braintree/capybara.rb
310
330
  - spec/support/solidus_braintree/factories.rb
311
331
  - spec/support/solidus_braintree/gateway_helpers.rb
@@ -343,7 +363,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
343
363
  - !ruby/object:Gem::Version
344
364
  version: '0'
345
365
  requirements: []
346
- rubygems_version: 3.3.7
366
+ rubygems_version: 3.3.23
347
367
  signing_key:
348
368
  specification_version: 4
349
369
  summary: Officially supported Braintree extension
@@ -397,7 +417,7 @@ test_files:
397
417
  - spec/models/solidus_braintree/transaction_spec.rb
398
418
  - spec/models/spree/store_spec.rb
399
419
  - spec/requests/spree/api/orders_controller_spec.rb
400
- - spec/solidus_braintree_helper.rb
420
+ - spec/solidus_braintree_spec_helper.rb
401
421
  - spec/support/solidus_braintree/capybara.rb
402
422
  - spec/support/solidus_braintree/factories.rb
403
423
  - spec/support/solidus_braintree/gateway_helpers.rb