This commit is contained in:
boufni95 2023-12-01 17:26:52 +01:00
parent ac10fb3849
commit 928a7d92ee
2 changed files with 8 additions and 0 deletions

View file

@ -179,6 +179,7 @@ export default class {
async createZapReceipt(log: PubLogger, invoice: UserReceivingInvoice) {
const zapInfo = invoice.zap_info
if (!zapInfo || !invoice.linkedApplication || !invoice.linkedApplication.nostr_public_key) {
log("no zap info linked to payment")
return
}
const tags = [["p", zapInfo.pub], ["bolt11", invoice.invoice], ["description", zapInfo.description]]

View file

@ -375,6 +375,13 @@ export default class {
if (!key.linkedApplication) {
throw new Error("cannot handle lnurl for non application user")
}
let log = getLogger({ appName: key.linkedApplication.name })
if (zapInfo) {
log("this payment is a zap")
} else {
log("this payment is NOT a zap")
}
const invoice = await this.NewInvoice(key.user.user_id, {
amountSats: sats,
memo: zapInfo ? zapInfo.description : defaultLnurlPayMetadata