feat(server+web+desktop): Phase 3.2-B Payple 결제 연동 + 대시보드 Premium 상태 표시

Payple PG 연동:
- _shared/payple.ts: Payple API 래퍼 (auth/billing/cancel/deleteBillingKey)
- payple-checkout Edge Function: 빌링키 결제 + 구독 활성화
- payple-webhook Edge Function: 결제완료/취소 이벤트
- payple-manage Edge Function: 구독 취소 (빌링키 해지)
- DB migration: payment_provider + payple_payer_id + payple_pay_oid
- 웹 billing 페이지: Payple JS SDK 결제창 + 관리 버튼 (Stripe 대체)
- Electron LicenseModal: shell.openExternal → 웹 결제 페이지

대시보드 Premium 상태:
- CrtDisplay services에 PREMIUM LLM LED 추가
- 백엔드 인디케이터 카드 (Local/Premium) + 티어 카드
- 사용량 섹션: 전 티어 표시 + 모델별 Premium 쿼터
- 12개 locale × 14개 i18n 키
This commit is contained in:
윤찬 2026-04-12 19:18:40 +09:00
parent b8cb665264
commit c9baf031c9
27 changed files with 1318 additions and 98 deletions

View file

@ -1,7 +1,7 @@
// src/main/ipc/license-handlers.ts
// Phase 11: 라이센스 IPC 핸들러
import { ipcMain, BrowserWindow } from 'electron'
import { ipcMain, BrowserWindow, shell } from 'electron'
import { IPC_CHANNELS } from '@d3ro/core/ipc-channels'
import { ipcSuccess, ipcError, ErrorCode } from '@d3ro/core/errors'
import { getLicenseService } from '../services/LicenseService'
@ -97,4 +97,16 @@ export function registerLicenseHandlers(): void {
return ipcError(ErrorCode.UnknownError, `Tier comparison failed: ${err}`)
}
})
ipcMain.handle(IPC_CHANNELS.LICENSE.OPEN_BILLING, async (_event, params: { tier: 'pro' | 'pro_plus' }) => {
try {
// Phase 3.2-B: 웹 결제 페이지 열기
// 프로덕션: https://d3ro.dev/billing, 개발: NEXT_PUBLIC_SITE_URL 참조
const billingUrl = `https://d3ro.dev/billing?tier=${params.tier}`
await shell.openExternal(billingUrl)
return ipcSuccess(undefined)
} catch (err) {
return ipcError(ErrorCode.UnknownError, `Failed to open billing: ${err}`)
}
})
}