From 642306ff14d774b3ec3ccd5c9174639b86d6f7c4 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 6 Oct 2022 01:15:21 -0700 Subject: send invoice with payment message --- lib/sendInternal.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/sendInternal.js') diff --git a/lib/sendInternal.js b/lib/sendInternal.js index e8e5e1b6..554dde91 100644 --- a/lib/sendInternal.js +++ b/lib/sendInternal.js @@ -176,6 +176,9 @@ export default async ( if (invoice) { params.invoice_id = invoice.id; + await invoice.increment({ received: amount }, { transaction }); + await invoice.reload({ transaction }); + let c = store.convert[invoice.text]; if (c) { l( @@ -200,6 +203,8 @@ export default async ( p2 = p2.get({ plain: true }); p2.account = a2.get({ plain: true }); + if (invoice) p2.invoice = invoice.get({ plain: true }); + emit(recipient.username, "payment", p2); emit(recipient.username, "account", p2.account); -- cgit v1.2.3