Refactor MIN_DEPOSIT calculation to ensure it respects environment variable settings
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user