solidus_braintree 3.0.1 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +3 -3
- data/.rspec +1 -1
- data/Gemfile +1 -5
- data/README.md +3 -3
- data/Rakefile +3 -0
- data/app/decorators/models/solidus_braintree/spree_store_decorator.rb +18 -0
- data/app/decorators/models/solidus_braintree/spree_user_decorator.rb +11 -0
- data/app/models/solidus_braintree/address.rb +2 -6
- data/bin/dummy-app +2 -4
- data/bin/rspec +1 -0
- data/bin/sandbox +2 -2
- data/lib/generators/solidus_braintree/install/install_generator.rb +8 -2
- data/lib/solidus_braintree/engine.rb +16 -6
- data/lib/solidus_braintree/version.rb +1 -1
- data/solidus_braintree.gemspec +2 -1
- data/spec/controllers/solidus_braintree/checkouts_controller_spec.rb +1 -1
- data/spec/controllers/solidus_braintree/client_tokens_controller_spec.rb +1 -1
- data/spec/controllers/solidus_braintree/configurations_controller_spec.rb +1 -1
- data/spec/controllers/solidus_braintree/transactions_controller_spec.rb +1 -1
- data/spec/helpers/solidus_braintree/braintree_admin_helper_spec.rb +1 -1
- data/spec/helpers/solidus_braintree/braintree_checkout_helper_spec.rb +1 -1
- data/spec/models/solidus_braintree/address_spec.rb +1 -1
- data/spec/models/solidus_braintree/avs_result_spec.rb +1 -1
- data/spec/models/solidus_braintree/gateway_spec.rb +1 -1
- data/spec/models/solidus_braintree/response_spec.rb +1 -1
- data/spec/models/solidus_braintree/source_spec.rb +1 -1
- data/spec/models/solidus_braintree/transaction_address_spec.rb +1 -1
- data/spec/models/solidus_braintree/transaction_import_spec.rb +1 -1
- data/spec/models/solidus_braintree/transaction_spec.rb +1 -1
- data/spec/models/spree/store_spec.rb +1 -1
- data/spec/requests/spree/api/orders_controller_spec.rb +1 -1
- data/spec/{solidus_braintree_helper.rb → solidus_braintree_spec_helper.rb} +3 -1
- data/spec/support/solidus_braintree/capybara.rb +1 -1
- data/spec/support/solidus_braintree/order_ready_for_payment.rb +1 -1
- data/spec/support/solidus_braintree/vcr.rb +0 -4
- data/spec/system/backend/configuration_spec.rb +1 -1
- data/spec/system/backend/new_payment_spec.rb +1 -1
- data/spec/system/frontend/braintree_credit_card_checkout_spec.rb +4 -4
- data/spec/system/frontend/paypal_checkout_spec.rb +2 -3
- data/spec/system/frontend/venmo_checkout_spec.rb +1 -1
- metadata +29 -9
- data/app/decorators/models/solidus_braintree/spree/store_decorator.rb +0 -20
- data/app/decorators/models/solidus_braintree/spree/user_decorator.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a594a4aeb7d585ddd83ce566831645aa8a9dea516d5d843ec0adb19be69706cc
|
4
|
+
data.tar.gz: 281cf7ebd47dffac6f7ba3ff0bcdb58b02b146335c45fa1ce11779875c641296
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6ce1d929444ef3ba0e090dba54c4252a7339cd4f0b7f1d9d2d8216f1496ab85e545903f7e71c0cc517e7899455ca9befe3904174874bf42b2db67204553d25a
|
7
|
+
data.tar.gz: 8b2ddbd7938cfb3b99af2ab28e675e539f3c01a8875cdb9af536e7871e7a79a94978705e5cbf86f87f493415f8aff858b797a479d42b282f259be1d7ae027a08
|
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:
|
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
|
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
|
-
-
|
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
|
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', '
|
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/
|
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 | [
|
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
|
-
[
|
44
|
+
[main]: https://github.com/solidusio/solidus_braintree/tree/main
|
45
45
|
|
46
46
|
## Basic Setup
|
47
47
|
|
data/Rakefile
CHANGED
@@ -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
|
-
|
16
|
-
|
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
@@ -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:-
|
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
|
36
|
-
|
37
|
-
|
data/bin/rspec
CHANGED
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="
|
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:-
|
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 '../'
|
@@ -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: '
|
62
|
+
route "mount SolidusBraintree::Engine, at: '#{solidus_mount_point}solidus_braintree'"
|
63
63
|
end
|
64
64
|
|
65
65
|
def install_solidus_backend_support
|
@@ -119,7 +119,7 @@ module SolidusBraintree
|
|
119
119
|
when 'all' then %w[spec]
|
120
120
|
when 'frontend'
|
121
121
|
%w[
|
122
|
-
spec/
|
122
|
+
spec/solidus_braintree_spec_helper.rb
|
123
123
|
spec/system/frontend
|
124
124
|
spec/support
|
125
125
|
spec/fixtures
|
@@ -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
|
@@ -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 <<
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
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
|
data/solidus_braintree.gemspec
CHANGED
@@ -30,8 +30,9 @@ 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', '~>
|
33
|
+
spec.add_dependency 'braintree', '~> 4.2'
|
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,7 +1,9 @@
|
|
1
|
-
require '
|
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:
|
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 '
|
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) }
|
@@ -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(
|
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(
|
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(
|
180
|
+
expect(page).to have_content(/confirm/i)
|
181
181
|
end
|
182
182
|
|
183
183
|
check('accept_terms_and_conditions')
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
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
|
@@ -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
|
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.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:
|
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: '
|
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: '
|
40
|
+
version: '4.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: solidus_api
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -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
|
@@ -154,8 +174,8 @@ files:
|
|
154
174
|
- app/assets/stylesheets/spree/backend/solidus_braintree.scss
|
155
175
|
- app/decorators/controllers/solidus_braintree/admin_payments_controller_decorator.rb
|
156
176
|
- app/decorators/controllers/solidus_braintree/client_tokens_controller.rb
|
157
|
-
- app/decorators/models/solidus_braintree/
|
158
|
-
- app/decorators/models/solidus_braintree/
|
177
|
+
- app/decorators/models/solidus_braintree/spree_store_decorator.rb
|
178
|
+
- app/decorators/models/solidus_braintree/spree_user_decorator.rb
|
159
179
|
- app/helpers/solidus_braintree/braintree_admin_helper.rb
|
160
180
|
- app/models/application_record.rb
|
161
181
|
- app/models/solidus_braintree/address.rb
|
@@ -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/
|
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
|
366
|
+
rubygems_version: 3.5.3
|
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/
|
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
|
@@ -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
|