diff options
| author | Adam Soltys <[email protected]> | 2023-05-23 23:28:37 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-05-23 23:28:37 -0700 |
| commit | 4c9cc0ec8c3058077af3ad5aae0bf52a31e546eb (patch) | |
| tree | 1047d88e9f4cc440b7b6163012d5c03c8e0f770b | |
| parent | df1b1711e2f7b437128993a97efc9249f41efc95 (diff) | |
| download | coinos-server-4c9cc0ec8c3058077af3ad5aae0bf52a31e546eb.tar.gz coinos-server-4c9cc0ec8c3058077af3ad5aae0bf52a31e546eb.zip | |
add tips
| -rw-r--r-- | routes/payments.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/routes/payments.js b/routes/payments.js index 6ca9cc60..325f1df0 100644 --- a/routes/payments.js +++ b/routes/payments.js @@ -155,10 +155,17 @@ export default { (a, b) => ({ ...a, [b.currency]: { - sats: (a[b.currency] ? a[b.currency].sats : 0) + b.amount, + sats: + (a[b.currency] ? a[b.currency].sats : 0) + + (b.amount || 0) + + (b.tip || 0) - + (b.fee || 0) - + (b.ourfee || 0), fiat: ( parseFloat(a[b.currency] ? a[b.currency].fiat : 0) + - (b.amount * b.rate) / SATS + (((b.amount || 0) + (b.tip || 0) - (b.fee || 0) - (b.ourfee || 0)) * + b.rate) / + SATS ).toFixed(2) } }), |
