aboutsummaryrefslogtreecommitdiffstats
path: root/routes/payments.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-10-19 08:09:59 -0700
committerAdam Soltys <[email protected]>2024-10-19 08:09:59 -0700
commit1d5053feb4a5f9b2ea477676f437aef5c7fb7c5d (patch)
tree5bc8cb35f6e4104bc17cb499275ca88e32d815a0 /routes/payments.ts
parentdd52d07a513c4c98197b36eb48e213a0b2164d32 (diff)
downloadcoinos-server-1d5053feb4a5f9b2ea477676f437aef5c7fb7c5d.tar.gz
coinos-server-1d5053feb4a5f9b2ea477676f437aef5c7fb7c5d.zip
subscriptions
Diffstat (limited to 'routes/payments.ts')
-rw-r--r--routes/payments.ts12
1 files changed, 3 insertions, 9 deletions
diff --git a/routes/payments.ts b/routes/payments.ts
index 33f66e8d..f69123ac 100644
--- a/routes/payments.ts
+++ b/routes/payments.ts
@@ -24,7 +24,7 @@ import {
sendLightning,
sendOnchain,
} from "$lib/payments";
-import { mqtt1, mqtt2 } from "$lib/mqtt";
+import mqtt from "$lib/mqtt";
import got from "got";
import api from "$lib/api";
import rpc from "@coinos/rpc";
@@ -334,9 +334,8 @@ export default {
.incrBy(`balance:${p.aid || p.uid}`, p.amount)
.exec();
- emit(p.uid, "payment", p);
let user = await g(`user:${p.uid}`);
- await completePayment(p, user);
+ await completePayment(invoice, p, user);
}
}
res.send({});
@@ -407,12 +406,7 @@ export default {
let { username } = user;
- mqtt1.publish(
- username,
- `pay:${p.amount}:${p.tip}:${p.rate}:${p.created}:${p.id}`,
- );
-
- mqtt2.publish(
+ mqtt.publish(
username,
`pay:${p.amount}:${p.tip}:${p.rate}:${p.created}:${p.id}`,
);