effective_orders 5.1.12 → 5.1.16

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: 436e77b078b12d2931ad0bf50e1f8572bfb6dca3cc7b021e0a867660ddd327c2
4
- data.tar.gz: 128a0aece9b52ec31d4e5ff31ddd6a66f5179aeb7078542a5a5561d662745ebd
3
+ metadata.gz: 10fa799dadd79ae6192722a7d29f480ad372d365c4c295ad20caba9333adf870
4
+ data.tar.gz: 50bef2fb6897946ef1c4cfd5ea4f1ec1206f7c6c7bdbcd5f2c870e74df4f64ff
5
5
  SHA512:
6
- metadata.gz: 9b567e4f3078270590a92a12c4f27326a9c525b30e3ec8b2ed9ab31bc7d34f48b0fbab6a9ba0be8d00da8fd132b5d8032072b58e8c20da74f1e9b4017601b848
7
- data.tar.gz: 0127161fde74a4fb97aec8c54ade566fed751e5bfd49f9d694b6a18d64d27bdd020a4106399c11121f1a661e9f127c56368a3771c977586cdf55b542147ffa5e
6
+ metadata.gz: 30618483d585285861731af2412da46038280c262ce8b505eccf28c8cbd299cbade02cc23e591a93a356f4da7dff7e841befce1f2e79700c07e2d9be5a184952
7
+ data.tar.gz: 94e91ea2d22d080468617a22327bfd3122e092d5f8e347abe5fb571ab7ffda771d2f67a0ed1ae71b971380a38e514bb58c3d54bc9ba39639aa929cc536fef9d7
@@ -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
 
@@ -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?
@@ -5,10 +5,7 @@
5
5
  = order.refund? ? 'Complete Refund' : 'Mark as Paid'
6
6
 
7
7
  = effective_form_with(model: order, url: effective_orders.mark_as_paid_order_path(order), method: :post) do |f|
8
- - if order.refund?
9
- = f.hidden_field :purchased_at, value: Time.zone.now
10
- - else
11
- = f.date_field :purchased_at, required: true
8
+ = f.hidden_field :purchased_at, value: Time.zone.now
12
9
 
13
10
  = f.select :payment_provider, EffectiveOrders.payment_providers, required: true
14
11
 
@@ -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.12'.freeze
2
+ VERSION = '5.1.16'.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.12
4
+ version: 5.1.16
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-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails