From d06acb3b41c76e0de47176f394c008fe68d25a2a Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 3 Nov 2022 15:36:47 -0700 Subject: record tip for internal payments --- lib/sendInternal.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/sendInternal.js b/lib/sendInternal.js index 640587b5..7204f769 100644 --- a/lib/sendInternal.js +++ b/lib/sendInternal.js @@ -13,7 +13,7 @@ import { fail } from "$lib/utils"; const { HOSTNAME: hostname } = process.env; export default async ( - { amount, address, payreq, unconfidential, asset, memo, username }, + { amount, address, payreq, unconfidential, asset, memo, username, tip }, user ) => { amount = parseInt(amount); @@ -144,7 +144,12 @@ export default async ( }; if (invoice) { + let { tip } = invoice; params.invoice_id = invoice.id; + if (tip) { + params.tip = tip; + params.amount -= tip; + } await invoice.increment({ received: amount }, { transaction }); await invoice.reload({ transaction }); -- cgit v1.2.3