Sha256: 2a67810b7c981df8388181b7003e89967f47b126090d26366f9902858b09dc4a

Contents?: true

Size: 481 Bytes

Versions: 4

Compression:

Stored size: 481 Bytes

Contents

# A handler for behaviour that should happen after installments are marked as
# failures
module SolidusSubscriptions
  class FailureDispatcher < Dispatcher
    def dispatch
      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.
      "
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
solidus_subscriptions-alpha-0.0.5 app/models/solidus_subscriptions/failure_dispatcher.rb
solidus_subscriptions-alpha-0.0.3 app/models/solidus_subscriptions/failure_dispatcher.rb
solidus_subscriptions-alpha-0.0.2 app/models/solidus_subscriptions/failure_dispatcher.rb
solidus_subscriptions-alpha-0.0.1 app/models/solidus_subscriptions/failure_dispatcher.rb