Sha256: b3624601091467a4bb67296a77c4b6cdefa6ea373be02322db42a8b6755d99b7

Contents?: true

Size: 428 Bytes

Versions: 62

Compression:

Stored size: 428 Bytes

Contents

module Workarea
  class SendRefundEmail
    include Sidekiq::Worker
    include Sidekiq::CallbacksWorker

    sidekiq_options(
      enqueue_on: { Payment::Refund => :complete },
      ignore_if: -> { !Workarea.config.send_transactional_emails }
    )

    def perform(id)
      refund = Payment::Refund.find(id)
      return if refund.total.zero?
      Storefront::PaymentMailer.refunded(id.to_s).deliver_now
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.27 app/workers/workarea/send_refund_email.rb
workarea-core-3.5.26 app/workers/workarea/send_refund_email.rb
workarea-core-3.4.45 app/workers/workarea/send_refund_email.rb
workarea-core-3.5.25 app/workers/workarea/send_refund_email.rb
workarea-core-3.5.23 app/workers/workarea/send_refund_email.rb
workarea-core-3.4.44 app/workers/workarea/send_refund_email.rb
workarea-core-3.5.22 app/workers/workarea/send_refund_email.rb
workarea-core-3.4.43 app/workers/workarea/send_refund_email.rb
workarea-core-3.5.21 app/workers/workarea/send_refund_email.rb
workarea-core-3.4.42 app/workers/workarea/send_refund_email.rb
workarea-core-3.5.20 app/workers/workarea/send_refund_email.rb
workarea-core-3.4.41 app/workers/workarea/send_refund_email.rb
workarea-core-3.5.19 app/workers/workarea/send_refund_email.rb
workarea-core-3.4.40 app/workers/workarea/send_refund_email.rb
workarea-core-3.5.18 app/workers/workarea/send_refund_email.rb
workarea-core-3.4.39 app/workers/workarea/send_refund_email.rb
workarea-core-3.5.17 app/workers/workarea/send_refund_email.rb
workarea-core-3.4.38 app/workers/workarea/send_refund_email.rb
workarea-core-3.5.16 app/workers/workarea/send_refund_email.rb
workarea-core-3.4.37 app/workers/workarea/send_refund_email.rb