File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { BadRequestException , Injectable } from '@nestjs/common'
1+ import {
2+ BadRequestException ,
3+ Injectable ,
4+ MethodNotAllowedException
5+ } from '@nestjs/common'
26import { PaymentMethod , type User } from '@prisma/generated'
37import {
48 ConfirmationEnum ,
@@ -8,6 +12,7 @@ import {
812} from 'nestjs-yookassa'
913import { VatCodesEnum } from 'nestjs-yookassa/dist/interfaces/receipt-details.interface'
1014
15+ import { IS_DEV_ENV } from '@/common/utils'
1116import { PrismaService } from '@/infra/prisma/prisma.service'
1217import { HeleketService } from '@/libs/heleket/heleket.service'
1318
@@ -26,6 +31,9 @@ export class PaymentService {
2631 public async create ( dto : InitPaymentRequest , user : User ) {
2732 const { method } = dto
2833
34+ if ( ! IS_DEV_ENV )
35+ throw new MethodNotAllowedException ( 'Method not allowed' )
36+
2937 const payment = await this . prismaService . payment . create ( {
3038 data : {
3139 amount : this . SUBSCRIPTION_PRICE ,
You can’t perform that action at this time.
0 commit comments