effective_orders 4.0.0beta8 → 4.0.0beta9
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f9582922bd3c509dd18a48a2c9a0d3e7bd53103
|
4
|
+
data.tar.gz: 52ca7bfe3842f3862d79a847ba62112a888401ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e0c0dc8e9eb1ad425c77bd72f018bed2a985b468228e09c40a4dca22e2035ca22c0ed572954e08b975e489924795f02f3a67cfb9bd0384fc802978493965842
|
7
|
+
data.tar.gz: 99d87d0dbffa152d7614621617f642dfe36a877d3bdd95ca75581f56bef932c9f413f19019f242ef50a181e919f0a7772c8aa3cea18dbe72af7921f3927c9d73
|
@@ -5,7 +5,11 @@ module Effective
|
|
5
5
|
|
6
6
|
def stripe
|
7
7
|
@event = (Stripe::Webhook.construct_event(request.body.read, request.env['HTTP_STRIPE_SIGNATURE'], EffectiveOrders.subscription[:webhook_secret]) rescue nil)
|
8
|
-
(head(:bad_request) and return)
|
8
|
+
(head(:bad_request) and return) unless @event
|
9
|
+
|
10
|
+
unless EffectiveOrders.subscription[:ignore_livemode]
|
11
|
+
(head(:bad_request) and return) if (params[:livemode] == false && Rails.env.production?)
|
12
|
+
end
|
9
13
|
|
10
14
|
Rails.logger.info "STRIPE WEBHOOK: #{@event.type}"
|
11
15
|
|
@@ -51,15 +55,7 @@ module Effective
|
|
51
55
|
private
|
52
56
|
|
53
57
|
def send_email(email, *mailer_args)
|
54
|
-
|
55
|
-
Effective::OrdersMailer.delay.public_send(email, *mailer_args)
|
56
|
-
elsif EffectiveOrders.mailer[:deliver_method].present?
|
57
|
-
Effective::OrdersMailer.public_send(email, *mailer_args).public_send(EffectiveOrders.mailer[:deliver_method])
|
58
|
-
else
|
59
|
-
Effective::OrdersMailer.public_send(email, *mailer_args).deliver_now
|
60
|
-
end
|
61
|
-
|
62
|
-
true
|
58
|
+
Effective::OrdersMailer.public_send(email, *mailer_args).public_send(EffectiveOrders.mailer[:deliver_method])
|
63
59
|
end
|
64
60
|
|
65
61
|
end
|
data/config/effective_orders.rb
CHANGED
@@ -245,7 +245,8 @@ EffectiveOrders.setup do |config|
|
|
245
245
|
config.subscriptions = false
|
246
246
|
|
247
247
|
# config.subscriptions = {
|
248
|
-
# webhook_secret: 'whsec_xxx'
|
248
|
+
# webhook_secret: 'whsec_xxx',
|
249
|
+
# ignore_livemode: false # Use this to run test mode in production. careful.
|
249
250
|
# }
|
250
251
|
|
251
252
|
# Trial
|
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.0.
|
4
|
+
version: 4.0.0beta9
|
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: 2018-05-
|
11
|
+
date: 2018-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|