Stripe error handling and now you can rent an item for a different time while having an upcoming or active rental
This commit is contained in:
@@ -654,8 +654,11 @@ router.put("/:id/status", authenticateToken, async (req, res) => {
|
||||
? paymentError.renterMessage
|
||||
: "Your payment could not be processed. Please try a different payment method.";
|
||||
|
||||
// Track payment failure timestamp
|
||||
await rental.update({ paymentFailedNotifiedAt: new Date() });
|
||||
// Track payment failure timestamp and reason
|
||||
await rental.update({
|
||||
paymentFailedNotifiedAt: new Date(),
|
||||
paymentFailedReason: renterMessage,
|
||||
});
|
||||
|
||||
// Auto-send payment declined email to renter
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user