Update deposit intent to log stripeAmount and use it for payment creation

This commit is contained in:
2025-12-21 00:32:36 +01:00
parent 0fe2781a11
commit 3861b4477d

View File

@@ -27,8 +27,9 @@ router.post('/api/wallet/deposit-intent', authMiddleware, async (req, res) => {
const rawAmount = req.body.amount;
const amount = Math.round(Number(rawAmount));
const stripeAmount = Math.round(amount * 100);
if (process.env.NODE_ENV !== 'production') {
console.log('Stripe deposit request:', { rawAmount, amount, min: MIN_DEPOSIT, max: MAX_DEPOSIT });
console.log('Stripe deposit request:', { rawAmount, amount, stripeAmount, min: MIN_DEPOSIT, max: MAX_DEPOSIT });
}
if (!Number.isFinite(amount) || amount < MIN_DEPOSIT || amount > MAX_DEPOSIT) {
@@ -36,7 +37,7 @@ router.post('/api/wallet/deposit-intent', authMiddleware, async (req, res) => {
}
const paymentIntent = await stripe.paymentIntents.create({
amount,
amount: stripeAmount,
currency: 'huf',
automatic_payment_methods: { enabled: true },
metadata: {