Add StripeAccountCreateJob

This commit is contained in:
Eric Schultz 2019-11-07 16:56:15 -06:00
parent 34a75711f9
commit 9c9e6bd861
2 changed files with 8 additions and 1 deletions

View file

@ -0,0 +1,7 @@
class StripeAccountCreateJob < ApplicationJob
queue_as :default
def perform(nonprofit)
NonprofitMailer.setup_verification(nonprofit.id).deliver_now
end
end

View file

@ -46,7 +46,7 @@ module StripeAccount
acct = Stripe::Account.create(params)
Qx.update(:nonprofits).set(stripe_account_id: acct.id).where(id: np['id']).execute
NonprofitMailer.delay.setup_verification(np['id'])
StripeAccountCreateJob.perform_later(Nonprofit.find(np['id']))
acct.id
end
end