solidus_braintree 3.1.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7ae76586a99aff5a6eb02f0ab111d2d7d204c2e4b69cdb67b076b462a724baa
4
- data.tar.gz: 4af1563fbbfe0de86743e720779e6afcb229a90d6fa68be6d2528a1ad5aed2a2
3
+ metadata.gz: a594a4aeb7d585ddd83ce566831645aa8a9dea516d5d843ec0adb19be69706cc
4
+ data.tar.gz: 281cf7ebd47dffac6f7ba3ff0bcdb58b02b146335c45fa1ce11779875c641296
5
5
  SHA512:
6
- metadata.gz: 845b6fccabb214dfbda78b8d5480e2efc8c9ecffebb3d41084f57a4c7bd3008f81333f84e43024b9e019006458888cc3d5a46f26073c60ffee9b63c2abd7ecc6
7
- data.tar.gz: 00bfd9d0d54cdd8b9abd65d0dd8f9e3b99d6bdcbc4ea3d4540339dad8e584e44c053c1da927e9706ae3898cad6e5f9fbc11fce9f981ce69e3317ea530d2256ef
6
+ metadata.gz: b6ce1d929444ef3ba0e090dba54c4252a7339cd4f0b7f1d9d2d8216f1496ab85e545903f7e71c0cc517e7899455ca9befe3904174874bf42b2db67204553d25a
7
+ data.tar.gz: 8b2ddbd7938cfb3b99af2ab28e675e539f3c01a8875cdb9af536e7871e7a79a94978705e5cbf86f87f493415f8aff858b797a479d42b282f259be1d7ae027a08
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SolidusBraintree
4
+ module SpreeStoreDecorator
5
+ def self.prepended(base)
6
+ base.has_one :braintree_configuration, class_name: "SolidusBraintree::Configuration", dependent: :destroy
7
+ base.before_create :build_default_configuration
8
+ end
9
+
10
+ private
11
+
12
+ def build_default_configuration
13
+ build_braintree_configuration unless braintree_configuration
14
+ end
15
+
16
+ ::Spree::Store.prepend self
17
+ end
18
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SolidusBraintree
4
+ module SpreeUserDecorator
5
+ def self.prepended(base)
6
+ base.has_one :braintree_customer, class_name: 'SolidusBraintree::Customer', inverse_of: :user
7
+ end
8
+
9
+ ::Spree.user_class.prepend self
10
+ end
11
+ end
@@ -12,12 +12,8 @@ module SolidusBraintree
12
12
  to: :spree_address
13
13
 
14
14
  def self.split_name(name)
15
- if defined?(Spree::Address::Name)
16
- address_name = Spree::Address::Name.new(name)
17
- [address_name.first_name, address_name.last_name]
18
- else
19
- name.strip.split(' ', 2)
20
- end
15
+ address_name = Spree::Address::Name.new(name)
16
+ [address_name.first_name, address_name.last_name].compact
21
17
  end
22
18
 
23
19
  def initialize(spree_address)
data/bin/dummy-app CHANGED
@@ -30,6 +30,6 @@ fi
30
30
  cd ./dummy-app
31
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
- unbundled bundle exec rails generate solidus:install --auto-accept --payment-method=none --no-seed --no-sample "$@"
33
+ unbundled bundle exec rails generate solidus:install --auto-accept --payment-method=none --no-seed --no-sample --admin-preview=false "$@"
34
34
  unbundled bundle add $extension_name --path ..
35
35
  unbundled bundle exec rails generate $extension_name:install --migrate --specs=all
@@ -59,7 +59,7 @@ module SolidusBraintree
59
59
  gsub_file 'config/routes.rb',
60
60
  "mount SolidusPaypalBraintree::Engine, at: '/solidus_paypal_braintree'\n", ''
61
61
 
62
- route "mount SolidusBraintree::Engine, at: '/solidus_braintree'"
62
+ route "mount SolidusBraintree::Engine, at: '#{solidus_mount_point}solidus_braintree'"
63
63
  end
64
64
 
65
65
  def install_solidus_backend_support
@@ -149,6 +149,12 @@ module SolidusBraintree
149
149
 
150
150
  private
151
151
 
152
+ def solidus_mount_point
153
+ mount_point = Spree::Core::Engine.routes.find_script_name({})
154
+ mount_point += "/" unless mount_point.end_with?("/")
155
+ mount_point
156
+ end
157
+
152
158
  def support_code_for(component_name, &block)
153
159
  if @components[component_name]
154
160
  say_status :install, "[#{engine.engine_name}] solidus_#{component_name}", :blue
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusBraintree
4
- VERSION = '3.1.0'
4
+ VERSION = '3.2.0'
5
5
  end
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.require_paths = ["lib"]
31
31
 
