aboutsummaryrefslogtreecommitdiffstats
path: root/index.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2018-03-22 09:50:38 -0700
committerAdam Soltys <[email protected]>2018-03-22 09:50:42 -0700
commitbcf501e32ed47ac2920736530f45a93ccc0b339e (patch)
treec9b94a51619ff055909e3a6552507a9c7b77922d /index.js
parent28b58e4e3d737dd23820f8a05975205048c7eaca (diff)
downloadcoinos-server-bcf501e32ed47ac2920736530f45a93ccc0b339e.tar.gz
coinos-server-bcf501e32ed47ac2920736530f45a93ccc0b339e.zip
track tips and set received boolean for fulfilled payments
Diffstat (limited to 'index.js')
-rw-r--r--index.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/index.js b/index.js
index bd1f9183..c9af0479 100644
--- a/index.js
+++ b/index.js
@@ -89,7 +89,10 @@ const l = console.log
if (!payment) return
+ payment.received = true
payment.user.channelbalance += parseInt(msg.value)
+
+ await payment.save()
await payment.user.save()
payments.push(msg.payment_request)
@@ -353,6 +356,7 @@ const l = console.log
amount: req.body.amount,
currency: 'CAD',
rate: app.get('rates').ask,
+ tip: req.body.tip,
})
res.send(invoice)