mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-06-06 18:31:00 +00:00
Pass back payment hash
This commit is contained in:
parent
08dc929a5d
commit
ff4b9d8ac9
@ -76,7 +76,7 @@ export default async function handler(req, res) {
|
||||
'Authorization': PLEBDEVS_API_KEY
|
||||
}
|
||||
});
|
||||
res.status(200).json({ pr: response.data, verify: `${BACKEND_URL}/api/lightning-address/verify/${slug}/${response.data.payment_hash}` });
|
||||
res.status(200).json({ pr: response.data.invoice, verify: `${BACKEND_URL}/api/lightning-address/verify/${slug}/${response.data.payment_hash}` });
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
res.status(500).json({ error: 'Failed to generate invoice' });
|
||||
|
@ -58,6 +58,7 @@ export default async function handler(req, res) {
|
||||
});
|
||||
|
||||
const invoice = response.data.payment_request;
|
||||
const paymentHash = response.data.r_hash;
|
||||
|
||||
// If this is a zap, publish a zap receipt
|
||||
if (zap_request && foundAddress.allowsNostr) {
|
||||
@ -84,7 +85,7 @@ export default async function handler(req, res) {
|
||||
console.log("ZAP RECEIPT PUBLISHED", signedZapReceipt);
|
||||
}
|
||||
|
||||
res.status(200).json(invoice);
|
||||
res.status(200).json({ invoice, payment_hash: paymentHash });
|
||||
} catch (error) {
|
||||
console.error('Error (server) fetching data from LND:', error.message);
|
||||
res.status(500).json({ message: 'Error fetching data' });
|
||||
|
Loading…
x
Reference in New Issue
Block a user