Sha256: e8672927ed5eee34273bd9238de0bb252b3d3e9958ea29685042f6f29be4a95c

Contents?: true

Size: 500 Bytes

Versions: 1

Compression:

Stored size: 500 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

1 entries across 1 versions & 1 rubygems

Version Path
solidus_subscriptions-alpha-0.0.4 app/models/solidus_subscriptions/failure_dispatcher.rb