aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2018-10-06 13:37:34 -0700
committerAdam Soltys <[email protected]>2018-10-06 13:37:34 -0700
commitba7a9f3eb5e4e7af54e10db66cf650f756a6e410 (patch)
tree710836af4a428e68a6a9b873dbb38e203fad0823
parent4352e0816865e84ada0ba88c5e04471030d5c07d (diff)
downloadcoinos-server-ba7a9f3eb5e4e7af54e10db66cf650f756a6e410.tar.gz
coinos-server-ba7a9f3eb5e4e7af54e10db66cf650f756a6e410.zip
check that invoice is settled before processing payment
-rw-r--r--index.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/index.js b/index.js
index 595eaaac..561ea2f2 100644
--- a/index.js
+++ b/index.js
@@ -81,6 +81,8 @@ const l = console.log
})
const handlePayment = async msg => {
+ if (!msg.settled) return
+
let payment = await db.Payment.findOne({
include: { model: db.User, as: 'user' },
where: {