verify payment

This commit is contained in:
2025-12-03 12:56:10 +03:30
parent 8a2390ea8e
commit 5af26445fa
4 changed files with 170 additions and 3 deletions
@@ -5,6 +5,7 @@ import { AdminAuthGuard } from 'src/modules/auth/guards/adminAuth.guard';
import { PaymentMethodService } from '../services/payment-method.service';
import { CreatePaymentMethodDto } from '../dto/create-payment-method.dto';
import { UpdatePaymentMethodDto } from '../dto/update-payment-method.dto';
import { VerifyPaymentDto } from '../dto/verify-payment.dto';
import { RestId } from 'src/common/decorators';
import { AuthGuard } from 'src/modules/auth/guards/auth.guard';
@@ -25,6 +26,18 @@ export class PaymentsController {
return this.paymentMethodService.findByRestaurant(restId);
}
@Post('public/payments/verify')
@ApiOperation({ summary: 'Verify a payment' })
@ApiBody({ type: VerifyPaymentDto })
@ApiNotFoundResponse({ description: 'Payment not found' })
verifyPayment(@Body() verifyPaymentDto: VerifyPaymentDto) {
return this.paymentsService.verifyPayment(
verifyPaymentDto.authority,
verifyPaymentDto.amount,
verifyPaymentDto.orderId,
);
}
// @UseGuards(AdminAuthGuard)
// @ApiBearerAuth()
// @Get('admin/payments')