aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2019-03-13 17:35:39 +0000
committerAdam Soltys <[email protected]>2019-03-13 17:35:39 +0000
commit52cc67459c6a8a6592198873bbe0c472b0fd3b79 (patch)
tree32466967ea35b342e36aabed7be4a91b3a73ab49
parenteacc8e1b8fc4834dfd79b476af2109f37dc5f7f3 (diff)
downloadcoinos-server-52cc67459c6a8a6592198873bbe0c472b0fd3b79.tar.gz
coinos-server-52cc67459c6a8a6592198873bbe0c472b0fd3b79.zip
sats -> sat
-rw-r--r--index.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/index.js b/index.js
index 5aeda7fc..0c5437e6 100644
--- a/index.js
+++ b/index.js
@@ -838,7 +838,7 @@ const authy = new Client({ key: config.authy.key });
app.post('/buy', auth, async (req, res) => {
const stripe = require('stripe')(config.stripe)
- const { token, amount, sats } = req.body
+ const { token, amount, sat } = req.body
let dollarAmount = parseInt(amount / 100)
if (dollarAmount > req.user.limit) return res.status(401).end()
@@ -851,7 +851,7 @@ const authy = new Client({ key: config.authy.key });
source: token,
})
- req.user.balance += parseInt(sats)
+ req.user.balance += parseInt(sat)
req.user.limit -= dollarAmount
await req.user.save()
emit(req.user.username, 'user', req.user)
@@ -859,7 +859,7 @@ const authy = new Client({ key: config.authy.key });
await db.Payment.create({
user_id: req.user.id,
hash: charge.balance_transaction,
- amount: parseInt(sats),
+ amount: parseInt(sat),
currency: 'CAD',
rate: app.get('rates').ask,
received: true,