From b0c778addeeeb72181c7f2f431004c8b9b42aa35 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 15 Feb 2023 22:52:01 -0800 Subject: buy endpoint --- lib/payments.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/payments.js b/lib/payments.js index e946e41e..657590ee 100644 --- a/lib/payments.js +++ b/lib/payments.js @@ -4,7 +4,7 @@ import { emit } from "$lib/sockets"; import { v4 } from "uuid"; import { notify } from "$lib/notifications"; import { db, g, s, t } from "$lib/db"; -import { l, err } from "$lib/logging"; +import { l, err, warn } from "$lib/logging"; import { fail } from "$lib/utils"; import { callWebhook } from "$lib/webhooks"; @@ -81,7 +81,7 @@ export let debit = async ( export let credit = async (hash, amount, memo, ref, type = types.internal) => { amount = parseInt(amount); let invoice = await g(`invoice:${hash}`); - if (!invoice) return; + if (!invoice) return warn("failed to credit", ref, ", invoice not found"); if (!memo) ({ memo } = invoice); let user = await g(`user:${invoice.uid}`); -- cgit v1.2.3