effective_orders 4.6.3 → 5.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +14 -86
  4. data/app/controllers/admin/customers_controller.rb +5 -16
  5. data/app/controllers/admin/order_items_controller.rb +6 -9
  6. data/app/controllers/admin/orders_controller.rb +18 -82
  7. data/app/controllers/effective/carts_controller.rb +10 -6
  8. data/app/controllers/effective/concerns/purchase.rb +12 -19
  9. data/app/controllers/effective/customers_controller.rb +4 -2
  10. data/app/controllers/effective/orders_controller.rb +26 -23
  11. data/app/controllers/effective/providers/cheque.rb +3 -1
  12. data/app/controllers/effective/providers/free.rb +3 -2
  13. data/app/controllers/effective/providers/mark_as_paid.rb +5 -4
  14. data/app/controllers/effective/providers/moneris.rb +3 -1
  15. data/app/controllers/effective/providers/paypal.rb +3 -2
  16. data/app/controllers/effective/providers/phone.rb +3 -1
  17. data/app/controllers/effective/providers/pretend.rb +4 -3
  18. data/app/controllers/effective/providers/refund.rb +4 -3
  19. data/app/controllers/effective/providers/stripe.rb +4 -3
  20. data/app/controllers/effective/subscripter_controller.rb +4 -2
  21. data/app/controllers/effective/webhooks_controller.rb +12 -3
  22. data/app/datatables/admin/effective_customers_datatable.rb +7 -3
  23. data/app/datatables/admin/effective_orders_datatable.rb +4 -7
  24. data/app/datatables/effective_orders_datatable.rb +3 -7
  25. data/app/helpers/effective_orders_helper.rb +1 -7
  26. data/app/mailers/effective/orders_mailer.rb +131 -96
  27. data/app/models/concerns/acts_as_purchasable.rb +0 -11
  28. data/app/models/concerns/acts_as_subscribable.rb +0 -6
  29. data/app/models/effective/cart.rb +7 -5
  30. data/app/models/effective/cart_item.rb +7 -4
  31. data/app/models/effective/customer.rb +7 -6
  32. data/app/models/effective/order.rb +58 -61
  33. data/app/models/effective/order_item.rb +20 -8
  34. data/app/models/effective/product.rb +11 -6
  35. data/app/models/effective/subscription.rb +13 -12
  36. data/app/views/admin/orders/_form.html.haml +5 -9
  37. data/app/views/admin/orders/_order_item_fields.html.haml +8 -12
  38. data/app/views/effective/orders/_checkout_step2.html.haml +1 -2
  39. data/app/views/effective/orders/_order_actions.html.haml +2 -2
  40. data/app/views/effective/orders/show.html.haml +4 -0
  41. data/config/effective_orders.rb +8 -32
  42. data/config/routes.rb +16 -17
  43. data/db/migrate/01_create_effective_orders.rb.erb +4 -0
  44. data/lib/effective_orders.rb +34 -76
  45. data/lib/effective_orders/engine.rb +0 -7
  46. data/lib/effective_orders/version.rb +1 -1
  47. data/lib/generators/templates/effective_orders_mailer_preview.rb +13 -13
  48. data/lib/tasks/effective_orders_tasks.rake +2 -2
  49. metadata +2 -3
  50. data/app/models/effective/access_denied.rb +0 -17
@@ -16,13 +16,6 @@ module EffectiveOrders
16
16
  eval File.read("#{config.root}/config/effective_orders.rb")
17
17
  end
18
18
 
19
- # Set up mail delivering config option
20
- initializer 'effective_orders.mailer', after: :load_config_initializers do |app|
21
- EffectiveOrders.mailer[:deliver_method] ||= (
22
- (Rails.application.config.respond_to?(:active_job) && Rails.application.config.active_job.queue_adapter) ? :deliver_later : :deliver_now
23
- )
24
- end
25
-
26
19
  initializer "effective_orders.append_precompiled_assets" do |app|
27
20
  Rails.application.config.assets.precompile += ['effective_orders/*']
28
21
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '4.6.3'.freeze
2
+ VERSION = '5.0.4'.freeze
3
3
  end
@@ -4,55 +4,55 @@
4
4
 
5
5
  class EffectiveOrdersMailerPreview < ActionMailer::Preview
6
6
  def order_receipt_to_admin
7
- Effective::OrdersMailer.order_receipt_to_admin(build_preview_order)
7
+ EffectiveOrders.mailer_klass.order_receipt_to_admin(build_preview_order)
8
8
  end
9
9
 
10
10
  def order_receipt_to_buyer
11
- Effective::OrdersMailer.order_receipt_to_buyer(build_preview_order)
11
+ EffectiveOrders.mailer_klass.order_receipt_to_buyer(build_preview_order)
12
12
  end
13
13
 
14
14
  def payment_request_to_buyer
