diff options
Diffstat (limited to 'lib/payments.js')
| -rw-r--r-- | lib/payments.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/payments.js b/lib/payments.js index af08cb84..d25df227 100644 --- a/lib/payments.js +++ b/lib/payments.js @@ -18,16 +18,15 @@ export const types = { export let debit = async ( hash, amount, + fee = 0, memo, user, type = types.internal, id = v4() ) => { - console.log("HASH", hash) let ref; let invoice = await g(`invoice:${hash}`); if (invoice) ref = invoice.uid; - console.log("REF", ref) let { id: uid, currency, username } = user; @@ -41,13 +40,13 @@ export let debit = async ( return balance - amount; }); - let fee = 0; - let p = { id, amount: -amount, + fee, memo, uid, + confirmed: true, rate: store.rates[currency], currency, type, @@ -102,7 +101,7 @@ export let credit = async (hash, amount, memo, ref, type = types.internal) => { balance = "pending"; } else { p.id = hash; - } + } await db .multi() |
