effective_orders 5.1.13 → 5.1.17

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: d17fbe687d0cbbb9a8bea76c5a537d26edd929655f7ca620266ea9c9de1935f2
4
- data.tar.gz: 49d1e34f960ce258483823bab108460344934bd6d4d3666655e523a56458f729
3
+ metadata.gz: fa911b81a28b5ad8ba481ed1703a6836962c8e7f518aa32867c4cb7ab0d69ea4
4
+ data.tar.gz: 4057277fcb79978c3f683bfdbabec721ae11d9f4672e4b083633772b6eef63bc
5
5
  SHA512:
6
- metadata.gz: e6aca42047832dbf391eeca8ac2f8fb6a896900ccc6e4e418b1463c3814c98f00838be8dcbfe26a2f7a065554f9f89537fbbd02cd1a01ebabdea1fe404a5abfa
7
- data.tar.gz: 536e053ad280f5c755524414e1510a7be9cd270166fb50514299125d2a54b8c313ff1fd71265957816fb1a957e446aa51d01ea70cd439aa3effc0e8fa87ee1f9
6
+ metadata.gz: 4cc8f8c2f82922a70241ed058cfc9f77bd501d18ef5f04728a7a894ec12877910027c86b24bdeb272227fea33c2c8615fc8e2b848289d49c51393a918baab2e5
7
+ data.tar.gz: 42f600c039c5d304e11856fcfa609ce6c99a2a43de0453f095b3f5d6f23657bf7a22f1146fe43fe9d87cface7bbabf3ec2d5164bb9d3fe7a0defb22be7553852
@@ -20,8 +20,7 @@ module Effective
20
20
  payment: 'free order. no payment required.',
21
21
  provider: 'free',
22
22
  card: 'none',
23
- purchased_url: free_params[:purchased_url],
24
- email: false
23
+ purchased_url: free_params[:purchased_url]
25
24
  )
26
25
  end
27
26
 
@@ -17,8 +17,10 @@ class Admin::EffectiveOrdersDatatable < Effective::Datatable
17
17
  unless attributes[:skip_filters]
18
18
  scope :all
19
19
  scope :purchased
20
- scope :deferred
21
- scope :refunds
20
+
21
+ scope :deferred if EffectiveOrders.deferred_providers.present?
22
+ scope :refunds if EffectiveOrders.refund
23
+
22
24
  scope :not_purchased
23
25
  end
24
26
  end
@@ -4,8 +4,11 @@ class EffectiveOrdersDatatable < Effective::Datatable
4
4
  filters do
5
5
  unless attributes[:not_purchased]
6
6
  scope :purchased, default: true
7
- scope :deferred
8
- scope :refunds
7
+
8
+ scope :deferred if EffectiveOrders.deferred_providers.present?
9
+ scope :refunds if EffectiveOrders.refund
10
+
11
+ scope :all
9
12
  end
10
13
  end
11
14
 
@@ -68,8 +68,8 @@ module Effective
68
68
  before_validation { assign_order_totals }
69
69
  before_validation { assign_billing_name }
70
70
  before_validation { assign_email }
71
- before_validation { assign_last_address }
72
71
  before_validation { assign_user_address }
72
+ before_validation { assign_last_address }
73
73
 
74
74
  before_validation(if: -> { confirmed_checkout }) do
75
75
  assign_attributes(state: EffectiveOrders::CONFIRMED) if pending?
@@ -388,15 +388,20 @@ module Effective
388
388
  end
389
389
 
390
390
  def send_order_receipt_to_admin?
391
- EffectiveOrders.mailer[:send_order_receipt_to_admin] && !free?
391
+ return false if free? && !EffectiveOrders.mailer[:send_order_receipts_when_free]
392
+ EffectiveOrders.mailer[:send_order_receipt_to_admin]
392
393
  end
393
394
 
394
395
  def send_order_receipt_to_buyer?
395
- EffectiveOrders.mailer[:send_order_receipt_to_buyer] && !free?
396
+ return false if free? && !EffectiveOrders.mailer[:send_order_receipts_when_free]
397
+ EffectiveOrders.mailer[:send_order_receipt_to_buyer]
396
398
  end
397
399
 
398
400
  def send_payment_request_to_buyer?
399
- EffectiveResources.truthy?(send_payment_request_to_buyer) && !free? && !refund?
401
+ return false if free? && !EffectiveOrders.mailer[:send_order_receipts_when_free]
402
+ return false if refund?
403
+
404
+ EffectiveResources.truthy?(send_payment_request_to_buyer)
400
405
  end
401
406
 
402
407
  def send_mark_as_paid_email_to_buyer?
@@ -95,6 +95,7 @@ EffectiveOrders.setup do |config|
95
95
  send_payment_request_to_buyer: true,
96
96
  send_pending_order_invoice_to_buyer: true,
97
97
  send_order_receipts_when_mark_as_paid: false,
98
+ send_order_receipts_when_free: false,
98
99
 
99
100
  send_subscription_event_to_admin: true,
100
101
  send_subscription_created: true,
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '5.1.13'.freeze
2
+ VERSION = '5.1.17'.freeze
3
3
  end
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: 5.1.13
4
+ version: 5.1.17
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: 2021-09-28 00:00:00.000000000 Z
11
+ date: 2021-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails