effective_orders 6.5.3 → 6.5.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/effective_orders/_order.scss +2 -1
- data/app/controllers/effective/orders_controller.rb +4 -2
- data/app/controllers/effective/providers/pretend.rb +16 -7
- data/app/helpers/effective_orders_helper.rb +18 -0
- data/app/views/effective/orders/_checkout_step1.html.haml +9 -4
- data/app/views/effective/orders/_checkout_step2.html.haml +3 -3
- data/app/views/effective/orders/_fields.html.haml +2 -6
- data/app/views/effective/orders/moneris_checkout/_form.html.haml +0 -3
- data/app/views/effective/orders/pretend/_form.html.haml +3 -1
- data/lib/effective_orders/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9556f1f1d36f6ec955075b18a44d4ab62a89d5e9197ed96b7a74e0a9359dc3df
|
4
|
+
data.tar.gz: a21e9a22e9d90d6e1fe75aa76c521d21f7f42d8cee51248d0aacf9ba3aa7a6bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9878d9e12edd59fefc4b4654d54591f1e0bea8b22a833f933086e058b1de81ce3c1907d76522318457ca4181086bd4fc8563dd078cf0e5baf858f99bf7cf259
|
7
|
+
data.tar.gz: 6a86937f2081ed04e7b8b10ede3e9511bd5c84dee08e8a19c35098c68ec39d9b0d152a877ab7156254feb1c3e351c6831f55700d93d41b6c14428be298fa209d
|
@@ -38,6 +38,7 @@
|
|
38
38
|
}
|
39
39
|
|
40
40
|
.effective-order-change-items {
|
41
|
+
text-align: right;
|
41
42
|
margin-bottom: 1rem;
|
42
43
|
}
|
43
44
|
|
@@ -52,7 +53,7 @@ form.new_effective_order {
|
|
52
53
|
}
|
53
54
|
|
54
55
|
.effective-moneris-checkout {
|
55
|
-
height:
|
56
|
+
height: 560px;
|
56
57
|
}
|
57
58
|
|
58
59
|
@media print {
|
@@ -62,14 +62,16 @@ module Effective
|
|
62
62
|
# Might render step1 or step2
|
63
63
|
def show
|
64
64
|
@order = Effective::Order.find(params[:id])
|
65
|
-
|
65
|
+
@page_title ||= view_context.order_page_title(@order)
|
66
66
|
|
67
|
-
|
67
|
+
EffectiveResources.authorize!(self, :show, @order)
|
68
68
|
end
|
69
69
|
|
70
70
|
# Always step1
|
71
71
|
def edit
|
72
72
|
@order ||= Effective::Order.was_not_purchased.find(params[:id])
|
73
|
+
@page_title ||= view_context.order_page_title(@order)
|
74
|
+
|
73
75
|
EffectiveResources.authorize!(self, :edit, @order)
|
74
76
|
end
|
75
77
|
|
@@ -10,13 +10,22 @@ module Effective
|
|
10
10
|
|
11
11
|
EffectiveResources.authorize!(self, :update, @order)
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
13
|
+
if params[:commit].to_s.include?('Decline')
|
14
|
+
order_declined(
|
15
|
+
payment: 'for pretend',
|
16
|
+
provider: 'pretend',
|
17
|
+
card: 'none',
|
18
|
+
declined_url: pretend_params[:declined_url]
|
19
|
+
)
|
20
|
+
else
|
21
|
+
order_purchased(
|
22
|
+
payment: 'for pretend',
|
23
|
+
provider: 'pretend',
|
24
|
+
card: 'none',
|
25
|
+
purchased_url: pretend_params[:purchased_url],
|
26
|
+
current_user: current_user
|
27
|
+
)
|
28
|
+
end
|
20
29
|
end
|
21
30
|
|
22
31
|
def pretend_params
|
@@ -82,6 +82,24 @@ module EffectiveOrdersHelper
|
|
82
82
|
render(partial: 'effective/orders/order', locals: { order: order })
|
83
83
|
end
|
84
84
|
|
85
|
+
def order_page_title(order)
|
86
|
+
raise 'expected an order' unless order.kind_of?(Effective::Order)
|
87
|
+
|
88
|
+
authorized = EffectiveResources.authorized?(self, :update, order)
|
89
|
+
|
90
|
+
if order.purchased? || order.declined?
|
91
|
+
order.to_s
|
92
|
+
elsif authorized && (controller.action_name == 'edit')
|
93
|
+
'Order Review'
|
94
|
+
elsif authorized && (order.confirmed? || order.deferred?) && order.errors.blank?
|
95
|
+
'Checkout'
|
96
|
+
elsif authorized && order.pending?
|
97
|
+
'Order Review'
|
98
|
+
else
|
99
|
+
order.to_s
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
85
103
|
def render_checkout(order, namespace: nil, purchased_url: nil, declined_url: nil, deferred_url: nil)
|
86
104
|
raise 'expected an order' unless order.kind_of?(Effective::Order)
|
87
105
|
raise 'unable to checkout an order without a user or organization' if order && (order.user.blank? && order.organization.blank?)
|
@@ -1,4 +1,9 @@
|
|
1
|
-
.
|
2
|
-
|
3
|
-
=
|
4
|
-
|
1
|
+
- if current_cart.present?
|
2
|
+
.effective-order-change-items
|
3
|
+
= link_to 'Change Items', effective_orders.cart_path, rel: :nofollow
|
4
|
+
|
5
|
+
= render(order, no_order_actions: true)
|
6
|
+
|
7
|
+
= effective_form_with(model: order, url: checkout_step1_form_url(order, namespace)) do |f|
|
8
|
+
= render('effective/orders/fields', order: order, form: f)
|
9
|
+
= f.submit 'Proceed to Checkout'
|
@@ -1,9 +1,9 @@
|
|
1
|
-
= render partial: 'effective/orders/order', locals: { order: order }
|
2
|
-
|
3
1
|
- # Show this if I'm on the effective orders checkout screen. But not on a rendered order.
|
4
2
|
- if order.persisted? && order.user == current_user && request.path.to_s.start_with?(effective_orders.order_path(order))
|
5
3
|
.effective-order-change-items
|
6
|
-
= link_to 'Change Addresses', effective_orders.edit_order_path(order), rel: :nofollow
|
4
|
+
= link_to 'Change Addresses', effective_orders.edit_order_path(order), rel: :nofollow
|
5
|
+
|
6
|
+
= render(order, no_order_actions: true)
|
7
7
|
|
8
8
|
.effective-order-purchase-actions
|
9
9
|
- provider_locals = { order: order, purchased_url: purchased_url, declined_url: declined_url, deferred_url: deferred_url }
|
@@ -1,14 +1,10 @@
|
|
1
1
|
- form ||= local_assigns[:form] || local_assigns[:f]
|
2
2
|
|
3
|
-
= render 'effective/orders/order_notes', order: form.object
|
4
|
-
= render 'effective/orders/order_items', order: form.object
|
3
|
+
-# = render 'effective/orders/order_notes', order: form.object
|
4
|
+
-# = render 'effective/orders/order_items', order: form.object
|
5
5
|
|
6
6
|
= form.hidden_field :confirmed_checkout, value: true
|
7
7
|
|
8
|
-
- if current_cart.present?
|
9
|
-
.effective-order-change-items
|
10
|
-
= link_to 'Change Items', effective_orders.cart_path, rel: :nofollow, class: 'btn btn-secondary'
|
11
|
-
|
12
8
|
- num_addresses = [EffectiveOrders.billing_address, EffectiveOrders.shipping_address].count(true)
|
13
9
|
|
14
10
|
- if num_addresses > 0
|
@@ -4,9 +4,6 @@
|
|
4
4
|
|
5
5
|
.card
|
6
6
|
.card-body.bg-light
|
7
|
-
.mb-3.text-center
|
8
|
-
%h2 Checkout
|
9
|
-
|
10
7
|
= effective_form_with(scope: :moneris_checkout, url: effective_orders.moneris_checkout_order_path(order), data: { 'moneris-checkout-form': moneris_checkout.to_json }) do |f|
|
11
8
|
= f.hidden_field :purchased_url, value: purchased_url
|
12
9
|
= f.hidden_field :declined_url, value: declined_url
|
@@ -9,4 +9,6 @@
|
|
9
9
|
- if EffectiveOrders.pretend_message.present?
|
10
10
|
%p= EffectiveOrders.pretend_message
|
11
11
|
|
12
|
-
= f.submit
|
12
|
+
= f.submit(border: false, center: true) do
|
13
|
+
= f.save order_checkout_label(:pretend)
|
14
|
+
= f.save order_checkout_label(:pretend).gsub('Purchase', 'Decline')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_orders
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.5.
|
4
|
+
version: 6.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|