effective_orders 6.21.2 → 6.21.4
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39ce34f3c38a2b137ae5d6277b766bab2215e1ef14271dc9ae26ced61897216a
|
4
|
+
data.tar.gz: b27f892799caee6f152f14f6dc3757ca910a1db2568b146736c3aa877c226f15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 496a570f6ce2aa2fa1182c5b341761abb9183ea2da79e6d1e465b8c81bab11590edb529c385c825407258827ab703dfaba7c63da6d8680ccd6e607b2550bff90
|
7
|
+
data.tar.gz: c26a9381da40a34dcfc49dd08c933dc86caf75bc29a80876905081806e04df5ea31b7af64abb9c74aa446cefe1adbf328817b91c4c17f2d458aa5d89a24b6c93
|
@@ -21,7 +21,7 @@ module Effective
|
|
21
21
|
Effective::Cart.where(user: @order.current_user).destroy_all if @order.current_user.present?
|
22
22
|
|
23
23
|
if flash[:success].blank?
|
24
|
-
if email && EffectiveOrders.send_order_receipt_to_buyer
|
24
|
+
if email && EffectiveOrders.send_order_receipt_to_buyer && !@order.skip_order_emails?
|
25
25
|
flash[:success] = "Payment successful! A receipt has been sent to #{@order.email}"
|
26
26
|
else
|
27
27
|
flash[:success] = "Payment successful! An email receipt has not been sent."
|
@@ -612,7 +612,6 @@ module Effective
|
|
612
612
|
present_order_items.map { |oi| oi.quantity }.sum
|
613
613
|
end
|
614
614
|
|
615
|
-
|
616
615
|
def skip_buyer_validations?
|
617
616
|
EffectiveResources.truthy?(skip_buyer_validations)
|
618
617
|
end
|
@@ -628,7 +627,7 @@ module Effective
|
|
628
627
|
self.addresses.clear if addresses.any? { |address| address.valid? == false }
|
629
628
|
save!
|
630
629
|
|
631
|
-
if
|
630
|
+
if send_payment_request_to_buyer?
|
632
631
|
after_commit { send_payment_request_to_buyer! }
|
633
632
|
end
|
634
633
|
|
@@ -879,8 +878,16 @@ module Effective
|
|
879
878
|
(emails + [cc.presence]).compact.uniq.to_sentence
|
880
879
|
end
|
881
880
|
|
881
|
+
def skip_order_emails?
|
882
|
+
return true if purchased? && free? && !EffectiveOrders.send_order_receipts_when_free
|
883
|
+
return true if purchased? && free? && OrderEmail.new(self).event_all_waitlisted?
|
884
|
+
false
|
885
|
+
end
|
886
|
+
|
882
887
|
def send_order_emails!
|
883
|
-
|
888
|
+
return false if skip_order_emails?
|
889
|
+
|
890
|
+
if purchased_or_deferred?
|
884
891
|
EffectiveOrders.send_email(:order_email, self) if EffectiveOrders.send_order_receipt_to_buyer
|
885
892
|
EffectiveOrders.send_email(:order_email_to_admin, self) if EffectiveOrders.send_order_receipt_to_admin
|
886
893
|
end
|
@@ -895,6 +902,10 @@ module Effective
|
|
895
902
|
end
|
896
903
|
end
|
897
904
|
|
905
|
+
def send_payment_request_to_buyer?
|
906
|
+
EffectiveResources.truthy?(send_payment_request_to_buyer)
|
907
|
+
end
|
908
|
+
|
898
909
|
# Admin datatable action
|
899
910
|
def send_payment_request_to_buyer!
|
900
911
|
EffectiveOrders.send_email(:order_email, self, payment_request: true) unless (purchased? || refund?)
|
@@ -43,6 +43,7 @@ module Effective
|
|
43
43
|
|
44
44
|
def subject
|
45
45
|
if event.present? && order.purchased_or_deferred?
|
46
|
+
return "Receipt - Order ##{order.to_param}" if order.purchased? && order.delayed_payment_date_past?
|
46
47
|
return "Confirmation - #{event}" if event_none_waitlisted?
|
47
48
|
return "Confirmation & Waitlist - #{event}" if event_some_waitlisted?
|
48
49
|
return "Waitlist - #{event}" if event_all_waitlisted?
|
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.21.
|
4
|
+
version: 6.21.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: 2025-
|
11
|
+
date: 2025-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|