update redirect url

This commit is contained in:
2026-02-25 21:08:26 +03:30
parent cf7fd04913
commit 7b8c6503f5
@@ -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);
}
}