diff options
| author | Adam Soltys <[email protected]> | 2022-08-25 08:14:22 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-08-25 08:14:22 -0700 |
| commit | 05b5dc758285a5f396f9973fa91bd5643dbbbc7a (patch) | |
| tree | eeaa11f349ca2c2f19497e620d96661555550c34 /lib | |
| parent | cdce31ac0ba880a0d61d7006bf1f02cf8b798b21 (diff) | |
| download | coinos-server-05b5dc758285a5f396f9973fa91bd5643dbbbc7a.tar.gz coinos-server-05b5dc758285a5f396f9973fa91bd5643dbbbc7a.zip | |
return payments with user object
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sockets.js | 4 | ||||
| -rw-r--r-- | lib/webhooks.js | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/sockets.js b/lib/sockets.js index 8cdb7992..9220d420 100644 --- a/lib/sockets.js +++ b/lib/sockets.js @@ -16,16 +16,18 @@ const lastSeen = {}; emit = (username, type, data) => { if (data.username !== undefined) data = pick(data, ...whitelist); + if (type === "payment" && data.amount > 0) { for (let i = subscriptions.length - 1; i >= 0; i--) { let s = subscriptions[i]; + if ( s.invoice.amount === data.amount || (data.address && s.invoice.address === data.address) || (data.address && s.invoice.unconfidential === data.address) ) { s.ws.send(JSON.stringify({ type, data })); - subscriptions.splice(i, 1); + // subscriptions.splice(i, 1); } } } diff --git a/lib/webhooks.js b/lib/webhooks.js index c282ceea..2dbdf7c1 100644 --- a/lib/webhooks.js +++ b/lib/webhooks.js @@ -24,9 +24,7 @@ callWebhook = (invoice, payment) => { memo, confirmed, text, - webhook, - }) - .json() - .catch(console.log); + webhook + }).res().catch(console.log); } }; |
