14 lines
356 B
Ruby
14 lines
356 B
Ruby
class CreateLndhubAccountJob < ApplicationJob
|
|
queue_as :default
|
|
|
|
def perform(user)
|
|
return if user.lndhub_username.present? && user.lndhub_password.present?
|
|
|
|
lndhub = LndhubV2.new
|
|
credentials = lndhub.create_account
|
|
|
|
user.update! lndhub_username: credentials["login"],
|
|
lndhub_password: credentials["password"]
|
|
end
|
|
end
|