Sha256: a34c8d73ba223021c9f0ae9a17dfe01ecd4fde311543a37f547acf5111ae4b62

Contents?: true

Size: 458 Bytes

Versions: 5

Compression:

Stored size: 458 Bytes

Contents

# frozen_string_literal: true

module SolidusSubscriptions
  module Dispatcher
    class PaymentFailedDispatcher < Base
      def dispatch
        order.touch(:completed_at)
        order.cancel
        installment.payment_failed!(order)

        ::SolidusSupport::LegacyEventCompat::Bus.publish(
          :'solidus_subscriptions.installment_failed_payment',
          installment: installment,
          order: order,
        )
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
solidus_subscriptions-2.0.2 lib/solidus_subscriptions/dispatcher/payment_failed_dispatcher.rb
solidus_subscriptions-2.0.1 lib/solidus_subscriptions/dispatcher/payment_failed_dispatcher.rb
solidus_subscriptions-2.0.0 lib/solidus_subscriptions/dispatcher/payment_failed_dispatcher.rb
solidus_subscriptions-1.1.0 lib/solidus_subscriptions/dispatcher/payment_failed_dispatcher.rb
solidus_subscriptions-1.0.1 lib/solidus_subscriptions/dispatcher/payment_failed_dispatcher.rb