update redirect url
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
|||||||
Delete,
|
Delete,
|
||||||
Res,
|
Res,
|
||||||
} from '@nestjs/common';
|
} from '@nestjs/common';
|
||||||
import type { Response } from 'express';
|
import type { FastifyReply } from 'fastify';
|
||||||
import { PaymentService } from '../services/payments.service';
|
import { PaymentService } from '../services/payments.service';
|
||||||
import {
|
import {
|
||||||
ApiTags,
|
ApiTags,
|
||||||
@@ -42,15 +42,15 @@ export class PaymentController {
|
|||||||
@ApiOperation({ summary: 'Verify online payment' })
|
@ApiOperation({ summary: 'Verify online payment' })
|
||||||
async verifyOnlinePayment(
|
async verifyOnlinePayment(
|
||||||
@Query('Authority') token: string,
|
@Query('Authority') token: string,
|
||||||
@Res() res: Response,
|
@Res() res: FastifyReply,
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
const payment = await this.paymentService.verifyOnlinePayment(token);
|
const payment = await this.paymentService.verifyOnlinePayment(token);
|
||||||
const redirectUrl = this.paymentService.getRedirectUrlAfterVerify(payment);
|
const redirectUrl = this.paymentService.getRedirectUrlAfterVerify(payment);
|
||||||
return res.redirect(302, redirectUrl);
|
return res.redirect(redirectUrl, 302);
|
||||||
} catch {
|
} catch {
|
||||||
const redirectUrl = this.paymentService.getRedirectUrlAfterVerifyToFailed();
|
const redirectUrl = this.paymentService.getRedirectUrlAfterVerifyToFailed();
|
||||||
return res.redirect(302, redirectUrl);
|
return res.redirect(redirectUrl, 302);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user