effective_orders 4.5.10 → 4.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/effective/providers/mark_as_paid.rb +2 -1
- data/app/helpers/effective_subscriptions_helper.rb +1 -1
- data/app/models/effective/order.rb +4 -0
- data/app/models/effective/subscripter.rb +1 -1
- data/app/views/effective/orders/mark_as_paid/_form.html.haml +2 -1
- data/lib/effective_orders/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07ed479ba56ebd55dae9b20168feec83435c0264cf7b00738a4438aa5104024e
|
4
|
+
data.tar.gz: 5756b29a14db32c53571fe75991285ed9864864e9a245b2b051886a68ed19229
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8de08c2426a57c57176a585131e211242fad9cb9f3bb18bac6216375798388e951021f6a58354be3c0810c3fa59b9d4b8f4505aae9f24b6377b34c0db8793a3d
|
7
|
+
data.tar.gz: 9a9bba6683d48272c12f4e509617afa99f1721bc53bd448e3689b07782d9b6e8a31cf28b29a031bf0be00ce621f0405eef56d2ca06c1323ec4f306d8a3852c53
|
@@ -24,7 +24,8 @@ module Effective
|
|
24
24
|
|
25
25
|
def mark_as_paid_params
|
26
26
|
params.require(:effective_order).permit(
|
27
|
-
:payment, :payment_provider, :payment_card,
|
27
|
+
:purchased_at, :payment, :payment_provider, :payment_card,
|
28
|
+
:note_to_buyer, :send_mark_as_paid_email_to_buyer
|
28
29
|
)
|
29
30
|
end
|
30
31
|
|
@@ -17,7 +17,7 @@ module EffectiveSubscriptionsHelper
|
|
17
17
|
raise 'form object must be an acts_as_subscribable object' unless subscribable.respond_to?(:subscripter)
|
18
18
|
|
19
19
|
subscripter = subscribable.subscripter
|
20
|
-
raise 'subscribable.subscribable_buyer must match current_user' unless subscripter.user == current_user
|
20
|
+
# raise 'subscribable.subscribable_buyer must match current_user' unless subscripter.user == current_user
|
21
21
|
|
22
22
|
render('effective/subscripter/form', subscripter: subscripter)
|
23
23
|
end
|
@@ -72,6 +72,10 @@ module Effective
|
|
72
72
|
self.state = EffectiveOrders::CONFIRMED if pending?
|
73
73
|
end
|
74
74
|
|
75
|
+
before_save(if: -> { state_was == EffectiveOrders::PURCHASED }) do
|
76
|
+
raise Exception.new('cannot change state of purchased order') unless purchased?
|
77
|
+
end
|
78
|
+
|
75
79
|
# Order validations
|
76
80
|
validates :user_id, presence: true
|
77
81
|
validates :email, presence: true, email: true # email and cc validators are from effective_resources
|
@@ -31,7 +31,7 @@ module Effective
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def customer
|
34
|
-
@customer ||= Effective::Customer.deep.where(user: user).first_or_initialize
|
34
|
+
@customer ||= Effective::Customer.deep.where(user: subscribable&.subscribable_buyer || user).first_or_initialize
|
35
35
|
end
|
36
36
|
|
37
37
|
def current_user=(user)
|
@@ -3,6 +3,8 @@
|
|
3
3
|
%h2 Admin: Mark as Paid
|
4
4
|
|
5
5
|
= effective_form_with(model: order, url: effective_orders.mark_as_paid_order_path(order), method: :post) do |f|
|
6
|
+
= f.date_field :purchased_at, required: true
|
7
|
+
|
6
8
|
= f.select :payment_provider, EffectiveOrders.payment_providers, required: true
|
7
9
|
|
8
10
|
= f.text_field :payment_card,
|
@@ -20,4 +22,3 @@
|
|
20
22
|
= f.text_area :note_to_buyer, hint: 'This message will be displayed on the receipt.'
|
21
23
|
|
22
24
|
= f.submit order_checkout_label(:mark_as_paid), center: true
|
23
|
-
|
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: 4.
|
4
|
+
version: 4.6.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:
|
11
|
+
date: 2021-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|