Add logging for Stripe deposit requests and round amount input

This commit is contained in:
2025-12-21 00:29:33 +01:00
parent be7b0c48e3
commit 0fe2781a11

View File

@@ -25,7 +25,12 @@ router.post('/api/wallet/deposit-intent', authMiddleware, async (req, res) => {
return;
}
const amount = Number(req.body.amount);
const rawAmount = req.body.amount;
const amount = Math.round(Number(rawAmount));
if (process.env.NODE_ENV !== 'production') {
console.log('Stripe deposit request:', { rawAmount, amount, min: MIN_DEPOSIT, max: MAX_DEPOSIT });
}
if (!Number.isFinite(amount) || amount < MIN_DEPOSIT || amount > MAX_DEPOSIT) {
return res.status(400).json({ error: `A feltoltes ${MIN_DEPOSIT} es ${MAX_DEPOSIT} Ft kozott lehet.` });
}