diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/db.js | 2 | ||||
| -rw-r--r-- | lib/payments.js | 6 |
2 files changed, 4 insertions, 4 deletions
@@ -18,7 +18,7 @@ local covered = math.min(credit, ourfee) ourfee = ourfee - covered if balance < amount + tip + fee + ourfee then - return {err = 'Insufficient funds'} + return {err = 'Insufficient funds ' .. balance .. ' vs ' .. amount + tip + fee + ourfee} end redis.call('decrby', creditKey, tostring(math.floor(covered))) diff --git a/lib/payments.js b/lib/payments.js index 9eeec99a..c76bea70 100644 --- a/lib/payments.js +++ b/lib/payments.js @@ -33,11 +33,11 @@ export let debit = async ({ user, type = types.internal, id = v4(), - rate + rate, }) => { let ref; let { id: uid, currency, username } = user; - if (!rate) rate = store.rates[currency] + if (!rate) rate = store.rates[currency]; let iid = await g(`invoice:${hash}`); if (iid && iid.hash) iid = iid.hash; @@ -73,7 +73,7 @@ export let debit = async ({ ourfee || 0, ); - if (r !== "ok") fail("Insufficient funds"); + if (r !== "ok") fail("Problem debiting account"); let p = { id, |
