summaryrefslogtreecommitdiff
path: root/app/services/solidus_subscriptions/failure_dispatcher.rb
diff options
context:
space:
mode:
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