Class: Spree::BankPayments::SendRemindersJob
- Inherits:
-
ActiveJob::Base
- Object
- ActiveJob::Base
- Spree::BankPayments::SendRemindersJob
- Defined in:
- app/jobs/spree/bank_payments/send_reminders_job.rb
Constant Summary collapse
- REMIND_WITHIN =
2.days
Instance Method Summary collapse
Instance Method Details
#perform ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/jobs/spree/bank_payments/send_reminders_job.rb', line 8 def perform ::Spree::PaymentSessions::BankTransfer. open. where(expires_at: Time.current..REMIND_WITHIN.from_now). find_each do |session| next if reminded_today?(session) Spree::Events.publish('bank_transfer.reminder_due', session.notification_payload) mark_reminded(session) end end |