Add logging for Stripe deposit requests and round amount input
This commit is contained in:
@@ -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.` });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user