solidus_frontend 1.1.4 → 1.2.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of solidus_frontend might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/images/icons/delete.png +0 -0
- data/app/assets/images/spree/frontend/cart.png +0 -0
- data/app/assets/javascripts/spree/frontend/checkout/address.js.coffee +0 -3
- data/app/assets/stylesheets/spree/frontend/screen.css.scss +0 -6
- data/app/controllers/spree/checkout_controller.rb +22 -3
- data/app/controllers/spree/orders_controller.rb +1 -1
- data/app/views/spree/address/_form.html.erb +15 -15
- data/app/views/spree/checkout/payment/_gateway.html.erb +4 -5
- data/app/views/spree/shared/_main_nav_bar.html.erb +1 -1
- data/app/views/spree/taxons/show.html.erb +0 -0
- data/lib/spree/frontend.rb +0 -3
- data/solidus_frontend.gemspec +4 -6
- data/spec/controllers/controller_helpers_spec.rb +1 -2
- data/spec/controllers/spree/checkout_controller_spec.rb +50 -49
- data/spec/controllers/spree/checkout_controller_with_views_spec.rb +1 -1
- data/spec/controllers/spree/orders_controller_spec.rb +1 -1
- data/spec/controllers/spree/orders_controller_transitions_spec.rb +1 -1
- data/spec/controllers/spree/products_controller_spec.rb +3 -3
- data/spec/features/cart_spec.rb +2 -2
- data/spec/features/checkout_spec.rb +8 -45
- data/spec/features/currency_spec.rb +2 -2
- data/spec/features/free_shipping_promotions_spec.rb +1 -1
- data/spec/features/order_spec.rb +4 -6
- data/spec/features/products_spec.rb +1 -5
- data/spec/features/taxons_spec.rb +2 -2
- data/spec/helpers/base_helper_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- data/spec/views/spree/checkout/_summary_spec.rb +3 -5
- metadata +9 -290
- data/app/assets/images/spree/frontend/select_arrow.gif +0 -0
- data/vendor/assets/images/datepicker/cal.gif +0 -0
- data/vendor/assets/images/flags/ad.png +0 -0
- data/vendor/assets/images/flags/ae.png +0 -0
- data/vendor/assets/images/flags/af.png +0 -0
- data/vendor/assets/images/flags/ag.png +0 -0
- data/vendor/assets/images/flags/ai.png +0 -0
- data/vendor/assets/images/flags/al.png +0 -0
- data/vendor/assets/images/flags/am.png +0 -0
- data/vendor/assets/images/flags/an.png +0 -0
- data/vendor/assets/images/flags/ao.png +0 -0
- data/vendor/assets/images/flags/ar.png +0 -0
- data/vendor/assets/images/flags/as.png +0 -0
- data/vendor/assets/images/flags/at.png +0 -0
- data/vendor/assets/images/flags/au.png +0 -0
- data/vendor/assets/images/flags/aw.png +0 -0
- data/vendor/assets/images/flags/ax.png +0 -0
- data/vendor/assets/images/flags/az.png +0 -0
- data/vendor/assets/images/flags/ba.png +0 -0
- data/vendor/assets/images/flags/bb.png +0 -0
- data/vendor/assets/images/flags/bd.png +0 -0
- data/vendor/assets/images/flags/be.png +0 -0
- data/vendor/assets/images/flags/bf.png +0 -0
- data/vendor/assets/images/flags/bg.png +0 -0
- data/vendor/assets/images/flags/bh.png +0 -0
- data/vendor/assets/images/flags/bi.png +0 -0
- data/vendor/assets/images/flags/bj.png +0 -0
- data/vendor/assets/images/flags/bm.png +0 -0
- data/vendor/assets/images/flags/bn.png +0 -0
- data/vendor/assets/images/flags/bo.png +0 -0
- data/vendor/assets/images/flags/br.png +0 -0
- data/vendor/assets/images/flags/bs.png +0 -0
- data/vendor/assets/images/flags/bt.png +0 -0
- data/vendor/assets/images/flags/bv.png +0 -0
- data/vendor/assets/images/flags/bw.png +0 -0
- data/vendor/assets/images/flags/by.png +0 -0
- data/vendor/assets/images/flags/bz.png +0 -0
- data/vendor/assets/images/flags/ca.png +0 -0
- data/vendor/assets/images/flags/catalonia.png +0 -0
- data/vendor/assets/images/flags/cc.png +0 -0
- data/vendor/assets/images/flags/cd.png +0 -0
- data/vendor/assets/images/flags/cf.png +0 -0
- data/vendor/assets/images/flags/cg.png +0 -0
- data/vendor/assets/images/flags/ch.png +0 -0
- data/vendor/assets/images/flags/ci.png +0 -0
- data/vendor/assets/images/flags/ck.png +0 -0
- data/vendor/assets/images/flags/cl.png +0 -0
- data/vendor/assets/images/flags/cm.png +0 -0
- data/vendor/assets/images/flags/cn.png +0 -0
- data/vendor/assets/images/flags/co.png +0 -0
- data/vendor/assets/images/flags/cr.png +0 -0
- data/vendor/assets/images/flags/cs.png +0 -0
- data/vendor/assets/images/flags/cu.png +0 -0
- data/vendor/assets/images/flags/cv.png +0 -0
- data/vendor/assets/images/flags/cx.png +0 -0
- data/vendor/assets/images/flags/cy.png +0 -0
- data/vendor/assets/images/flags/cz.png +0 -0
- data/vendor/assets/images/flags/de.png +0 -0
- data/vendor/assets/images/flags/dj.png +0 -0
- data/vendor/assets/images/flags/dk.png +0 -0
- data/vendor/assets/images/flags/dm.png +0 -0
- data/vendor/assets/images/flags/do.png +0 -0
- data/vendor/assets/images/flags/dz.png +0 -0
- data/vendor/assets/images/flags/ec.png +0 -0
- data/vendor/assets/images/flags/ee.png +0 -0
- data/vendor/assets/images/flags/eg.png +0 -0
- data/vendor/assets/images/flags/eh.png +0 -0
- data/vendor/assets/images/flags/england.png +0 -0
- data/vendor/assets/images/flags/er.png +0 -0
- data/vendor/assets/images/flags/es.png +0 -0
- data/vendor/assets/images/flags/et.png +0 -0
- data/vendor/assets/images/flags/europeanunion.png +0 -0
- data/vendor/assets/images/flags/fam.png +0 -0
- data/vendor/assets/images/flags/fi.png +0 -0
- data/vendor/assets/images/flags/fj.png +0 -0
- data/vendor/assets/images/flags/fk.png +0 -0
- data/vendor/assets/images/flags/fm.png +0 -0
- data/vendor/assets/images/flags/fo.png +0 -0
- data/vendor/assets/images/flags/fr.png +0 -0
- data/vendor/assets/images/flags/ga.png +0 -0
- data/vendor/assets/images/flags/gb.png +0 -0
- data/vendor/assets/images/flags/gd.png +0 -0
- data/vendor/assets/images/flags/ge.png +0 -0
- data/vendor/assets/images/flags/gf.png +0 -0
- data/vendor/assets/images/flags/gh.png +0 -0
- data/vendor/assets/images/flags/gi.png +0 -0
- data/vendor/assets/images/flags/gl.png +0 -0
- data/vendor/assets/images/flags/gm.png +0 -0
- data/vendor/assets/images/flags/gn.png +0 -0
- data/vendor/assets/images/flags/gp.png +0 -0
- data/vendor/assets/images/flags/gq.png +0 -0
- data/vendor/assets/images/flags/gr.png +0 -0
- data/vendor/assets/images/flags/gs.png +0 -0
- data/vendor/assets/images/flags/gt.png +0 -0
- data/vendor/assets/images/flags/gu.png +0 -0
- data/vendor/assets/images/flags/gw.png +0 -0
- data/vendor/assets/images/flags/gy.png +0 -0
- data/vendor/assets/images/flags/hk.png +0 -0
- data/vendor/assets/images/flags/hm.png +0 -0
- data/vendor/assets/images/flags/hn.png +0 -0
- data/vendor/assets/images/flags/hr.png +0 -0
- data/vendor/assets/images/flags/ht.png +0 -0
- data/vendor/assets/images/flags/hu.png +0 -0
- data/vendor/assets/images/flags/id.png +0 -0
- data/vendor/assets/images/flags/ie.png +0 -0
- data/vendor/assets/images/flags/il.png +0 -0
- data/vendor/assets/images/flags/in.png +0 -0
- data/vendor/assets/images/flags/io.png +0 -0
- data/vendor/assets/images/flags/iq.png +0 -0
- data/vendor/assets/images/flags/ir.png +0 -0
- data/vendor/assets/images/flags/is.png +0 -0
- data/vendor/assets/images/flags/it.png +0 -0
- data/vendor/assets/images/flags/ja.png +0 -0
- data/vendor/assets/images/flags/jm.png +0 -0
- data/vendor/assets/images/flags/jo.png +0 -0
- data/vendor/assets/images/flags/ke.png +0 -0
- data/vendor/assets/images/flags/kg.png +0 -0
- data/vendor/assets/images/flags/kh.png +0 -0
- data/vendor/assets/images/flags/ki.png +0 -0
- data/vendor/assets/images/flags/km.png +0 -0
- data/vendor/assets/images/flags/kn.png +0 -0
- data/vendor/assets/images/flags/kp.png +0 -0
- data/vendor/assets/images/flags/kr.png +0 -0
- data/vendor/assets/images/flags/kw.png +0 -0
- data/vendor/assets/images/flags/ky.png +0 -0
- data/vendor/assets/images/flags/kz.png +0 -0
- data/vendor/assets/images/flags/la.png +0 -0
- data/vendor/assets/images/flags/lb.png +0 -0
- data/vendor/assets/images/flags/lc.png +0 -0
- data/vendor/assets/images/flags/li.png +0 -0
- data/vendor/assets/images/flags/lk.png +0 -0
- data/vendor/assets/images/flags/lr.png +0 -0
- data/vendor/assets/images/flags/ls.png +0 -0
- data/vendor/assets/images/flags/lt.png +0 -0
- data/vendor/assets/images/flags/lu.png +0 -0
- data/vendor/assets/images/flags/lv.png +0 -0
- data/vendor/assets/images/flags/ly.png +0 -0
- data/vendor/assets/images/flags/ma.png +0 -0
- data/vendor/assets/images/flags/mc.png +0 -0
- data/vendor/assets/images/flags/md.png +0 -0
- data/vendor/assets/images/flags/me.png +0 -0
- data/vendor/assets/images/flags/mg.png +0 -0
- data/vendor/assets/images/flags/mh.png +0 -0
- data/vendor/assets/images/flags/mk.png +0 -0
- data/vendor/assets/images/flags/ml.png +0 -0
- data/vendor/assets/images/flags/mm.png +0 -0
- data/vendor/assets/images/flags/mn.png +0 -0
- data/vendor/assets/images/flags/mo.png +0 -0
- data/vendor/assets/images/flags/mp.png +0 -0
- data/vendor/assets/images/flags/mq.png +0 -0
- data/vendor/assets/images/flags/mr.png +0 -0
- data/vendor/assets/images/flags/ms.png +0 -0
- data/vendor/assets/images/flags/mt.png +0 -0
- data/vendor/assets/images/flags/mu.png +0 -0
- data/vendor/assets/images/flags/mv.png +0 -0
- data/vendor/assets/images/flags/mw.png +0 -0
- data/vendor/assets/images/flags/mx.png +0 -0
- data/vendor/assets/images/flags/my.png +0 -0
- data/vendor/assets/images/flags/mz.png +0 -0
- data/vendor/assets/images/flags/na.png +0 -0
- data/vendor/assets/images/flags/nc.png +0 -0
- data/vendor/assets/images/flags/ne.png +0 -0
- data/vendor/assets/images/flags/nf.png +0 -0
- data/vendor/assets/images/flags/ng.png +0 -0
- data/vendor/assets/images/flags/ni.png +0 -0
- data/vendor/assets/images/flags/nl.png +0 -0
- data/vendor/assets/images/flags/no.png +0 -0
- data/vendor/assets/images/flags/np.png +0 -0
- data/vendor/assets/images/flags/nr.png +0 -0
- data/vendor/assets/images/flags/nu.png +0 -0
- data/vendor/assets/images/flags/nz.png +0 -0
- data/vendor/assets/images/flags/om.png +0 -0
- data/vendor/assets/images/flags/pa.png +0 -0
- data/vendor/assets/images/flags/pe.png +0 -0
- data/vendor/assets/images/flags/pf.png +0 -0
- data/vendor/assets/images/flags/pg.png +0 -0
- data/vendor/assets/images/flags/ph.png +0 -0
- data/vendor/assets/images/flags/pk.png +0 -0
- data/vendor/assets/images/flags/pl.png +0 -0
- data/vendor/assets/images/flags/pm.png +0 -0
- data/vendor/assets/images/flags/pn.png +0 -0
- data/vendor/assets/images/flags/pr.png +0 -0
- data/vendor/assets/images/flags/ps.png +0 -0
- data/vendor/assets/images/flags/pt.png +0 -0
- data/vendor/assets/images/flags/pw.png +0 -0
- data/vendor/assets/images/flags/py.png +0 -0
- data/vendor/assets/images/flags/qa.png +0 -0
- data/vendor/assets/images/flags/re.png +0 -0
- data/vendor/assets/images/flags/ro.png +0 -0
- data/vendor/assets/images/flags/rs.png +0 -0
- data/vendor/assets/images/flags/ru.png +0 -0
- data/vendor/assets/images/flags/rw.png +0 -0
- data/vendor/assets/images/flags/sa.png +0 -0
- data/vendor/assets/images/flags/sb.png +0 -0
- data/vendor/assets/images/flags/sc.png +0 -0
- data/vendor/assets/images/flags/scotland.png +0 -0
- data/vendor/assets/images/flags/sd.png +0 -0
- data/vendor/assets/images/flags/se.png +0 -0
- data/vendor/assets/images/flags/sg.png +0 -0
- data/vendor/assets/images/flags/sh.png +0 -0
- data/vendor/assets/images/flags/si.png +0 -0
- data/vendor/assets/images/flags/sj.png +0 -0
- data/vendor/assets/images/flags/sk.png +0 -0
- data/vendor/assets/images/flags/sl.png +0 -0
- data/vendor/assets/images/flags/sm.png +0 -0
- data/vendor/assets/images/flags/sn.png +0 -0
- data/vendor/assets/images/flags/so.png +0 -0
- data/vendor/assets/images/flags/sr.png +0 -0
- data/vendor/assets/images/flags/st.png +0 -0
- data/vendor/assets/images/flags/sv.png +0 -0
- data/vendor/assets/images/flags/sy.png +0 -0
- data/vendor/assets/images/flags/sz.png +0 -0
- data/vendor/assets/images/flags/tc.png +0 -0
- data/vendor/assets/images/flags/td.png +0 -0
- data/vendor/assets/images/flags/tf.png +0 -0
- data/vendor/assets/images/flags/tg.png +0 -0
- data/vendor/assets/images/flags/th.png +0 -0
- data/vendor/assets/images/flags/tj.png +0 -0
- data/vendor/assets/images/flags/tk.png +0 -0
- data/vendor/assets/images/flags/tl.png +0 -0
- data/vendor/assets/images/flags/tm.png +0 -0
- data/vendor/assets/images/flags/tn.png +0 -0
- data/vendor/assets/images/flags/to.png +0 -0
- data/vendor/assets/images/flags/tr.png +0 -0
- data/vendor/assets/images/flags/tt.png +0 -0
- data/vendor/assets/images/flags/tv.png +0 -0
- data/vendor/assets/images/flags/tw.png +0 -0
- data/vendor/assets/images/flags/tz.png +0 -0
- data/vendor/assets/images/flags/ua.png +0 -0
- data/vendor/assets/images/flags/ug.png +0 -0
- data/vendor/assets/images/flags/um.png +0 -0
- data/vendor/assets/images/flags/us.png +0 -0
- data/vendor/assets/images/flags/uy.png +0 -0
- data/vendor/assets/images/flags/uz.png +0 -0
- data/vendor/assets/images/flags/va.png +0 -0
- data/vendor/assets/images/flags/vc.png +0 -0
- data/vendor/assets/images/flags/ve.png +0 -0
- data/vendor/assets/images/flags/vg.png +0 -0
- data/vendor/assets/images/flags/vi.png +0 -0
- data/vendor/assets/images/flags/vn.png +0 -0
- data/vendor/assets/images/flags/vu.png +0 -0
- data/vendor/assets/images/flags/wales.png +0 -0
- data/vendor/assets/images/flags/wf.png +0 -0
- data/vendor/assets/images/flags/ws.png +0 -0
- data/vendor/assets/images/flags/ye.png +0 -0
- data/vendor/assets/images/flags/yt.png +0 -0
- data/vendor/assets/images/flags/za.png +0 -0
- data/vendor/assets/images/flags/zm.png +0 -0
- data/vendor/assets/images/flags/zw.png +0 -0
- data/vendor/assets/images/jquery.formalize/button.png +0 -0
- data/vendor/assets/images/jquery.formalize/select_arrow.gif +0 -0
- data/vendor/assets/javascripts/jquery.formalize.min.js +0 -1
- data/vendor/assets/stylesheets/jquery.formalize.css.erb +0 -363
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 014616c55d9c2f1cedf9a12976a11155ccaf89b4
|
4
|
+
data.tar.gz: e684794f24c5a6aea4bb452b3c9fe4946f20edfa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2499b1edebd95397a8bbd722fff282fa8a690aeefdd942bb36e1d76cea39422dcafbba3e1edf3a50e5873aac8f6f5fafa614b6a5630e02a351ef71dc4f1e435d
|
7
|
+
data.tar.gz: 2315833e9e0238c35237a51a0462da8ac0ce5ce9b73a6f5220abfb1c49a8318c8f9ab13457599004d916acb389119a779866754761dca40e51906fd5ad88d037
|
File without changes
|
File without changes
|
@@ -25,8 +25,7 @@ module Spree
|
|
25
25
|
|
26
26
|
# Updates the order and advances to the next state (when possible.)
|
27
27
|
def update
|
28
|
-
|
29
|
-
if @order.update_from_params(massaged_params, permitted_checkout_attributes, request.headers.env)
|
28
|
+
if OrderUpdateAttributes.new(@order, update_params, request_env: request.headers.env).apply
|
30
29
|
@order.temporary_address = !params[:save_user_address]
|
31
30
|
success = if @order.state == 'confirm'
|
32
31
|
@order.complete
|
@@ -52,6 +51,26 @@ module Spree
|
|
52
51
|
end
|
53
52
|
|
54
53
|
private
|
54
|
+
|
55
|
+
def update_params
|
56
|
+
if update_params = massaged_params[:order]
|
57
|
+
update_params.permit(permitted_checkout_attributes)
|
58
|
+
else
|
59
|
+
# We current allow update requests without any parameters in them.
|
60
|
+
{}
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def massaged_params
|
65
|
+
massaged_params = params.deep_dup
|
66
|
+
|
67
|
+
move_payment_source_into_payments_attributes(massaged_params)
|
68
|
+
move_existing_card_into_payments_attributes(massaged_params)
|
69
|
+
set_payment_parameters_amount(massaged_params, @order)
|
70
|
+
|
71
|
+
massaged_params
|
72
|
+
end
|
73
|
+
|
55
74
|
def ensure_valid_state
|
56
75
|
unless skip_state_validation?
|
57
76
|
if (params[:state] && !@order.has_checkout_step?(params[:state])) ||
|
@@ -61,7 +80,7 @@ module Spree
|
|
61
80
|
end
|
62
81
|
end
|
63
82
|
|
64
|
-
# Fix for
|
83
|
+
# Fix for https://github.com/spree/spree/issues/4117
|
65
84
|
# If confirmation of payment fails, redirect back to payment screen
|
66
85
|
if params[:state] == "confirm" && @order.payment_required? && @order.payments.valid.empty?
|
67
86
|
flash.keep
|
@@ -45,7 +45,7 @@ module Spree
|
|
45
45
|
variant = Spree::Variant.find(params[:variant_id])
|
46
46
|
quantity = params[:quantity].to_i
|
47
47
|
|
48
|
-
# 2,147,483,647 is crazy. See issue
|
48
|
+
# 2,147,483,647 is crazy. See issue https://github.com/spree/spree/issues/2695.
|
49
49
|
if quantity.between?(1, 2_147_483_647)
|
50
50
|
begin
|
51
51
|
order.contents.add(variant, quantity)
|
@@ -38,24 +38,24 @@
|
|
38
38
|
<% have_states = !address.country.states.empty? %>
|
39
39
|
<%= form.label :state, Spree.t(:state) %><span class='required' id=<%="#{address_id}state-required"%>>*</span><br/>
|
40
40
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
41
|
+
<% state_elements = [
|
42
|
+
form.collection_select(:state_id, address.country.states,
|
43
|
+
:id, :name,
|
44
|
+
{:include_blank => true},
|
45
|
+
{:class => have_states ? 'required' : 'hidden',
|
46
|
+
:disabled => !have_states}) +
|
47
|
+
form.text_field(:state_name,
|
48
|
+
:class => !have_states ? 'required' : 'hidden',
|
49
|
+
:disabled => have_states)
|
50
|
+
].join.gsub('"', "'").gsub("\n", "")
|
51
|
+
%>
|
52
|
+
<%= javascript_tag do -%>
|
53
|
+
$('#<%="#{address_id}state" %>').append("<%== state_elements %>");
|
54
|
+
<% end %>
|
55
|
+
</p>
|
55
56
|
<noscript>
|
56
57
|
<%= form.text_field :state_name, :class => 'required' %>
|
57
58
|
</noscript>
|
58
|
-
</p>
|
59
59
|
<% end %>
|
60
60
|
|
61
61
|
<p class="field" id=<%="#{address_id}zipcode" %>>
|
@@ -3,13 +3,12 @@
|
|
3
3
|
|
4
4
|
<p class="field">
|
5
5
|
<%= label_tag "name_on_card_#{payment_method.id}", Spree.t(:name_on_card) %><span class="required">*</span><br />
|
6
|
-
<%= text_field_tag "#{param_prefix}[name]", "#{@order.billing_firstname} #{@order.billing_lastname}", { id: "name_on_card_#{payment_method.id}"} %>
|
6
|
+
<%= text_field_tag "#{param_prefix}[name]", "#{@order.billing_firstname} #{@order.billing_lastname}", { id: "name_on_card_#{payment_method.id}", :autocomplete => "cc-name" } %>
|
7
7
|
</p>
|
8
8
|
|
9
9
|
<p class="field" data-hook="card_number">
|
10
10
|
<%= label_tag "card_number", Spree.t(:card_number) %><span class="required">*</span><br />
|
11
|
-
|
12
|
-
<%= text_field_tag "#{param_prefix}[number]", '', options_hash.merge(:id => 'card_number', :class => 'required cardNumber', :size => 19, :maxlength => 19, :autocomplete => "off") %>
|
11
|
+
<%= text_field_tag "#{param_prefix}[number]", '', {:id => 'card_number', :class => 'required cardNumber', :size => 19, :maxlength => 19, :autocomplete => "cc-number", type: "tel"} %>
|
13
12
|
|
14
13
|
<span id="card_type" style="display:none;">
|
15
14
|
( <span id="looks_like" ><%= Spree.t(:card_type_is) %> <span id="type"></span></span>
|
@@ -20,12 +19,12 @@
|
|
20
19
|
|
21
20
|
<p class="field" data-hook="card_expiration">
|
22
21
|
<%= label_tag "card_expiry", Spree.t(:expiration) %><span class="required">*</span><br />
|
23
|
-
<%= text_field_tag "#{param_prefix}[expiry]", '', :id => 'card_expiry', :class => "required cardExpiry", :placeholder => "MM / YY" %>
|
22
|
+
<%= text_field_tag "#{param_prefix}[expiry]", '', :id => 'card_expiry', :class => "required cardExpiry", :placeholder => "MM / YY", type: "tel" %>
|
24
23
|
</p>
|
25
24
|
|
26
25
|
<p class="field" data-hook="card_code">
|
27
26
|
<%= label_tag "card_code", Spree.t(:card_code) %><span class="required">*</span><br />
|
28
|
-
<%= text_field_tag "#{param_prefix}[verification_value]", '',
|
27
|
+
<%= text_field_tag "#{param_prefix}[verification_value]", '', {:id => 'card_code', :class => 'required cardCode', :size => 5, type: "tel", autocomplete: "off"} %>
|
29
28
|
<%= link_to "(#{Spree.t(:what_is_this)})", spree.cvv_path, :target => '_blank', "data-hook" => "cvv_link", :id => "cvv_link" %>
|
30
29
|
</p>
|
31
30
|
|
File without changes
|
data/lib/spree/frontend.rb
CHANGED
data/solidus_frontend.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# encoding: UTF-8
|
2
|
-
version
|
2
|
+
require_relative '../core/lib/spree/core/version.rb'
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.platform = Gem::Platform::RUBY
|
6
6
|
s.name = 'solidus_frontend'
|
7
|
-
s.version =
|
7
|
+
s.version = Spree.solidus_version
|
8
8
|
s.summary = 'Cart and storefront for the Solidus e-commerce project.'
|
9
9
|
s.description = s.summary
|
10
10
|
|
@@ -18,13 +18,11 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.require_path = 'lib'
|
19
19
|
s.requirements << 'none'
|
20
20
|
|
21
|
-
s.add_dependency 'solidus_api', version
|
22
|
-
s.add_dependency 'solidus_core', version
|
21
|
+
s.add_dependency 'solidus_api', s.version
|
22
|
+
s.add_dependency 'solidus_core', s.version
|
23
23
|
|
24
24
|
s.add_dependency 'canonical-rails', '~> 0.0.4'
|
25
25
|
s.add_dependency 'jquery-rails'
|
26
|
-
s.add_dependency 'sass-rails'
|
27
|
-
s.add_dependency 'coffee-rails'
|
28
26
|
|
29
27
|
s.add_development_dependency 'capybara-accessible'
|
30
28
|
end
|
@@ -7,7 +7,6 @@ describe Spree::ProductsController, :type => :controller do
|
|
7
7
|
|
8
8
|
before do
|
9
9
|
I18n.enforce_available_locales = false
|
10
|
-
expect(I18n).to receive(:available_locales).and_return([:en, :de])
|
11
10
|
Spree::Frontend::Config[:locale] = :de
|
12
11
|
end
|
13
12
|
|
@@ -17,7 +16,7 @@ describe Spree::ProductsController, :type => :controller do
|
|
17
16
|
I18n.enforce_available_locales = true
|
18
17
|
end
|
19
18
|
|
20
|
-
# Regression test for
|
19
|
+
# Regression test for https://github.com/spree/spree/issues/1184
|
21
20
|
it "sets the default locale based off Spree::Frontend::Config[:locale]" do
|
22
21
|
expect(I18n.locale).to eq(:en)
|
23
22
|
spree_get :index
|
@@ -41,7 +41,7 @@ describe Spree::CheckoutController, :type => :controller do
|
|
41
41
|
expect(response).to redirect_to(spree.cart_path)
|
42
42
|
end
|
43
43
|
|
44
|
-
# Regression test for
|
44
|
+
# Regression test for https://github.com/spree/spree/issues/2280
|
45
45
|
it "should redirect to current step trying to access a future step" do
|
46
46
|
order.update_column(:state, "address")
|
47
47
|
spree_get :edit, { :state => "delivery" }
|
@@ -81,17 +81,18 @@ describe Spree::CheckoutController, :type => :controller do
|
|
81
81
|
}
|
82
82
|
end
|
83
83
|
|
84
|
-
let!(:payment_method) { create(:payment_method) }
|
85
84
|
before do
|
86
85
|
# Must have *a* shipping method and a payment method so updating from address works
|
87
|
-
allow(order).to receive_messages
|
86
|
+
allow(order).to receive_messages :available_shipping_methods => [stub_model(Spree::ShippingMethod)]
|
87
|
+
allow(order).to receive_messages :available_payment_methods => [stub_model(Spree::PaymentMethod)]
|
88
|
+
allow(order).to receive_messages :ensure_available_shipping_rates => true
|
88
89
|
order.line_items << FactoryGirl.create(:line_item)
|
89
90
|
end
|
90
91
|
|
91
92
|
context "with the order in the cart state" do
|
92
93
|
before do
|
94
|
+
order.update_attributes! user: user
|
93
95
|
order.update_column(:state, "cart")
|
94
|
-
allow(order).to receive_messages :user => user
|
95
96
|
end
|
96
97
|
|
97
98
|
it "should assign order" do
|
@@ -125,24 +126,22 @@ describe Spree::CheckoutController, :type => :controller do
|
|
125
126
|
|
126
127
|
context "current_user doesnt respond to persist_order_address" do
|
127
128
|
it "doesnt raise any error" do
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
:
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
}
|
137
|
-
}.to_not raise_error
|
129
|
+
spree_post :update, {
|
130
|
+
:state => "address",
|
131
|
+
:order => {
|
132
|
+
:bill_address_attributes => address_params,
|
133
|
+
:use_billing => true
|
134
|
+
},
|
135
|
+
:save_user_address => "1"
|
136
|
+
}
|
138
137
|
end
|
139
138
|
end
|
140
139
|
end
|
141
140
|
|
142
141
|
context "with the order in the address state" do
|
143
142
|
before do
|
143
|
+
order.update_attributes! user: user
|
144
144
|
order.update_columns(ship_address_id: create(:address).id, state: "address")
|
145
|
-
allow(order).to receive_messages user: user
|
146
145
|
end
|
147
146
|
|
148
147
|
context "with a billing and shipping address" do
|
@@ -169,7 +168,24 @@ describe Spree::CheckoutController, :type => :controller do
|
|
169
168
|
end
|
170
169
|
end
|
171
170
|
|
172
|
-
|
171
|
+
# This is the only time that we need the 'set_payment_parameters_amount'
|
172
|
+
# controller code, because otherwise the transition to 'confirm' will
|
173
|
+
# trigger the 'add_store_credit_payments' transition code which will do
|
174
|
+
# the same thing here.
|
175
|
+
# Perhaps we can just remove 'set_payment_parameters_amount' entirely at
|
176
|
+
# some point?
|
177
|
+
context "when there is a checkout step between payment and confirm" do
|
178
|
+
before do
|
179
|
+
@old_checkout_flow = Spree::Order.checkout_flow
|
180
|
+
Spree::Order.class_eval do
|
181
|
+
insert_checkout_step :new_step, after: :payment
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
after do
|
186
|
+
Spree::Order.checkout_flow(&@old_checkout_flow)
|
187
|
+
end
|
188
|
+
|
173
189
|
let(:order) { create(:order_with_line_items) }
|
174
190
|
let(:payment_method) { create(:credit_card_payment_method) }
|
175
191
|
|
@@ -180,10 +196,10 @@ describe Spree::CheckoutController, :type => :controller do
|
|
180
196
|
payments_attributes: [
|
181
197
|
{
|
182
198
|
payment_method_id: payment_method.id.to_s,
|
183
|
-
source_attributes: attributes_for(:credit_card)
|
184
|
-
}
|
185
|
-
]
|
186
|
-
}
|
199
|
+
source_attributes: attributes_for(:credit_card),
|
200
|
+
},
|
201
|
+
],
|
202
|
+
},
|
187
203
|
}
|
188
204
|
end
|
189
205
|
|
@@ -192,34 +208,19 @@ describe Spree::CheckoutController, :type => :controller do
|
|
192
208
|
3.times { order.next! } # should put us in the payment state
|
193
209
|
end
|
194
210
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
expect(order.payments.first.amount).to eq(order.total)
|
202
|
-
end
|
203
|
-
end
|
204
|
-
|
205
|
-
context 'with an unpermitted payment method' do
|
206
|
-
before { payment_method.update!(display_on: "back_end") }
|
207
|
-
|
208
|
-
it 'sets the payment amount' do
|
209
|
-
expect {
|
210
|
-
post :update, params
|
211
|
-
}.to raise_error(ActiveRecord::RecordNotFound)
|
212
|
-
|
213
|
-
expect(order.state).to eq('payment')
|
214
|
-
expect(order.payments).to be_empty
|
215
|
-
end
|
211
|
+
it 'sets the payment amount' do
|
212
|
+
spree_post :update, params
|
213
|
+
order.reload
|
214
|
+
expect(order.state).to eq('new_step')
|
215
|
+
expect(order.payments.size).to eq(1)
|
216
|
+
expect(order.payments.first.amount).to eq(order.total)
|
216
217
|
end
|
217
218
|
end
|
218
219
|
|
219
220
|
context "when in the confirm state" do
|
220
221
|
before do
|
222
|
+
order.update_attributes! user: user
|
221
223
|
order.update_column(:state, "confirm")
|
222
|
-
allow(order).to receive_messages :user => user
|
223
224
|
# An order requires a payment to reach the complete state
|
224
225
|
# This is because payment_required? is true on the order
|
225
226
|
create(:payment, :amount => order.total, :order => order)
|
@@ -227,7 +228,7 @@ describe Spree::CheckoutController, :type => :controller do
|
|
227
228
|
order.payments.reload
|
228
229
|
end
|
229
230
|
|
230
|
-
# This inadvertently is a regression test for
|
231
|
+
# This inadvertently is a regression test for https://github.com/spree/spree/issues/2694
|
231
232
|
it "should redirect to the order view" do
|
232
233
|
spree_post :update, {:state => "confirm"}
|
233
234
|
expect(response).to redirect_to spree.order_path(order)
|
@@ -248,12 +249,12 @@ describe Spree::CheckoutController, :type => :controller do
|
|
248
249
|
|
249
250
|
context "save unsuccessful" do
|
250
251
|
before do
|
251
|
-
|
252
|
-
allow(order).to receive_messages
|
252
|
+
order.update_attributes! user: user
|
253
|
+
allow(order).to receive_messages valid?: false
|
253
254
|
end
|
254
255
|
|
255
256
|
it "should not assign order" do
|
256
|
-
spree_post :update, {:state => "address"}
|
257
|
+
spree_post :update, {:state => "address", email: ''}
|
257
258
|
expect(assigns[:order]).not_to be_nil
|
258
259
|
end
|
259
260
|
|
@@ -283,8 +284,8 @@ describe Spree::CheckoutController, :type => :controller do
|
|
283
284
|
|
284
285
|
context "Spree::Core::GatewayError" do
|
285
286
|
before do
|
286
|
-
|
287
|
-
allow(order).to receive(:
|
287
|
+
order.update_attributes! user: user
|
288
|
+
allow(order).to receive(:next).and_raise(Spree::Core::GatewayError.new("Invalid something or other."))
|
288
289
|
spree_post :update, {:state => "address"}
|
289
290
|
end
|
290
291
|
|
@@ -310,7 +311,7 @@ describe Spree::CheckoutController, :type => :controller do
|
|
310
311
|
|
311
312
|
context "when the order is invalid" do
|
312
313
|
before do
|
313
|
-
allow(order).to receive_messages :
|
314
|
+
allow(order).to receive_messages :valid? => true, :next => nil
|
314
315
|
order.errors.add :base, 'Base error'
|
315
316
|
order.errors.add :adjustments, 'error'
|
316
317
|
end
|
@@ -12,7 +12,7 @@ describe Spree::CheckoutController, type: :controller do
|
|
12
12
|
allow(controller).to receive_messages try_spree_current_user: user
|
13
13
|
end
|
14
14
|
|
15
|
-
# Regression test for
|
15
|
+
# Regression test for https://github.com/spree/spree/issues/3246
|
16
16
|
context "when using GBP" do
|
17
17
|
before do
|
18
18
|
Spree::Config[:currency] = "GBP"
|
@@ -100,7 +100,7 @@ describe Spree::OrdersController, :type => :controller do
|
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
|
-
# Regression test for
|
103
|
+
# Regression test for https://github.com/spree/spree/issues/2750
|
104
104
|
context "#update" do
|
105
105
|
before do
|
106
106
|
allow(user).to receive :last_incomplete_spree_order
|