16 lines
443 B
Ruby
16 lines
443 B
Ruby
class CreateLndhubWalletJob < ApplicationJob
|
|
queue_as :default
|
|
|
|
def perform(user)
|
|
res = Faraday.post("#{ENV["LNDHUB_API_URL"]}/create",
|
|
{ partnerid: "bluewallet", accounttype: "common" }.to_json,
|
|
"Content-Type" => "application/json")
|
|
|
|
credentials = JSON.parse(res.body)
|
|
|
|
user.update! ln_login: credentials["login"],
|
|
ln_password: credentials["password"]
|
|
end
|
|
|
|
end
|