diff --git a/src/modules/payment/controllers/payment.controller.ts b/src/modules/payment/controllers/payment.controller.ts index e8b1467..e1bd999 100644 --- a/src/modules/payment/controllers/payment.controller.ts +++ b/src/modules/payment/controllers/payment.controller.ts @@ -6,7 +6,7 @@ import { Delete, Res, } from '@nestjs/common'; -import type { Response } from 'express'; +import type { FastifyReply } from 'fastify'; import { PaymentService } from '../services/payments.service'; import { ApiTags, @@ -42,15 +42,15 @@ export class PaymentController { @ApiOperation({ summary: 'Verify online payment' }) async verifyOnlinePayment( @Query('Authority') token: string, - @Res() res: Response, + @Res() res: FastifyReply, ) { try { const payment = await this.paymentService.verifyOnlinePayment(token); const redirectUrl = this.paymentService.getRedirectUrlAfterVerify(payment); - return res.redirect(302, redirectUrl); + return res.redirect(redirectUrl, 302); } catch { const redirectUrl = this.paymentService.getRedirectUrlAfterVerifyToFailed(); - return res.redirect(302, redirectUrl); + return res.redirect(redirectUrl, 302); } }