effective_orders 1.7.1 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/effective_orders.rb +0 -9
- data/lib/effective_orders/engine.rb +45 -0
- data/lib/effective_orders/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e064516c43305bbfbea3b41ed7f63f945d91058
|
4
|
+
data.tar.gz: cb7532dc86e4355d592948c4c21e1697da810013
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad65ad5fc8e10212d2e077a78747c279eedc207ab4e6ddf37c6c7fa0479ca7e4f7ef854576f9fc60c2e1f9b1d09ea339221584c9850755de80ae3b96d6ee12c1
|
7
|
+
data.tar.gz: ceacb05d17e371cc4c7254ee2e0bd0af8b4a58e38bf11cfc51640f84f8a0b1ca189d4e61848eb60c6091d3e751c5f3d1da8c08e5e3b7ec500b8d8d38301a0e2b
|
data/lib/effective_orders.rb
CHANGED
@@ -65,15 +65,6 @@ module EffectiveOrders
|
|
65
65
|
|
66
66
|
def self.setup
|
67
67
|
yield self
|
68
|
-
|
69
|
-
unless mailer[:deliver_method].present?
|
70
|
-
self.mailer[:deliver_method] = case
|
71
|
-
when Rails.gem_version >= Gem::Version.new('4.2')
|
72
|
-
:deliver_now
|
73
|
-
else
|
74
|
-
:deliver
|
75
|
-
end
|
76
|
-
end
|
77
68
|
end
|
78
69
|
|
79
70
|
def self.authorized?(controller, action, resource)
|
@@ -30,6 +30,13 @@ module EffectiveOrders
|
|
30
30
|
# Set up our default configuration options.
|
31
31
|
initializer "effective_orders.defaults", :before => :load_config_initializers do |app|
|
32
32
|
eval File.read("#{config.root}/lib/generators/templates/effective_orders.rb")
|
33
|
+
|
34
|
+
EffectiveOrders.mailer[:deliver_method] = case
|
35
|
+
when Rails.gem_version >= Gem::Version.new('4.2')
|
36
|
+
:deliver_now
|
37
|
+
else
|
38
|
+
:deliver
|
39
|
+
end
|
33
40
|
end
|
34
41
|
|
35
42
|
# Set up our Stripe API Key
|
@@ -45,6 +52,44 @@ module EffectiveOrders
|
|
45
52
|
end
|
46
53
|
end
|
47
54
|
|
55
|
+
initializer 'effective_orders.moneris_config_validation', :after => :load_config_initializers do
|
56
|
+
if EffectiveOrders.moneris_enabled
|
57
|
+
unless EffectiveOrders.moneris.is_a?(Hash)
|
58
|
+
raise ArgumentError, "expected EffectiveOrders.moneris to be a Hash but it is a #{EffectiveOrders.moneris.class}"
|
59
|
+
end
|
60
|
+
missing = EffectiveOrders.moneris.select {|_config, value| value.blank? }
|
61
|
+
|
62
|
+
raise "Missing effective_orders Moneris configuration values: #{missing.keys.join(', ')}" if missing.present?
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
initializer 'effective_orders.paypal_config_validation', :after => :load_config_initializers do
|
67
|
+
if EffectiveOrders.paypal_enabled
|
68
|
+
unless EffectiveOrders.paypal.is_a?(Hash)
|
69
|
+
raise ArgumentError, "expected EffectiveOrders.paypal to be a Hash but it is a #{EffectiveOrders.paypal.class}"
|
70
|
+
end
|
71
|
+
missing = EffectiveOrders.paypal.select {|_config, value| value.blank? }
|
72
|
+
|
73
|
+
raise "Missing effective_orders PayPal configuration values: #{missing.keys.join(', ')}" if missing.present?
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
initializer 'effective_orders.stripe_config_validation', :after => :load_config_initializers do
|
78
|
+
if EffectiveOrders.stripe_enabled
|
79
|
+
unless EffectiveOrders.stripe.is_a?(Hash)
|
80
|
+
raise ArgumentError, "expected EffectiveOrders.stripe to be a Hash but it is a #{EffectiveOrders.stripe.class}"
|
81
|
+
end
|
82
|
+
missing = EffectiveOrders.stripe.select {|_config, value| value.blank? }
|
83
|
+
required = [:secret_key, :publishable_key, :currency, :site_title]
|
84
|
+
stripe_connect_required = [:connect_client_id]
|
85
|
+
required += stripe_connect_required if EffectiveOrders.stripe_connect_enabled
|
86
|
+
|
87
|
+
# perform an intersection operation between missing and required configs
|
88
|
+
missing_required = missing.keys & required
|
89
|
+
raise "Missing effective_orders Stripe configuration values: #{missing_required.join(', ')}" if missing_required.present?
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
48
93
|
# Use ActiveAdmin (optional)
|
49
94
|
initializer 'effective_orders.active_admin' do
|
50
95
|
if EffectiveOrders.use_active_admin?
|
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: 1.7.
|
4
|
+
version: 1.7.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: 2015-12-
|
11
|
+
date: 2015-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|