effective_orders 6.13.0 → 6.13.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8049636b7c27adef561a64502f766ffb04c2eee32aa20b67f4d23b0a9558750f
|
4
|
+
data.tar.gz: 42f995d287210bbffbc9e8dd51ba7dd0eb80532b2cd29a83b8bb6bf8fb1f0f12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80972c78f2afd52689269f44afe7db244d7a0f3920de43b0fac5edd875b2e984f38f7c67c69e189fb2d19e0de87d436092a1d41c7e9edf940a0f12f3e531dd60
|
7
|
+
data.tar.gz: c4e54da784e04f5d10433b11ac757a72044fc1e217cdc538248b41eaae24e8b4acac02959e6eb7ddd9eca9e959640139dc8057593f0009495b98e0f7a1ec48a5
|
@@ -119,13 +119,13 @@ module EffectiveOrdersHelper
|
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
122
|
-
def render_checkout_step1(order, namespace: nil, purchased_url: nil, declined_url: nil, deferred_url: nil, skip_deferred: false)
|
123
|
-
locals = { order: order, purchased_url: purchased_url, declined_url: declined_url, deferred_url: deferred_url, namespace: namespace, skip_deferred: skip_deferred }
|
122
|
+
def render_checkout_step1(order, namespace: nil, purchased_url: nil, declined_url: nil, deferred_url: nil, skip_deferred: false, skip_order: false)
|
123
|
+
locals = { order: order, purchased_url: purchased_url, declined_url: declined_url, deferred_url: deferred_url, namespace: namespace, skip_deferred: skip_deferred, skip_order: skip_order }
|
124
124
|
render(partial: 'effective/orders/checkout_step1', locals: locals)
|
125
125
|
end
|
126
126
|
|
127
|
-
def render_checkout_step2(order, namespace: nil, purchased_url: nil, declined_url: nil, deferred_url: nil, skip_deferred: false)
|
128
|
-
locals = { order: order, purchased_url: purchased_url, declined_url: declined_url, deferred_url: deferred_url, namespace: namespace, skip_deferred: skip_deferred }
|
127
|
+
def render_checkout_step2(order, namespace: nil, purchased_url: nil, declined_url: nil, deferred_url: nil, skip_deferred: false, skip_order: false)
|
128
|
+
locals = { order: order, purchased_url: purchased_url, declined_url: declined_url, deferred_url: deferred_url, namespace: namespace, skip_deferred: skip_deferred, skip_order: skip_order }
|
129
129
|
render(partial: 'effective/orders/checkout_step2', locals: locals)
|
130
130
|
end
|
131
131
|
|
@@ -131,6 +131,10 @@ module ActsAsPurchasable
|
|
131
131
|
self[:purchased_at] || purchased_order.try(:purchased_at)
|
132
132
|
end
|
133
133
|
|
134
|
+
def deferred_at
|
135
|
+
self[:deferred_at] || orders.find { |order| order.deferred? }.try(:deferred_at)
|
136
|
+
end
|
137
|
+
|
134
138
|
def purchased_by?(user)
|
135
139
|
purchased_orders.any? { |order| order.purchased_by_id == user.id }
|
136
140
|
end
|
@@ -563,7 +563,7 @@ module Effective
|
|
563
563
|
return unless delayed? && deferred?
|
564
564
|
return unless delayed_payment_date_upcoming?
|
565
565
|
|
566
|
-
"Your #{delayed_payment_method} will be charged on #{delayed_payment_date.strftime('%F')}
|
566
|
+
"Your #{delayed_payment_method} will be charged $#{'%0.2f' % total_to_f} on #{delayed_payment_date.strftime('%F')}"
|
567
567
|
end
|
568
568
|
|
569
569
|
def delayed_payment_date_upcoming?
|
@@ -664,6 +664,12 @@ module Effective
|
|
664
664
|
present_order_items.each { |oi| oi.update_purchasable_attributes }
|
665
665
|
end
|
666
666
|
|
667
|
+
def update_purchasable_attributes!
|
668
|
+
raise('cannot update purchasable attributes of a purchased order') if purchased?
|
669
|
+
update_purchasable_attributes
|
670
|
+
save!
|
671
|
+
end
|
672
|
+
|
667
673
|
# Call this as a way to skip over non consequential orders
|
668
674
|
# And mark some purchasables purchased
|
669
675
|
# This is different than the Mark as Paid payment processor
|
@@ -3,20 +3,21 @@
|
|
3
3
|
.effective-order-change-items
|
4
4
|
= link_to 'Change Addresses', effective_orders.edit_order_path(order), rel: :nofollow
|
5
5
|
|
6
|
-
|
6
|
+
- unless local_assigns[:skip_order]
|
7
|
+
= render('/effective/orders/order', order: order, no_order_actions: true)
|
7
8
|
|
8
9
|
.effective-order-purchase-actions
|
9
10
|
- provider_locals = { order: order, purchased_url: purchased_url, declined_url: declined_url, deferred_url: deferred_url }
|
10
11
|
|
11
|
-
- if EffectiveOrders.
|
12
|
+
- if EffectiveOrders.delayed? && order.delayed?
|
13
|
+
= render partial: '/effective/orders/delayed/form', locals: provider_locals
|
14
|
+
|
15
|
+
- elsif EffectiveOrders.free? && order.free?
|
12
16
|
= render partial: '/effective/orders/free/form', locals: provider_locals
|
13
17
|
|
14
18
|
- elsif EffectiveOrders.refund? && order.refund?
|
15
19
|
= render partial: '/effective/orders/refund/form', locals: provider_locals
|
16
20
|
|
17
|
-
- elsif EffectiveOrders.delayed? && order.delayed?
|
18
|
-
= render partial: '/effective/orders/delayed/form', locals: provider_locals
|
19
|
-
|
20
21
|
- else
|
21
22
|
- if EffectiveOrders.pretend?
|
22
23
|
= render partial: '/effective/orders/pretend/form', locals: provider_locals
|
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.13.
|
4
|
+
version: 6.13.2
|
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: 2024-06-
|
11
|
+
date: 2024-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|