replaced some console.errors with logger
This commit is contained in:
@@ -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 }
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user