Add test rake job for processing dummy payment

This commit is contained in:
Alex Sherman 2021-05-31 14:10:51 +05:00
parent fb810e5ccb
commit 76a0b80f85
4 changed files with 27 additions and 10 deletions

View file

@ -21,7 +21,7 @@ class SendEInvoiceJob < ApplicationJob
end
def process(invoice:, payable:)
invoice.to_e_invoice(payable: payable).deliver
invoice.to_e_invoice(payable: payable).deliver unless Rails.env.development?
invoice.update(e_invoice_sent_at: Time.zone.now)
log_success(invoice)
end

View file

@ -15,7 +15,7 @@ module Invoice::Cancellable
end
def cancelled?
cancelled_at
cancelled_at.present?
end
def not_cancelled?

View file

@ -105,7 +105,7 @@ class Registrar < ApplicationRecord
.deliver_later(wait: 1.minute)
end
SendEInvoiceJob.perform_later(invoice.id, payable)
SendEInvoiceJob.perform_now(invoice.id, payable)
invoice
end