From 88990faa498ab269d1745dc6524cddf2fe9e5245 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 4 May 2023 10:05:51 -0700 Subject: set rate for pot invoices --- routes/payments.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'routes') diff --git a/routes/payments.js b/routes/payments.js index cb942940..282a8682 100644 --- a/routes/payments.js +++ b/routes/payments.js @@ -111,6 +111,7 @@ export default { await credit(hash, amount, memo, user.id); } else { let pot = name || v4(); + memo = pot; p = await debit(hash, amount, 0, memo, user, types.pot); await db.incrBy(`pot:${pot}`, amount); await db.lPush(`pot:${pot}:payments`, p.id); @@ -202,7 +203,10 @@ export default { }); let hash = v4(); + let { currency } = user; await s(`invoice:${hash}`, { + currency, + rate: store.rates[currency], uid: user.id, received: 0 }); -- cgit v1.2.3