aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-01-31 14:35:52 -0800
committerAdam Soltys <[email protected]>2024-01-31 14:35:52 -0800
commit25d57b726f158f7eb142b109c3a51e2c84bad210 (patch)
tree5a1e18122f5322f2cd17475b2ba564a91735fe75 /routes
parent0c223a4835711a287f17835af959b47f72ea68c9 (diff)
downloadcoinos-server-25d57b726f158f7eb142b109c3a51e2c84bad210.tar.gz
coinos-server-25d57b726f158f7eb142b109c3a51e2c84bad210.zip
withdrawal emails
Diffstat (limited to 'routes')
-rw-r--r--routes/payments.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/routes/payments.js b/routes/payments.js
index f8f8af3d..7d568773 100644
--- a/routes/payments.js
+++ b/routes/payments.js
@@ -7,7 +7,7 @@ import { l, err, warn } from "$lib/logging";
import { bail, fail, getInvoice, btc, sats, SATS } from "$lib/utils";
import { requirePin } from "$lib/auth";
import {
- autowithdraw,
+ completePayment,
debit,
credit,
types,
@@ -30,7 +30,7 @@ export default {
async create({ body, user }, res) {
let { amount, hash, maxfee, fund, memo, payreq, rate, username } = body;
- let balance = await g(`balance:${user.id}`);
+ let balance = await g(`balance:${user.id}`);
try {
if (await g("freeze")) fail("Problem sending payment");
@@ -272,7 +272,7 @@ export default {
emit(p.uid, "payment", p);
let user = await g(`user:${p.uid}`);
- autowithdraw(user);
+ await completePayment(p, user);
}
}
}
@@ -305,7 +305,7 @@ export default {
async send({ body, user }, res) {
try {
await requirePin({ body, user });
- let txid = await sendOnchain({ ...body, user });
+ let { hash: txid } = await sendOnchain({ ...body, user });
res.send({ txid });
} catch (e) {