Class: SolidusSubscriptions::Dispatcher::PaymentFailedDispatcher

Inherits:
Base
  • Object
show all
Defined in:
lib/solidus_subscriptions/dispatcher/payment_failed_dispatcher.rb

Instance Attribute Summary

Attributes inherited from Base

#installment, #order

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from SolidusSubscriptions::Dispatcher::Base

Instance Method Details

#dispatchObject



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/solidus_subscriptions/dispatcher/payment_failed_dispatcher.rb', line 6

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