From 28179d6b58df35bc31c72463cbd029db9d162baf Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 6 Oct 2022 02:58:18 -0700 Subject: handle invoice lookup by uuid --- lib/sendInternal.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/sendInternal.js b/lib/sendInternal.js index 554dde91..ce131522 100644 --- a/lib/sendInternal.js +++ b/lib/sendInternal.js @@ -105,6 +105,7 @@ export default async ( if (address) params.where.address = address; else if (payreq) params.where.text = payreq; let invoice = (address || payreq) && (await db.Invoice.findOne(params)); + console.log("HMM", address, payreq, invoice); let a2; let acc = { @@ -157,14 +158,11 @@ export default async ( a2 = await db.Account.create(acc, { transaction }); } - let spread = user.username === "coinos" ? 1.02 : 1; - amount = Math.round(amount / spread); - params = { amount, account_id: a2.id, user_id: recipient.id, - rate: store.rates[recipient.currency] * spread, + rate: store.rates[recipient.currency], currency: recipient.currency, confirmed: true, hash: `#${v4().substr(0, 6)} Payment from ${user.username}`, -- cgit v1.2.3