diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/payments.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/payments.js b/lib/payments.js index cc8747d7..47cb11f4 100644 --- a/lib/payments.js +++ b/lib/payments.js @@ -12,7 +12,8 @@ export const types = { internal: "internal", bitcoin: "bitcoin", lightning: "lightning", - pot: "pot" + pot: "pot", + classic: "classic" }; export let debit = async ( @@ -34,7 +35,10 @@ export let debit = async ( if (!amount || amount < 0) fail("Amount must be greater than zero"); - let ourfee = type === types.internal ? 0 : Math.round(amount * config.fee); + let ourfee = [types.bitcoin, types.lightning].includes(type) + ? 0 + : Math.round(amount * config.fee); + await t(`balance:${uid}`, async (balance, db) => { await t(`credit:${type}:${uid}`, async (credit, db) => { let covered = Math.min(credit, ourfee) || 0; |
