effective_orders 6.14.0 → 6.14.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/effective_orders_helper.rb +3 -2
- data/app/models/effective/deluxe_api.rb +1 -1
- data/app/models/effective/order.rb +6 -5
- data/app/views/effective/orders/_checkout_step2.html.haml +1 -1
- data/app/views/effective/orders/_order.html.haml +1 -0
- data/app/views/effective/orders/_order_declined.html.haml +10 -0
- data/app/views/effective/orders/deluxe/_form.html.haml +6 -0
- data/app/views/effective/orders/deluxe_delayed/_form.html.haml +6 -0
- data/lib/effective_orders/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8cf1b8a712cd4036831fa035ddb6e280ca44307716b31a80b3bd948e0b36f14
|
4
|
+
data.tar.gz: a09ada8e776fab3cd456cf25c7ec2bbfac11227284a5eb1cbbaa1def7bb58338
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3eea69bda0d556573b73307b85b81d807a1cb68050011624c4dd0fd0daeac315aa8f635a4d58984db2582b8b6830dba2e2df5a6e8e1ce10ab9f767014655f2cd
|
7
|
+
data.tar.gz: 7cc01b47024b249e44e80401eba5ef94a66dd3c9b74220cb390620d484bab542527b58cc092e7e3e6ccef9ca6f356f315b13e27852e3ea90c249d524b65f7d57
|
@@ -119,12 +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, skip_order:
|
122
|
+
def render_checkout_step1(order, namespace: nil, purchased_url: nil, declined_url: nil, deferred_url: nil, skip_deferred: false, skip_order: nil)
|
123
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, skip_order:
|
127
|
+
def render_checkout_step2(order, namespace: nil, purchased_url: nil, declined_url: nil, deferred_url: nil, skip_deferred: false, skip_order: nil)
|
128
|
+
skip_order = order.delayed_payment_date_upcoming? if skip_order.nil?
|
128
129
|
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
130
|
render(partial: 'effective/orders/checkout_step2', locals: locals)
|
130
131
|
end
|
@@ -181,7 +181,7 @@ module Effective
|
|
181
181
|
|
182
182
|
# This is only used for testing
|
183
183
|
def generate_payment_intent(card: nil, expiry: nil, cvv: nil, encode: false)
|
184
|
-
card ||= '
|
184
|
+
card ||= '5555 5555 5555 4444'
|
185
185
|
expiry ||= "12/#{Time.zone.now.year - 1998}"
|
186
186
|
cvv ||= '123'
|
187
187
|
|
@@ -566,6 +566,12 @@ module Effective
|
|
566
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
|
+
def delayed_payment_date_past?
|
570
|
+
return false unless delayed?
|
571
|
+
delayed_payment_date <= Time.zone.now.to_date
|
572
|
+
end
|
573
|
+
|
574
|
+
# This is checked by an effective_orders view helper. When upcoming we only collect card info.
|
569
575
|
def delayed_payment_date_upcoming?
|
570
576
|
return false unless delayed?
|
571
577
|
delayed_payment_date > Time.zone.now.to_date
|
@@ -576,11 +582,6 @@ module Effective
|
|
576
582
|
delayed_payment_date == Time.zone.now.to_date
|
577
583
|
end
|
578
584
|
|
579
|
-
def delayed_payment_date_past?
|
580
|
-
return false unless delayed?
|
581
|
-
delayed_payment_date < Time.zone.now.to_date
|
582
|
-
end
|
583
|
-
|
584
585
|
def pending_refund?
|
585
586
|
return false if EffectiveOrders.buyer_purchases_refund?
|
586
587
|
return false if purchased?
|
@@ -9,7 +9,7 @@
|
|
9
9
|
.effective-order-purchase-actions
|
10
10
|
- provider_locals = { order: order, purchased_url: purchased_url, declined_url: declined_url, deferred_url: deferred_url }
|
11
11
|
|
12
|
-
- if EffectiveOrders.delayed? && order.
|
12
|
+
- if EffectiveOrders.delayed? && order.delayed_payment_date_upcoming?
|
13
13
|
= render partial: '/effective/orders/delayed/form', locals: provider_locals
|
14
14
|
|
15
15
|
- elsif EffectiveOrders.free? && order.free?
|
@@ -5,6 +5,7 @@
|
|
5
5
|
= render partial: 'effective/orders/order_header', locals: { order: order }
|
6
6
|
= render partial: 'effective/orders/order_payment', locals: { order: order }
|
7
7
|
= render partial: 'effective/orders/order_shipping', locals: { order: order }
|
8
|
+
= render partial: 'effective/orders/order_declined', locals: { order: order }
|
8
9
|
= render partial: 'effective/orders/order_deferred', locals: { order: order }
|
9
10
|
= render partial: 'effective/orders/order_notes', locals: { order: order }
|
10
11
|
= render partial: 'effective/orders/order_items', locals: { order: order }
|
@@ -13,4 +13,10 @@
|
|
13
13
|
-# This is set by the deluxe.js javascript on Submit
|
14
14
|
= f.hidden_field :payment_intent, required: true
|
15
15
|
|
16
|
+
- if EffectiveOrders.deluxe[:environment] == 'sandbox'
|
17
|
+
.alert.alert-info.mb-4
|
18
|
+
This is the #{Rails.env.upcase} SERVER.
|
19
|
+
%br
|
20
|
+
Use credit card number 5555 5555 5555 4444 with any future expiry and any CVC.
|
21
|
+
|
16
22
|
= render('effective/orders/deluxe/element')
|
@@ -7,4 +7,10 @@
|
|
7
7
|
-# This is set by the deluxe.js javascript on Submit
|
8
8
|
= f.hidden_field :payment_intent, required: true
|
9
9
|
|
10
|
+
- if EffectiveOrders.deluxe[:environment] == 'sandbox'
|
11
|
+
.alert.alert-info.mb-4
|
12
|
+
This is the #{Rails.env.upcase} SERVER.
|
13
|
+
%br
|
14
|
+
Use credit card number 5555 5555 5555 4444 with any future expiry and any CVC.
|
15
|
+
|
10
16
|
= render('effective/orders/deluxe_delayed/element')
|
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.14.
|
4
|
+
version: 6.14.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-07-
|
11
|
+
date: 2024-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -286,6 +286,7 @@ files:
|
|
286
286
|
- app/views/effective/orders/_layout.html.haml
|
287
287
|
- app/views/effective/orders/_order.html.haml
|
288
288
|
- app/views/effective/orders/_order_actions.html.haml
|
289
|
+
- app/views/effective/orders/_order_declined.html.haml
|
289
290
|
- app/views/effective/orders/_order_deferred.html.haml
|
290
291
|
- app/views/effective/orders/_order_footer.html.haml
|
291
292
|
- app/views/effective/orders/_order_header.html.haml
|