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:
padreug 2025-09-12 23:26:14 +02:00
parent 7ebd809abc
commit c58e4e330c

View file

@ -93,11 +93,11 @@ async function newAddress(account, info, tx) {
const endpoint = `${account.endpoint}/api/v1/payments` const endpoint = `${account.endpoint}/api/v1/payments`
const result = await request(endpoint, 'POST', invoiceData, account.adminKey) const result = await request(endpoint, 'POST', invoiceData, account.adminKey)
if (!result.payment_request) { if (!result.bolt11) {
throw new Error('LNBits did not return a payment request') throw new Error('LNBits did not return a bolt11 invoice')
} }
return result.payment_request return result.bolt11
} }
async function getStatus(account, tx) { async function getStatus(account, tx) {