Correct the Wisper listeners

This commit is contained in:
Eric 2020-06-22 14:47:10 -05:00 committed by Eric Schultz
parent 75543f8b8f
commit c25ecd4caf
5 changed files with 11 additions and 11 deletions

View file

@ -3,7 +3,7 @@
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
class CampaignListener < ApplicationListener
def campaign_create(campaign)
def self.campaign_create(campaign)
if campaign.child_campaign?
CampaignCreationFederatedEmailJob.perform_later(campaign)
else

View file

@ -3,32 +3,32 @@
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
class CreditCardPaymentListener < ApplicationListener
def donation_create(donation, locale, user=nil)
def self.donation_create(donation, locale, user=nil)
if donation.payment_provider == :credit_card
PaymentNotificationEmailDonorJob.perform_later donation, locale
PaymentNotificationEmailNonprofitJob.perform_later donation, user
end
end
def recurring_donation_create(donation, locale, user=nil)
def self.recurring_donation_create(donation, locale, user=nil)
if donation.payment_provider == :credit_card
PaymentNotificationEmailDonorJob.perform_later donation, locale
PaymentNotificationEmailNonprofitJob.perform_later donation, user
end
end
def refund_create(refund)
def self.refund_create(refund)
RefundNotificationJob.perform_later refund
end
def recurring_donation_payment_succeeded(donation, locale, user=nil)
def self.recurring_donation_payment_succeeded(donation, locale, user=nil)
if donation.payment_provider == :credit_card
PaymentNotificationEmailDonorJob.perform_later donation, locale
PaymentNotificationEmailNonprofitJob.perform_later donation, user
end
end
def recurring_donation_payment_failed(donation, locale)
def self.recurring_donation_payment_failed(donation, locale)
FailedRecurringDonationPaymentDonorEmailJob.perform_later(donation)
if (donation.recurring_donation.n_failures >= 3)
FailedRecurringDonationPaymentNonprofitEmailJob.perform_later(donation)

View file

@ -3,7 +3,7 @@
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
class SepaPaymentListener < ApplicationListener
def donation_create(donation)
def self.donation_create(donation)
if donation.payment_provider == :sepa
DirectDebitCreateNotifyNonprofitJob.perform_later(donation.id)
DirectDebitCreateNotifyDonorJob.perform_later donation.id, locale

View file

@ -3,7 +3,7 @@
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
class TicketListener < ApplicationListener
def ticket_create(tickets, charge, user=nil)
def self.ticket_create(tickets, charge, user=nil)
TicketMailer.followup(tickets.map{|i| i.id}, charge && charge.id).deliver_later
TicketMailer.receipt_admin(tickets.map{|i| i.id}, user && user.id).deliver_later
end

View file

@ -3,15 +3,15 @@
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
class WemoveListener < ApplicationListener
def donation_create(donation)
def self.donation_create(donation)
WeMoveExecuteForDonationsJob.perform_later(donation)
end
def offsite_donation_create(donation)
def self.offsite_donation_create(donation)
WeMoveExecuteForDonationsJob.perform_later(donation)
end
def recurring_donation_create(donation)
def self.recurring_donation_create(donation)
WeMoveExecuteForDonationsJob.perform_later(donation)
end
end