Use v2 API for creating new lndhub accounts
This commit is contained in:
@@ -11,7 +11,7 @@ class CreateAccount < ApplicationService
|
||||
def call
|
||||
user = create_user_in_database
|
||||
add_ldap_document
|
||||
create_lndhub_wallet(user)
|
||||
create_lndhub_account(user)
|
||||
|
||||
if @invitation.present?
|
||||
update_invitation(user.id)
|
||||
@@ -49,9 +49,9 @@ class CreateAccount < ApplicationService
|
||||
ExchangeXmppContactsJob.perform_later(@invitation.user, @username, @domain)
|
||||
end
|
||||
|
||||
def create_lndhub_wallet(user)
|
||||
def create_lndhub_account(user)
|
||||
#TODO enable in development when we have a local lndhub (mock?) API
|
||||
return if Rails.env.development?
|
||||
CreateLndhubWalletJob.perform_later(user)
|
||||
CreateLndhubAccountJob.perform_later(user)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -70,7 +70,7 @@ class LndhubV2
|
||||
# V2
|
||||
#
|
||||
|
||||
def create_account(payload)
|
||||
def create_account(payload={})
|
||||
post "v2/users", payload, admin_token: Rails.application.credentials.lndhub[:admin_token]
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user