replaced some console.errors with logger

This commit is contained in:
jackiettran
2026-01-10 20:47:29 -05:00
parent 86cb8b3fe0
commit 415bcc5021
15 changed files with 165 additions and 174 deletions

View File

@@ -1,6 +1,7 @@
const { Rental } = require("../models");
const StripeService = require("./stripeService");
const { isActive } = require("../utils/rentalStatus");
const logger = require("../utils/logger");
class RefundService {
/**
@@ -161,13 +162,14 @@ class RefundService {
stripeRefundId = refund.id;
refundProcessedAt = new Date();
} catch (error) {
console.error("Error processing Stripe refund:", error);
logger.error("Error processing Stripe refund", { error });
throw new Error(`Failed to process refund: ${error.message}`);
}
} else if (refundCalculation.refundAmount > 0) {
// Log warning if we should refund but don't have payment intent
console.warn(
`Refund amount calculated but no payment intent ID for rental ${rentalId}`
logger.warn(
"Refund amount calculated but no payment intent ID for rental",
{ rentalId }
);
}