fix: ( payment ) stop re-finalizing already-completed payments on intent read

This commit is contained in:
Abubeker Yasin
2026-07-22 15:41:34 +03:00
parent c6f6616218
commit 1382910508

View File

@@ -598,6 +598,17 @@ export class PaymentsService {
where: { bookingId },
});
if (local?.status === PaymentIntentStatus.SUCCEEDED) {
const booking = await this.prisma.booking.findUnique({
where: { id: bookingId },
select: { status: true },
});
if (booking?.status === "CONFIRMED") {
return this.formatIntentStatus(local);
}
}
// WALLET payments never leave this app — no remote intent exists for them.
if (local?.method === PaymentMethodType.WALLET) {
return this.formatIntentStatus(local);