32
32
  spec.add_dependency 'activemerchant', '~> 1.48'
33
- spec.add_dependency 'braintree', '~> 3.4'
33
+ spec.add_dependency 'braintree', '~> 4.2'
34
34
  spec.add_dependency 'solidus_api', ['>= 3.4.0.dev', '< 5']
35
35
  spec.add_dependency 'solidus_backend', ['>= 3.4.0.dev', '< 5']
36
36
  spec.add_dependency 'solidus_core', ['>= 3.4.0.dev', '< 5']
@@ -4,4 +4,4 @@ RSpec.configure do |config|
4
4
  end
5
5
  end
6
6
 
7
- Capybara.javascript_driver = (ENV['CAPYBARA_DRIVER'] || :selenium_chrome_headless).to_sym
7
+ Capybara.javascript_driver = (ENV['CAPYBARA_JS_DRIVER'] || :selenium_chrome_headless).to_sym
@@ -98,7 +98,7 @@ RSpec.describe 'entering credit card details', type: :feature, js: true do
98
98
 
99
99
  it "checks out successfully" do
100
100
  within(".confirm-step") do
101
- expect(page).to have_content("CONFIRM")
101
+ expect(page).to have_content(/confirm/i)
102
102
  end
103
103
 
104
104
  check('accept_terms_and_conditions')
@@ -114,7 +114,7 @@ RSpec.describe 'entering credit card details', type: :feature, js: true do
114
114
  authenticate_3ds
115
115
 
116
116
  within(".confirm-step") do
117
- expect(page).to have_content("CONFIRM")
117
+ expect(page).to have_content(/confirm/i)
118
118
  end
119
119
 
120
120
  check('accept_terms_and_conditions')
@@ -177,7 +177,7 @@ RSpec.describe 'entering credit card details', type: :feature, js: true do
177
177
  click_button("Save and Continue")
178
178
 
179
179
  within(".confirm-step") do
180
- expect(page).to have_content("CONFIRM")
180
+ expect(page).to have_content(/confirm/i)
181
181
  end
182
182
 
183
183
  check('accept_terms_and_conditions')
@@ -152,8 +152,7 @@ RSpec.describe "Checkout", type: :feature, js: true do
152
152
  end
153
153
 
154
154
  def add_mug_to_cart
155
- visit root_path
156
- click_link mug.name
155
+ visit product_path(mug)
157
156
  click_button "add-to-cart-button"
158
157
  end
159
158
 
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.1.0
4
+ version: 3.2.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-10-04 00:00:00.000000000 Z
11
+ date: 2024-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemerchant
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '3.4'
33
+ version: '4.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '3.4'
40
+ version: '4.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: solidus_api
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -174,8 +174,8 @@ files:
174
174
  - app/assets/stylesheets/spree/backend/solidus_braintree.scss
175
175
  - app/decorators/controllers/solidus_braintree/admin_payments_controller_decorator.rb
176
176
  - app/decorators/controllers/solidus_braintree/client_tokens_controller.rb
177
- - app/decorators/models/solidus_braintree/spree/store_decorator.rb
178
- - app/decorators/models/solidus_braintree/spree/user_decorator.rb
177
+ - app/decorators/models/solidus_braintree/spree_store_decorator.rb
178
+ - app/decorators/models/solidus_braintree/spree_user_decorator.rb
179
179
  - app/helpers/solidus_braintree/braintree_admin_helper.rb
180
180
  - app/models/application_record.rb
181
181
  - app/models/solidus_braintree/address.rb
@@ -363,7 +363,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
363
363
  - !ruby/object:Gem::Version
364
364
  version: '0'
365
365
  requirements: []
366
- rubygems_version: 3.3.23
366
+ rubygems_version: 3.5.3
367
367
  signing_key:
368
368
  specification_version: 4
369
369
  summary: Officially supported Braintree extension
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module SolidusBraintree
4
- module Spree
5
- module StoreDecorator
6
- def self.prepended(base)
7
- base.has_one :braintree_configuration, class_name: "SolidusBraintree::Configuration", dependent: :destroy
8
- base.before_create :build_default_configuration
9
- end
10
-
11
- private
12
-
13
- def build_default_configuration
14
- build_braintree_configuration unless braintree_configuration
15
- end
16
-
17
- ::Spree::Store.prepend self
18
- end
19
- end
20
- end
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module SolidusBraintree
4
- module Spree
5
- module UserDecorator
6
- def self.prepended(base)
7
- base.has_one :braintree_customer, class_name: 'SolidusBraintree::Customer', inverse_of: :user
8
- end
9
-
10
- ::Spree.user_class.prepend self
11
- end
12
- end
13
- end