From b688a765503fbb4d73189f41d1481348cc8e26cd Mon Sep 17 00:00:00 2001 From: marshal Date: Mon, 29 Jun 2026 15:05:50 +0300 Subject: [PATCH] payemnt --- .../src/modules/payment/payment.service.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/apps/edr-freight-api/src/modules/payment/payment.service.ts b/apps/edr-freight-api/src/modules/payment/payment.service.ts index 247b6cf62..1d56cb1cf 100644 --- a/apps/edr-freight-api/src/modules/payment/payment.service.ts +++ b/apps/edr-freight-api/src/modules/payment/payment.service.ts @@ -289,20 +289,21 @@ export class PaymentService { providerTxnId?: string; paidAt?: Date; }): Promise<{ alreadyFinalized: boolean }> { - const intent = await this.paymentRepo.findOneBy({ id: input.intentId }); - if (!intent) throw new NotFoundException("PaymentIntent not found"); - if (intent.status === "success") return { alreadyFinalized: true }; + // const intent = await this.paymentRepo.findOneBy({ id: input.intentId }); + // if (!intent) throw new NotFoundException("PaymentIntent not found"); + // if (intent.status === "success") return { alreadyFinalized: true }; const paidAt = input.paidAt ?? new Date(); // Every booking is a real shipment now (contracts are a separate aggregate), // so payment always settles the booking to PAID and enters allocation. await this.datasource.transaction(async (mg) => { - await mg.update( - PaymentEntity, - { id: intent.id }, - { status: "success", paidAt, transactionId: input.providerTxnId ?? intent.transactionId }, - ); + // await mg.update( + // PaymentEntity, + // // { id: intent.id }, + // {id:input.intentId}, + // { status: "success", paidAt, transactionId: input.providerTxnId ?? intent.transactionId }, + // ); await mg.update( Booking, { id: input.bookingId },