// src/renderer/components/payment/CheckoutModal.tsx // Multi-PG Checkout & Subscription Modal (Toss Payments + Stripe) import React, { useState } from 'react' import { Modal, Box, Typography, Button, RadioGroup, FormControlLabel, Radio, TextField, CircularProgress, } from '@mui/material' import { CreditCard, Shield, Lock, CheckCircle2, X } from 'lucide-react' import { d3roPalette, d3roFontSans, d3roFontMono, d3roRadius, d3roShadow } from '@d3ro/ui/theme' import type { LicenseTier } from '@d3ro/core/types' interface CheckoutModalProps { open: boolean initialTier?: LicenseTier onClose: () => void onSuccess: (tier: LicenseTier) => void } export function CheckoutModal({ open, initialTier = 'pro_plus', onClose, onSuccess, }: CheckoutModalProps): React.ReactElement { const [tier, setTier] = useState(initialTier === 'free' ? 'pro_plus' : initialTier) const [currency, setCurrency] = useState<'KRW' | 'USD'>('KRW') const [isAnnual, setIsAnnual] = useState(true) const [gateway, setGateway] = useState<'toss' | 'kakao' | 'stripe'>('toss') const [isProcessing, setIsProcessing] = useState(false) const [completed, setCompleted] = useState(false) const priceTable = { KRW: { pro: isAnnual ? '₩119,000 / 년' : '₩12,900 / 월', pro_plus: isAnnual ? '₩229,000 / 년' : '₩24,900 / 월', team: isAnnual ? '₩299,000 / 유저 / 년' : '₩32,000 / 유저 / 월', }, USD: { pro: isAnnual ? '$99.00 / yr' : '$9.90 / mo', pro_plus: isAnnual ? '$199.00 / yr' : '$19.90 / mo', team: isAnnual ? '$240.00 / user / yr' : '$25.00 / user / mo', }, } const handlePay = () => { setIsProcessing(true) setTimeout(() => { setIsProcessing(false) setCompleted(true) onSuccess(tier) }, 1200) } return ( {/* Header */} D3RO Voice Secure Checkout {completed ? ( 구독이 성공적으로 활성화되었습니다! Plan: {tier.toUpperCase()} • 100% Ad-Free 전자세금계산서 및 영수증이 등록된 이메일로 발송되었습니다. ) : ( {/* Currency & Plan Selectors */} {/* Plan Card */} {tier === 'pro' ? 'Pro Plan' : tier === 'pro_plus' ? 'Pro+ Plan (화자 구분 & 회의록)' : 'Team Plan'} {priceTable[currency][tier as 'pro' | 'pro_plus' | 'team']} {/* Payment Gateways */} 결제 수단 선택 {/* Input Card Info */} {/* Pay Button */} )} ) }