aboutsummaryrefslogtreecommitdiffstats
path: root/lib/payments.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-11-23 23:39:15 +0000
committerAdam Soltys <[email protected]>2023-11-23 23:39:19 +0000
commit3d38a3656103b117fe1e68fa23aca3c1410fa969 (patch)
tree36439ccee411ff8da6699f5ab160d1399065361c /lib/payments.js
parentab44bc3815c233a16586eada624672ff03e51224 (diff)
downloadcoinos-server-3d38a3656103b117fe1e68fa23aca3c1410fa969.tar.gz
coinos-server-3d38a3656103b117fe1e68fa23aca3c1410fa969.zip
new printer endpoints
Diffstat (limited to 'lib/payments.js')
-rw-r--r--lib/payments.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/payments.js b/lib/payments.js
index f39e2937..148a6ea1 100644
--- a/lib/payments.js
+++ b/lib/payments.js
@@ -14,7 +14,7 @@ import ffmpeg from "fluent-ffmpeg";
import fs from "fs";
import EventEmitter from "events";
import crc32 from "buffer-crc32";
-import mqtt from "$lib/mqtt";
+import { mqtt1, mqtt2 } from "$lib/mqtt";
export const types = {
internal: "internal",
@@ -176,7 +176,12 @@ export let credit = async (hash, amount, memo, ref, type = types.internal) => {
notify(user, `Received ${amount} sats`);
callWebhook(invoice, p);
- mqtt.publish(
+ mqtt1.publish(
+ username,
+ `pay:${p.amount}:${p.tip}:${p.rate}:${p.created}:${p.id}`
+ );
+
+ mqtt2.publish(
username,
`pay:${p.amount}:${p.tip}:${p.rate}:${p.created}:${p.id}`
);