Refactor MIN_DEPOSIT calculation to ensure it respects environment variable settings

This commit is contained in:
2025-12-21 00:24:56 +01:00
parent 3331c31d22
commit be7b0c48e3

View File

@@ -7,7 +7,8 @@ const router = Router();
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY || '', {
apiVersion: '2024-06-20'
});
const MIN_DEPOSIT = Number(process.env.MIN_DEPOSIT || 175);
const STRIPE_MIN_HUF = 175;
const MIN_DEPOSIT = Math.max(Number(process.env.MIN_DEPOSIT || STRIPE_MIN_HUF), STRIPE_MIN_HUF);
const MAX_DEPOSIT = Number(process.env.MAX_DEPOSIT || 1000);
function ensureStripeConfigured(res) {