diff options
| -rw-r--r-- | routes/lnurl.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/routes/lnurl.js b/routes/lnurl.js index 0f760695..011db286 100644 --- a/routes/lnurl.js +++ b/routes/lnurl.js @@ -80,21 +80,22 @@ export default { let { username } = user; username = username.replace(/\s/g, "").toLowerCase(); + let metadata = JSON.stringify([ + ["text/plain", `Paying ${username}@${host}`], + ["text/identifier", `${username}@${host}`] + ]); + if (nostr) { try { let event = JSON.parse(decodeURIComponent(nostr)); // TODO: validate the event await s(`zap:${id}`, event); + metadata = nostr; } catch (e) { err("problem handling zap", e.message); } } - let metadata = JSON.stringify([ - ["text/plain", `Paying ${username}@${host}`], - ["text/identifier", `${username}@${host}`] - ]); - let { text: pr } = await generate({ invoice: { amount: Math.round(amount / 1000), |
