update payos webhook
This commit is contained in:
35
src/Payos/payos.controller.ts
Normal file
35
src/Payos/payos.controller.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import {
|
||||
Controller,
|
||||
Get,
|
||||
Post,
|
||||
Put,
|
||||
Delete,
|
||||
Param,
|
||||
Body,
|
||||
Headers,
|
||||
} from '@nestjs/common';
|
||||
import { PayosService } from './payos.service';
|
||||
import { ApiTags, ApiOperation } from '@nestjs/swagger';
|
||||
|
||||
@ApiTags('Payos')
|
||||
@Controller('payos')
|
||||
export class PayosController {
|
||||
constructor(private readonly payosService: PayosService) {}
|
||||
|
||||
// webhook
|
||||
@Post('webhook')
|
||||
@ApiOperation({ summary: 'Webhook for Payos' })
|
||||
async webhook(
|
||||
@Body() body: any,
|
||||
@Headers('x-payos-signature') signature: string,
|
||||
) {
|
||||
return this.payosService.webhook(body, signature);
|
||||
}
|
||||
|
||||
// ping webhook
|
||||
@Get('webhook')
|
||||
@ApiOperation({ summary: 'Ping webhook' })
|
||||
async ping() {
|
||||
return this.payosService.ping();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user