summaryrefslogtreecommitdiff
path: root/app/services/solidus_subscriptions/failure_dispatcher.rb
diff options
context:
space:
mode:
authorAlessandro Desantis <desa.alessandro@gmail.com>2020-09-30 15:26:16 +0200
committerAlessandro Desantis <desa.alessandro@gmail.com>2020-10-01 14:41:47 +0200
commit57f0d68c7ef5e7918c48cbee74173333129ecbfa (patch)
tree5dda2ffcbe5ed54afb7c4c0dca7a240cb7250b64 /app/services/solidus_subscriptions/failure_dispatcher.rb
parent0c15edd8310e2aae137b4b773613e61a51470436 (diff)
Remove logging from dispatchers
The way it is currently implemented, the default logging behavior from this extension could easily pollute the logs of large applications. Logging should be implemented by individual users if they need it.
Diffstat (limited to 'app/services/solidus_subscriptions/failure_dispatcher.rb')
-rw-r--r--app/services/solidus_subscriptions/failure_dispatcher.rb17
1 files changed, 5 insertions, 12 deletions
diff --git a/app/services/solidus_subscriptions/failure_dispatcher.rb b/app/services/solidus_subscriptions/failure_dispatcher.rb
index 4fdb828..c77d4b0 100644
--- a/app/services/solidus_subscriptions/failure_dispatcher.rb
+++ b/app/services/solidus_subscriptions/failure_dispatcher.rb
@@ -1,21 +1,14 @@
# frozen_string_literal: true
-# A handler for behaviour that should happen after installments are marked as
-# failures
+# Handles failed installments.
module SolidusSubscriptions
class FailureDispatcher < Dispatcher
def dispatch
- order.touch :completed_at
+ order.touch(:completed_at)
order.cancel
- installments.each { |i| i.failed!(order) }
- super
- end
-
- def message
- "
- Something went wrong processing installments: #{installments.map(&:id).join(', ')}.
- They have been marked for reprocessing.
- "
+ installments.each do |installment|
+ installment.failed!(order)
+ end
end
end
end