more lgs
This commit is contained in:
parent
ac10fb3849
commit
928a7d92ee
2 changed files with 8 additions and 0 deletions
|
|
@ -179,6 +179,7 @@ export default class {
|
||||||
async createZapReceipt(log: PubLogger, invoice: UserReceivingInvoice) {
|
async createZapReceipt(log: PubLogger, invoice: UserReceivingInvoice) {
|
||||||
const zapInfo = invoice.zap_info
|
const zapInfo = invoice.zap_info
|
||||||
if (!zapInfo || !invoice.linkedApplication || !invoice.linkedApplication.nostr_public_key) {
|
if (!zapInfo || !invoice.linkedApplication || !invoice.linkedApplication.nostr_public_key) {
|
||||||
|
log("no zap info linked to payment")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const tags = [["p", zapInfo.pub], ["bolt11", invoice.invoice], ["description", zapInfo.description]]
|
const tags = [["p", zapInfo.pub], ["bolt11", invoice.invoice], ["description", zapInfo.description]]
|
||||||
|
|
|
||||||
|
|
@ -375,6 +375,13 @@ export default class {
|
||||||
if (!key.linkedApplication) {
|
if (!key.linkedApplication) {
|
||||||
throw new Error("cannot handle lnurl for non application user")
|
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, {
|
const invoice = await this.NewInvoice(key.user.user_id, {
|
||||||
amountSats: sats,
|
amountSats: sats,
|
||||||
memo: zapInfo ? zapInfo.description : defaultLnurlPayMetadata
|
memo: zapInfo ? zapInfo.description : defaultLnurlPayMetadata
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue