aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-05-13 12:27:13 -0700
committerAdam Soltys <[email protected]>2024-05-13 12:27:20 -0700
commit8777ac8bf4d07db11660675248b081bb82bcd326 (patch)
tree018d470f08257bfdccbdb7f313cde41f4f3fb565 /lib
parent62873c946bf8b7aa14634cf6d1105e5d13cd832e (diff)
downloadcoinos-server-8777ac8bf4d07db11660675248b081bb82bcd326.tar.gz
coinos-server-8777ac8bf4d07db11660675248b081bb82bcd326.zip
fail on paid invoice
Diffstat (limited to 'lib')
-rw-r--r--lib/payments.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/payments.js b/lib/payments.js
index a754dc93..89636ed5 100644
--- a/lib/payments.js
+++ b/lib/payments.js
@@ -59,7 +59,9 @@ export let debit = async ({
let iid;
if (invoice) {
+ if (invoice.received >= amount) fail("Invoice already paid");
({ id: iid } = invoice);
+
ref = invoice.uid;
let equivalentRate =