aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-02-16 20:37:32 -0800
committerAdam Soltys <[email protected]>2023-02-16 20:37:32 -0800
commit8b9497ec3349a584c90d2ac782c634f7f328c19f (patch)
tree7626cef14bc2fd188fd00a0feb4007a320d6cdb5 /routes
parent38aa5fa9952bfce66e37fc0c92216bd477aba574 (diff)
downloadcoinos-server-8b9497ec3349a584c90d2ac782c634f7f328c19f.tar.gz
coinos-server-8b9497ec3349a584c90d2ac782c634f7f328c19f.zip
check eligibility on buy
Diffstat (limited to 'routes')
-rw-r--r--routes/payments.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/routes/payments.js b/routes/payments.js
index 633b94ee..51172251 100644
--- a/routes/payments.js
+++ b/routes/payments.js
@@ -257,6 +257,8 @@ export default {
},
async buy({ body: { amount, number, year, month, cvc }, user }, res) {
+ if (!user.eligible) fail("not eligible");
+
let stripe = "https://api.stripe.com/v1";
let { stripe: username } = config;