15 lines
427 B
Ruby
15 lines
427 B
Ruby
class CreateLndhubAccountJob < ApplicationJob
|
|
queue_as :default
|
|
|
|
def perform(user)
|
|
return if user.ln_login.present? && user.ln_password.present?
|
|
|
|
lndhub = LndhubV2.new
|
|
credentials = lndhub.create_account
|
|
|
|
user.update! ln_account: credentials["login"],
|
|
ln_login: credentials["login"], # TODO remove when production is migrated
|
|
ln_password: credentials["password"]
|
|
end
|
|
end
|