Add StripeAccountCreateJob
This commit is contained in:
parent
34a75711f9
commit
9c9e6bd861
2 changed files with 8 additions and 1 deletions
7
app/jobs/stripe_account_create_job.rb
Normal file
7
app/jobs/stripe_account_create_job.rb
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
class StripeAccountCreateJob < ApplicationJob
|
||||||
|
queue_as :default
|
||||||
|
|
||||||
|
def perform(nonprofit)
|
||||||
|
NonprofitMailer.setup_verification(nonprofit.id).deliver_now
|
||||||
|
end
|
||||||
|
end
|
|
@ -46,7 +46,7 @@ module StripeAccount
|
||||||
|
|
||||||
acct = Stripe::Account.create(params)
|
acct = Stripe::Account.create(params)
|
||||||
Qx.update(:nonprofits).set(stripe_account_id: acct.id).where(id: np['id']).execute
|
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
|
acct.id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue