diff options
| author | Adam Soltys <[email protected]> | 2022-08-01 22:17:58 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-08-01 22:18:18 -0700 |
| commit | 52de78167f0a9a4f28e06c8e4d2883305a6046d5 (patch) | |
| tree | b017df9219bc1572426cdcc3bc337897a7f68b4c /routes/lightning | |
| parent | f88165f8ffd3f3d39e7ca32af4197462924c84b4 (diff) | |
| download | coinos-server-52de78167f0a9a4f28e06c8e4d2883305a6046d5.tar.gz coinos-server-52de78167f0a9a4f28e06c8e4d2883305a6046d5.zip | |
record invoice status
Diffstat (limited to 'routes/lightning')
| -rw-r--r-- | routes/lightning/receive.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/routes/lightning/receive.js b/routes/lightning/receive.js index 89ad4c29..c9e7dec7 100644 --- a/routes/lightning/receive.js +++ b/routes/lightning/receive.js @@ -61,6 +61,9 @@ const handlePayment = async (msg) => { total = amount + tip; invoice.received += total; + invoice.status = 'paid'; + await invoice.save({ transaction }); + await account.increment({ balance: total }, { transaction }); // get the # of fee credits you would need to pay off this amount of bitcoin await account.increment({ lightning_credits: computeConversionFee(total) }, { transaction }); @@ -71,6 +74,7 @@ const handlePayment = async (msg) => { payment = payment.get({ plain: true }); payment.account = account.get({ plain: true }); + payment.invoice= invoice.get({ plain: true }); callWebhook(invoice, payment); |
