diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index e30ae40c..fb8244f0 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -94,6 +94,8 @@ jobs: echo "FIREBASE_ADMIN_SDK_PRIVATE_KEY=${{ secrets.FIREBASE_ADMIN_SDK_PRIVATE_KEY }}" >> .env echo "FIREBASE_ADMIN_SDK_CLIENT_EMAIL=${{ secrets.FIREBASE_ADMIN_SDK_CLIENT_EMAIL }}" >> .env + echo "MIN_PAYMENT_AMOUNT=${{ secrets.MIN_PAYMENT_AMOUNT }}" >> .env + cat .env # "node_modules/*" "coverage/*" "src/*" "test/*" "README.md" "*.git*" "/common" "tsconfig.json" "tsconfig.build.json" "nest-cli.json" 파일 제외 후 레퍼지토리 압축 diff --git a/src/payments/services/payments.service.ts b/src/payments/services/payments.service.ts index 9c5a2a84..4a701a14 100644 --- a/src/payments/services/payments.service.ts +++ b/src/payments/services/payments.service.ts @@ -81,6 +81,7 @@ export class PaymentsService { private cancellationAbsoluteTime: number; private passRefundableDaysPeriod: number; private paymentTimeOutSec: number; + private minPaymentAmount: number; constructor( private readonly configService: ConfigService, @@ -106,6 +107,8 @@ export class PaymentsService { this.paymentTimeOutSec = this.configService.get( 'PAYMENT_TIME_OUT_SEC', ); + this.minPaymentAmount = + this.configService.get('MIN_PAYMENT_AMOUNT'); this.logger.log('PaymentsService Init'); } @@ -447,7 +450,7 @@ export class PaymentsService { price -= coupon.discountPrice; } - return Math.max(0, price); + return Math.max(this.minPaymentAmount, price); }; const { coupon, stackableCoupon } = coupons;