stripe webhooks. removed payout cron. webhook for when amount is deposited into bank. More communication about payout timelines
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
const { Rental, Item, User } = require("../models");
|
||||
const emailServices = require("./email");
|
||||
const { isActive } = require("../utils/rentalStatus");
|
||||
const logger = require("../utils/logger");
|
||||
|
||||
class LateReturnService {
|
||||
/**
|
||||
@@ -100,6 +101,18 @@ class LateReturnService {
|
||||
);
|
||||
}
|
||||
|
||||
// Trigger immediate payout if rental is verified to be actually completed not late
|
||||
if (!lateCalculation.isLate) {
|
||||
// Import here to avoid circular dependency
|
||||
const PayoutService = require("./payoutService");
|
||||
PayoutService.triggerPayoutOnCompletion(rentalId).catch((err) => {
|
||||
logger.error("Error triggering payout on late return processing", {
|
||||
rentalId,
|
||||
error: err.message,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
rental: updatedRental,
|
||||
lateCalculation,
|
||||
|
||||
Reference in New Issue
Block a user