fix: update LNBits payment request handling
- Changed the response handling in the newAddress function to return the bolt11 invoice instead of the payment request. - Updated error message to reflect the change in response structure from LNBits.
This commit is contained in:
parent
7ebd809abc
commit
c58e4e330c
1 changed files with 3 additions and 3 deletions
|
|
@ -93,11 +93,11 @@ async function newAddress(account, info, tx) {
|
|||
const endpoint = `${account.endpoint}/api/v1/payments`
|
||||
const result = await request(endpoint, 'POST', invoiceData, account.adminKey)
|
||||
|
||||
if (!result.payment_request) {
|
||||
throw new Error('LNBits did not return a payment request')
|
||||
if (!result.bolt11) {
|
||||
throw new Error('LNBits did not return a bolt11 invoice')
|
||||
}
|
||||
|
||||
return result.payment_request
|
||||
return result.bolt11
|
||||
}
|
||||
|
||||
async function getStatus(account, tx) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue