Add LndHub service, lnurl-pay endpoints
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing

Enables the lnurl-pay payment workflow
This commit is contained in:
2021-11-22 15:41:05 -06:00
parent 884070a3cb
commit dbc811b840
10 changed files with 158 additions and 23 deletions

View File

@@ -2,14 +2,10 @@ 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)
lndhub = Lndhub.new
credentials = lndhub.create({ partnerid: user.ou, accounttype: "user" })
user.update! ln_login: credentials["login"],
ln_password: credentials["password"]
end
end