update redirect url
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user