solidus_backend 2.3.0.beta1 → 2.3.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of solidus_backend might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/controllers/spree/admin/payment_methods_controller.rb +1 -7
- data/app/views/spree/admin/payment_methods/_form.html.erb +12 -21
- data/app/views/spree/admin/payment_methods/edit.html.erb +1 -1
- data/app/views/spree/admin/payment_methods/index.html.erb +1 -1
- data/app/views/spree/admin/payment_methods/new.html.erb +1 -1
- data/spec/features/admin/configuration/payment_methods_spec.rb +7 -7
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5cbbe47bd70d04268f20babdfea7cf0ceb3d34a
|
4
|
+
data.tar.gz: 6f8082e77de692e7adaae77a4a935020840759ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c32505302d974f6aa6321cad782c7891cae551114820453da561cbe539b147d811f8901ad4354f223a1e54d89cc9d6eb7c3034b11da4a1e0b1cf22fb7f7e20b
|
7
|
+
data.tar.gz: 25e6fbff2330f89b48d72a453db44d45d8c6c3cda34f4fde47e7090eda60d3d273cc5b184adc65535abf02c939f8ba53e5cb43550d15f83823e5282dfae3fd8b
|
@@ -77,13 +77,7 @@ module Spree
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def payment_method_params
|
80
|
-
|
81
|
-
subclass_params = params[ActiveModel::Naming.param_key(@payment_method_type)] || ActionController::Parameters.new
|
82
|
-
|
83
|
-
superclass_params = superclass_params.permit!
|
84
|
-
subclass_params = subclass_params.permit!
|
85
|
-
|
86
|
-
superclass_params.to_h.merge(subclass_params.to_h)
|
80
|
+
params.require(:payment_method).permit!
|
87
81
|
end
|
88
82
|
end
|
89
83
|
end
|
@@ -3,11 +3,11 @@
|
|
3
3
|
<div data-hook="payment_method">
|
4
4
|
|
5
5
|
<div class="row">
|
6
|
-
<div class="col-
|
6
|
+
<div class="col-4">
|
7
7
|
<div id="preference-settings">
|
8
8
|
<div class="field">
|
9
|
-
<%= label :
|
10
|
-
<%=
|
9
|
+
<%= f.label :type %>
|
10
|
+
<%= f.select :type, @payment_method_types.map { |p| [p.model_name.human, p.to_s] }, {}, {class: 'custom-select fullwidth js-gateway-type'} %>
|
11
11
|
</div>
|
12
12
|
|
13
13
|
<div class="field js-preference-source-wrapper">
|
@@ -25,34 +25,25 @@
|
|
25
25
|
|
26
26
|
<div class="info warning js-gateway-settings-warning"><%= Spree.t(:payment_method_settings_warning) %></div>
|
27
27
|
</div>
|
28
|
+
<div data-hook="auto_capture" class="field">
|
29
|
+
<%= f.label :auto_capture %>
|
30
|
+
<%= f.select :auto_capture, [["#{Spree.t(:use_app_default)} (#{Spree::Config[:auto_capture]})", ''], [Spree.t(:say_yes), true], [Spree.t(:say_no), false]], {}, {class: 'custom-select fullwidth'} %>
|
31
|
+
</div>
|
28
32
|
<div data-hook="available_to_user" class="field">
|
29
|
-
<%= label_tag nil, Spree::PaymentMethod.human_attribute_name(:available_to_users) %>
|
30
33
|
<%= f.check_box :available_to_users %>
|
34
|
+
<%= f.label :available_to_users %>
|
31
35
|
</div>
|
32
36
|
<div data-hook="available_to_user" class="field">
|
33
|
-
<%= label_tag nil, Spree::PaymentMethod.human_attribute_name(:available_to_admin) %>
|
34
37
|
<%= f.check_box :available_to_admin %>
|
35
|
-
|
36
|
-
<div data-hook="auto_capture" class="field">
|
37
|
-
<%= f.label :auto_capture %>
|
38
|
-
<%= select(:payment_method, :auto_capture, [["#{Spree.t(:use_app_default)} (#{Spree::Config[:auto_capture]})", ''], [Spree.t(:say_yes), true], [Spree.t(:say_no), false]], {}, {class: 'custom-select fullwidth'}) %>
|
38
|
+
<%= f.label :available_to_admin %>
|
39
39
|
</div>
|
40
40
|
<div data-hook="active" class="field">
|
41
|
-
<%=
|
42
|
-
|
43
|
-
<li>
|
44
|
-
<%= radio_button :payment_method, :active, true %>
|
45
|
-
<%= label_tag :payment_method_active_true, Spree.t(:say_yes) %>
|
46
|
-
</li>
|
47
|
-
<li>
|
48
|
-
<%= radio_button :payment_method, :active, false %>
|
49
|
-
<%= label_tag :payment_method_active_false, Spree.t(:say_no) %>
|
50
|
-
</li>
|
51
|
-
</ul>
|
41
|
+
<%= f.check_box :active %>
|
42
|
+
<%= f.label :active %>
|
52
43
|
</div>
|
53
44
|
</div>
|
54
45
|
|
55
|
-
<div class="col-
|
46
|
+
<div class="col-8">
|
56
47
|
<div data-hook="name" class="field">
|
57
48
|
<%= f.label :name %>
|
58
49
|
<%= f.text_field :name, class: 'fullwidth' %>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
<%= render partial: 'spree/shared/error_messages', locals: { target: @payment_method } %>
|
12
12
|
|
13
|
-
<%= form_for @payment_method, url: admin_payment_method_path(@payment_method) do |f| %>
|
13
|
+
<%= form_for @payment_method, as: :payment_method, url: admin_payment_method_path(@payment_method) do |f| %>
|
14
14
|
<fieldset class="no-border-top">
|
15
15
|
<%= render partial: 'form', locals: { f: f } %>
|
16
16
|
<div data-hook="buttons" class="filter-actions actions">
|
@@ -40,7 +40,7 @@
|
|
40
40
|
<tr id="<%= spree_dom_id method %>" data-hook="admin_payment_methods_index_rows" class="<%= cycle('odd', 'even')%>">
|
41
41
|
<td class="no-border"><span class="handle"></span></td>
|
42
42
|
<td class="align-center"><%= method.name %></td>
|
43
|
-
<td class="align-center"><%= method.
|
43
|
+
<td class="align-center"><%= method.model_name.human %></td>
|
44
44
|
<td class="align-center"><%= method.available_to_users ? Spree.t(:say_yes) : Spree.t(:say_no) %></td>
|
45
45
|
<td class="align-center"><%= method.available_to_admin ? Spree.t(:say_yes) : Spree.t(:say_no) %></td>
|
46
46
|
<td class="align-center"><%= method.active ? Spree.t(:say_yes) : Spree.t(:say_no) %></td>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
<%= render partial: 'spree/shared/error_messages', locals: { target: @payment_method } %>
|
13
13
|
|
14
|
-
<%= form_for @payment_method, url: collection_url do |f| %>
|
14
|
+
<%= form_for @payment_method, as: :payment_method, url: collection_url do |f| %>
|
15
15
|
<fieldset class="no-border-top">
|
16
16
|
<%= render partial: 'form', locals: { f: f } %>
|
17
17
|
<div data-hook="buttons" class="filter-actions actions">
|
@@ -23,7 +23,7 @@ describe "Payment Methods", type: :feature do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
within('table#listing_payment_methods') do
|
26
|
-
expect(page).to have_content(
|
26
|
+
expect(page).to have_content(Spree::PaymentMethod::Check.model_name.human)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
end
|
@@ -35,7 +35,7 @@ describe "Payment Methods", type: :feature do
|
|
35
35
|
expect(page).to have_content("New Payment Method")
|
36
36
|
fill_in "payment_method_name", with: "check90"
|
37
37
|
fill_in "payment_method_description", with: "check90 desc"
|
38
|
-
select
|
38
|
+
select Spree::PaymentMethod::Check.model_name.human, from: "Type"
|
39
39
|
click_button "Create"
|
40
40
|
expect(page).to have_content("successfully created!")
|
41
41
|
end
|
@@ -51,14 +51,14 @@ describe "Payment Methods", type: :feature do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
it "should be able to edit an existing payment method" do
|
54
|
-
fill_in "
|
54
|
+
fill_in "payment_method_name", with: "Payment 99"
|
55
55
|
click_button "Update"
|
56
56
|
expect(page).to have_content("successfully updated!")
|
57
|
-
expect(page).to have_field("
|
57
|
+
expect(page).to have_field("payment_method_name", with: "Payment 99")
|
58
58
|
end
|
59
59
|
|
60
60
|
it "should display validation errors" do
|
61
|
-
fill_in "
|
61
|
+
fill_in "payment_method_name", with: ""
|
62
62
|
click_button "Update"
|
63
63
|
expect(page).to have_content("Name can't be blank")
|
64
64
|
end
|
@@ -76,12 +76,12 @@ describe "Payment Methods", type: :feature do
|
|
76
76
|
click_icon :edit
|
77
77
|
expect(page).to have_content('Test Mode')
|
78
78
|
|
79
|
-
select
|
79
|
+
select Spree::PaymentMethod::Check.model_name.human, from: 'Type'
|
80
80
|
expect(page).to have_content('you must save first')
|
81
81
|
expect(page).to have_no_content('Test Mode')
|
82
82
|
|
83
83
|
# change back
|
84
|
-
select
|
84
|
+
select Spree::PaymentMethod::BogusCreditCard.model_name.human, from: 'Type'
|
85
85
|
expect(page).to have_no_content('you must save first')
|
86
86
|
expect(page).to have_content('Test Mode')
|
87
87
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_backend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.0.
|
4
|
+
version: 2.3.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_api
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.3.0.
|
19
|
+
version: 2.3.0.rc1
|
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
|
-
version: 2.3.0.
|
26
|
+
version: 2.3.0.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: solidus_core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.3.0.
|
33
|
+
version: 2.3.0.rc1
|
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: 2.3.0.
|
40
|
+
version: 2.3.0.rc1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sass-rails
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|