effective_orders 6.18.0 → 6.18.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: '0559a1dd68e0c43937ccf7a6e13c0f4e8f54c0bf79382744a360f5151b613340'
4
- data.tar.gz: 1ae3981f93b86d70bc6706b7688351d3ea555aa9700265e9dc62616eb449f96c
3
+ metadata.gz: 30573ea76732efc461d77ac72855675f2a8de7010a81e9d651fafaceb86c75c5
4
+ data.tar.gz: 605bb5659cb3b7faf9e0940ed59367b3abfc09535f9f42dcb4048594f1408c09
5
5
  SHA512:
6
- metadata.gz: 4e44abc94fabf240ca5d7c8d446c362f2aca1e59afffc55724753471499acec7fb9bf52d6e6a78469a7763f820c659dfb4a033a80bc09f6452d498fce9283b80
7
- data.tar.gz: c648c5762abbb8b39842e1424a78631e614128404ffe73859232bc350d619ba4df5a5da1e22f3632bf357b94b4a8dd66ece50d1b080272903f5b124a500684ed
6
+ metadata.gz: 4f14a09c4ea459f96eb727ac1b7bd8249e1fd42f087a1afca09e3c5705837ddb5ff7b859ab81e654a1e1607f5e4875a82ae8df58c846b50cef79b0296ce9e809
7
+ data.tar.gz: c2863834450dad29c443746f3dc4c0db11115ffb03796dd4e35d99d707e12bc81c15cc7d609625dd9ae222f42e276e8d8aa046c089fb0572b66862efa23ceb61
@@ -59,7 +59,8 @@ module Effective
59
59
  mail(to: @order.emails, cc: @order.cc.presence, subject: subject, **headers)
60
60
  end
61
61
 
62
- # This is sent when someone chooses to Pay by Cheque
62
+ # This is sent when someone chooses to Pay by Cheque or Pay by E-transfer
63
+ # This is not automatically sent for a delayed purchase
63
64
  def pending_order_invoice_to_buyer(resource, opts = {})
64
65
  raise('expected an Effective::Order') unless resource.kind_of?(Effective::Order)
65
66
 
@@ -67,7 +68,9 @@ module Effective
67
68
  subject = subject_for(__method__, "Pending Order: ##{@order.to_param}", resource, opts)
68
69
  headers = headers_for(resource, opts)
69
70
 
70
- mail(to: @order.emails, cc: @order.cc.presence, subject: subject, **headers)
71
+ cc = (@order.cc.to_s.split(',') + [mailer_admin] - [nil, '', ' ']).compact.presence
72
+
73
+ mail(to: @order.emails, cc: cc, subject: subject, **headers)
71
74
  end
72
75
 
73
76
  # This is sent to admin when someone Accepts Refund
@@ -475,6 +475,10 @@ module Effective
475
475
  false
476
476
  end
477
477
 
478
+ def purchased_or_deferred?
479
+ purchased? || deferred?
480
+ end
481
+
478
482
  def purchased_with_credit_card?
479
483
  purchased? && EffectiveOrders.credit_card_payment_providers.include?(payment_provider)
480
484
  end
@@ -811,7 +815,7 @@ module Effective
811
815
 
812
816
  raise "Failed to defer order: #{error || errors.full_messages.to_sentence}" unless error.nil?
813
817
 
814
- send_payment_request_to_buyer! if email
818
+ send_pending_order_invoice_to_buyer! if email
815
819
 
816
820
  true
817
821
  end
@@ -2,12 +2,22 @@
2
2
 
3
3
  %p We have received notice of your intention to purchase the following items.
4
4
 
5
- %p Please remit payment at your earliest convenience.
5
+ - if @order.delayed?
6
+ %p{style: "margin-bottom: 4px; font-weight: bold;"} Please note:
7
+ %ul{style: "margin-top: 0;"}
8
+ %li Your credit card will be charged on <strong>#{@order.delayed_payment_date.strftime("%A, %B %d, %Y")}</strong>.
9
+ %li Changes and cancellations must be made before this date.
10
+ %li A receipt will be sent after the transaction is completed.
6
11
 
7
- %p #{link_to('Click here', effective_orders.order_url(@order))} to review your order online.
12
+ - elsif @order.deferred?
13
+ %p Please remit payment at your earliest convenience.
8
14
 
9
- - if EffectiveOrders.deferred_providers.present?
10
- - providers = EffectiveOrders.deferred_providers.to_sentence(last_word_connector: ', or', two_words_connector: ' or ')
11
- %p When we receive your #{providers} we will mark your order paid.
15
+ - if EffectiveOrders.deferred_providers.present?
16
+ - providers = EffectiveOrders.deferred_providers.to_sentence(last_word_connector: ', or', two_words_connector: ' or ')
17
+ %p When we receive your #{providers} we will mark your order paid.
12
18
 
13
19
  = render(@order, no_order_actions: true)
20
+
21
+ %hr
22
+ %p{style: "text-align: center;"}
23
+ = link_to('View your order', effective_orders.order_url(@order))
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '6.18.0'.freeze
2
+ VERSION = '6.18.2'.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: 6.18.0
4
+ version: 6.18.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-12-05 00:00:00.000000000 Z
11
+ date: 2025-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails