diff options
| author | Adam Soltys <[email protected]> | 2023-02-15 22:52:01 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-02-15 22:52:01 -0800 |
| commit | b0c778addeeeb72181c7f2f431004c8b9b42aa35 (patch) | |
| tree | cd5722be914bf20cc3a624c219a16c724d7ba703 /lib/payments.js | |
| parent | d80d0b158156f398de4fa3488c9a2079bdca9710 (diff) | |
| download | coinos-server-b0c778addeeeb72181c7f2f431004c8b9b42aa35.tar.gz coinos-server-b0c778addeeeb72181c7f2f431004c8b9b42aa35.zip | |
buy endpoint
Diffstat (limited to 'lib/payments.js')
| -rw-r--r-- | lib/payments.js | 4 |
1 files changed, 2 insertions, 2 deletions
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}`); |
