Skip to content

Commit

Permalink
Fix: 최소 결제 금액 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Kimsoo0119 committed May 29, 2024
1 parent 419547c commit 3186ca9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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" 파일 제외 후 레퍼지토리 압축
Expand Down
5 changes: 4 additions & 1 deletion src/payments/services/payments.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export class PaymentsService {
private cancellationAbsoluteTime: number;
private passRefundableDaysPeriod: number;
private paymentTimeOutSec: number;
private minPaymentAmount: number;

constructor(
private readonly configService: ConfigService,
Expand All @@ -106,6 +107,8 @@ export class PaymentsService {
this.paymentTimeOutSec = this.configService.get<number>(
'PAYMENT_TIME_OUT_SEC',
);
this.minPaymentAmount =
this.configService.get<number>('MIN_PAYMENT_AMOUNT');

this.logger.log('PaymentsService Init');
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3186ca9

Please sign in to comment.