summaryrefslogtreecommitdiff
path: root/app/services/solidus_subscriptions/failure_dispatcher.rb
blob: c77d4b0261b373d3ed66ff426fd20b33fd4ed417 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# frozen_string_literal: true

# Handles failed installments.
module SolidusSubscriptions
  class FailureDispatcher < Dispatcher
    def dispatch
      order.touch(:completed_at)
      order.cancel
      installments.each do |installment|
        installment.failed!(order)
      end
    end
  end
end