Conversation
#491 Phase 1 — 정산 정책 안내(수수료 10% + VAT 1%)에 코드 정렬 + 후속 지급이체 자동화에 사용할 SettlementAccount.billing_tran_id 컬럼 추가. ### 수수료 계산 정정 - src/purchases/utils/fee.ts 신규 — COMMISSION_RATE(0.1), VAT_RATE_ON_COMMISSION(0.1), TOTAL_DEDUCT_RATE(0.11), calculateSettlementFee() - purchase.complete.service.ts / purchase.webhook.service.ts에서 두 곳 동일 패턴 하드코딩(FEE_RATE=0.1) 제거 → calculateSettlementFee 재사용 - 결과: 판매가 10,000원 기준 정산금 9,000 → 8,900으로 정정 (VAT 100원 추가 공제) - 기존 Settlement 행은 정정하지 않음 (불가역 정책) ### Prisma 스키마 - SettlementAccount.billing_tran_id VARCHAR(64) NULL 컬럼 추가 - 마이그레이션: 20260523180000_add_billing_tran_id_and_fee_note (dev DB 적용 완료) - 컬럼은 본 PR에선 미사용. 다음 PR (Payple 정산지급대행 계좌인증 통합)에서 값 저장 다음 단계 (#491 후속 PR): - utils/payple-payout.ts 신규 + verify-account 흐름에 빌링키 발급 통합 - 이체 대기/실행 유틸 + Webhook 수신 - 정산 사이클 cron (매월 15일 KST, 최소 1만원, 음수 이월)
#491 후속 작업(지급이체 자동화/환불 시 빌링키 해지 등)에서 사용할 Payple 빌링키 라이프사이클 인프라. 본 PR에서는 유틸만 추가, 외부 endpoint 노출 없음. - fetchBillingKeyInfo(payerId): PUSERINFO 인증 → 조회. 카드 마스킹 정보 반환 - deleteBillingKey(payerId): PUSERDEL 인증 → 해지 - Auth Redis 25분 캐시 (PCD_PAY_WORK별 키 분리 — PUSERINFO/PUSERDEL) - 캐시에는 authKey/payHost/payUrl만, cstId/custKey는 매 호출 env 직접 로드 - 요청/응답 로그에 redactPaypleLog 적용 - 환경변수 PAYPLE_BILLING_AUTH_PATH (기본 /php/auth.php, sandbox 검증 후 정정)
…lumn [FEAT] 정산 수수료에 VAT 1% 합산 + 정산지급대행 빌링키 컬럼 추가 (#491 Phase 1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 기능 설명
📌 구현 내용
📌 구현 결과
📌 논의하고 싶은 점