15
- Effective::OrdersMailer.payment_request_to_buyer(build_preview_order)
15
+ EffectiveOrders.mailer_klass.payment_request_to_buyer(build_preview_order)
16
16
  end
17
17
 
18
18
  def pending_order_invoice_to_buyer
19
- Effective::OrdersMailer.pending_order_invoice_to_buyer(build_preview_order)
19
+ EffectiveOrders.mailer_klass.pending_order_invoice_to_buyer(build_preview_order)
20
20
  end
21
21
 
22
22
  def subscription_payment_succeeded
23
- Effective::OrdersMailer.subscription_payment_succeeded(preview_customer)
23
+ EffectiveOrders.mailer_klass.subscription_payment_succeeded(preview_customer)
24
24
  end
25
25
 
26
26
  def subscription_payment_failed
27
- Effective::OrdersMailer.subscription_payment_failed(preview_customer)
27
+ EffectiveOrders.mailer_klass.subscription_payment_failed(preview_customer)
28
28
  end
29
29
 
30
30
  def subscription_created
31
- Effective::OrdersMailer.subscription_created(preview_customer)
31
+ EffectiveOrders.mailer_klass.subscription_created(preview_customer)
32
32
  end
33
33
 
34
34
  def subscription_updated
35
- Effective::OrdersMailer.subscription_updated(preview_customer)
35
+ EffectiveOrders.mailer_klass.subscription_updated(preview_customer)
36
36
  end
37
37
 
38
38
  def subscription_canceled
39
- Effective::OrdersMailer.subscription_canceled(preview_customer)
39
+ EffectiveOrders.mailer_klass.subscription_canceled(preview_customer)
40
40
  end
41
41
 
42
42
  def subscription_trialing
43
- Effective::OrdersMailer.subscription_trialing(preview_subscribable)
43
+ EffectiveOrders.mailer_klass.subscription_trialing(preview_subscribable)
44
44
  end
45
45
 
46
46
  def subscription_trial_expired
47
- Effective::OrdersMailer.subscription_trial_expired(preview_subscribable)
47
+ EffectiveOrders.mailer_klass.subscription_trial_expired(preview_subscribable)
48
48
  end
49
49
 
50
50
  def subscription_event_to_admin
51
- Effective::OrdersMailer.subscription_event_to_admin(:subscription_updated, preview_customer)
51
+ EffectiveOrders.mailer_klass.subscription_event_to_admin(:subscription_updated, preview_customer)
52
52
  end
53
53
 
54
54
  def order_error
55
- Effective::OrdersMailer.order_error(order: build_preview_order, error: 'Something did not work out')
55
+ EffectiveOrders.mailer_klass.order_error(order: build_preview_order, error: 'Something did not work out')
56
56
  end
57
57
 
58
58
  protected
@@ -44,7 +44,7 @@ namespace :effective_orders do
44
44
  klass.trialing.find_each do |subscribable|
45
45
  if subscribable.trialing_until == today
46
46
  puts "sending trial expired to #{subscribable}"
47
- Effective::OrdersMailer.subscription_trial_expired(subscribable).deliver_now
47
+ EffectiveOrders.mailer_klass.subscription_trial_expired(subscribable).deliver_now
48
48
  end
49
49
 
50
50
  next if subscribable.trial_past_due? # We already notified them
@@ -53,7 +53,7 @@ namespace :effective_orders do
53
53
 
54
54
  reminders.each do |remind_at|
55
55
  next unless today == (date + remind_at)
56
- Effective::OrdersMailer.subscription_trialing(subscribable).deliver_now
56
+ EffectiveOrders.mailer_klass.subscription_trialing(subscribable).deliver_now
57
57
  end
58
58
  end
59
59
  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.6.3
4
+ version: 5.0.4
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: 2021-03-01 00:00:00.000000000 Z
11
+ date: 2021-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -156,7 +156,6 @@ files:
156
156
  - app/models/concerns/acts_as_purchasable.rb
157
157
  - app/models/concerns/acts_as_subscribable.rb
158
158
  - app/models/concerns/acts_as_subscribable_buyer.rb
159
- - app/models/effective/access_denied.rb
160
159
  - app/models/effective/cart.rb
161
160
  - app/models/effective/cart_item.rb
162
161
  - app/models/effective/customer.rb
@@ -1,17 +0,0 @@
1
- unless defined?(Effective::AccessDenied)
2
- module Effective
3
- class AccessDenied < StandardError
4
- attr_reader :action, :subject
5
-
6
- def initialize(message = nil, action = nil, subject = nil)
7
- @message = message
8
- @action = action
9
- @subject = subject
10
- end
11
-
12
- def to_s
13
- @message || I18n.t(:'unauthorized.default', :default => 'Access Denied')
14
- end
15
- end
16
- end
17
- end