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: c66a5be43c958c2c0488de0973b4d5c30dff9bd4
4
- data.tar.gz: 120bed89ab81bd1e8dc044fc39e8e6d331811032
3
+ metadata.gz: 0f9582922bd3c509dd18a48a2c9a0d3e7bd53103
4
+ data.tar.gz: 52ca7bfe3842f3862d79a847ba62112a888401ef
5
5
  SHA512:
6
- metadata.gz: e17e53c655a3f620b31442b305ab5fa7c869ab11db9be8b5b135c064fabb1064ce39ad13f91468dabc9dba2bc442c39de92d6dd5a984c23d7e36e4b36daa8fbb
7
- data.tar.gz: 59401e22fe8407db0efe2857131d73fcbd1f7a298413c031e6a30e66e6430c1af0e5a372ca50c4d6bcb1dd3c341b0bb983f9bac3ec5506f445e59edc78eaa6e1
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) if !@event || (params[:livemode] == false && Rails.env.production?)
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
- if EffectiveOrders.mailer[:delayed_job_deliver] && EffectiveOrders.mailer[:deliver_method] == :deliver_later
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '4.0.0beta8'.freeze
2
+ VERSION = '4.0.0beta9'.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: 4.0.0beta8
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-21 00:00:00.000000000 Z
11
+ date: 2018-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails