diff --git a/src/controllers/05-payment-controller.ts b/src/controllers/05-payment-controller.ts index c61d4bc..7ad9584 100644 --- a/src/controllers/05-payment-controller.ts +++ b/src/controllers/05-payment-controller.ts @@ -152,7 +152,18 @@ export class QuotationPayment extends Controller { if (!record) throw notFoundError("Payment"); - if (record.paymentStatus === "PaymentSuccess") return record; + if (record.paymentStatus === "PaymentSuccess") { + const { channel, account, reference } = body; + return await prisma.payment.update({ + where: { id: paymentId, invoice: { quotationId: record.invoice.quotationId } }, + data: { + channel, + account, + reference, + updatedByUserId: req.user.sub, + }, + }); + } return await prisma.$transaction(async (tx) => { const current = new Date();