refactor(billing): remove Stripe; payments are Payple (web) and Google Play (mobile)
Some checks failed
ci / 정본·보안·린트·타입·테스트 (push) Failing after 1m13s
ci / 워크스페이스 빌드 검증 (push) Has been skipped
ci / 모바일 린트·타입·Jest (push) Failing after 1m4s
ci / Supabase Edge Functions + Cloudflare Worker (push) Successful in 37s
ci / .NET API 서버 테스트 (push) Successful in 27s
deploy-site / deploy (push) Failing after 20s

Stripe is not used. Keeping its checkout, portal and webhook paths meant a
second payment provider, a second return-URL format and dead UI.

- Delete the stripe-checkout, stripe-portal and stripe-webhook functions and
  their config; billing-catalog serves Payple prices only, and the web parser
  rejects a catalog that still mixes in Stripe prices.
- Web: drop the Stripe checkout/portal buttons, provider toggle and return
  notices; billing shows Payple only. Past rows with provider='stripe' are
  still displayed ("Stripe (종료)") with a support contact instead of a portal.
- Desktop: delete the Stripe checkout modal, payment IPC channels, preload
  namespace and their types; "Remove ads with Pro" opens the web billing page
  via license.openBilling. Support/refund copy names Payple.
- billingUrl() loses the Stripe-only success/canceled result option; the
  Deno contract is regenerated.
- Migrations and the DB's accepted provider values are untouched (history).
- Docs and the backlog record the removal (MON-04, EXT-STRIPE-01, GAP-BILL-03).

Verified: typecheck (desktop/web/admin/api-client/mobile), contract:check,
deno check all functions, deno test 80/80, desktop 1478/1480 on the Electron
runtime (2 known environment failures), web and admin builds, release
metadata and mobile boundary self-tests, eslint on changed files.
This commit is contained in:
Yun Chan 2026-09-26 20:56:18 +09:00
parent 7224e43bfb
commit eedd127ea7
50 changed files with 97 additions and 2600 deletions

View file

@ -1,6 +1,7 @@
import type { SubscriptionTier } from '@d3ro/api-client'
export type WebBillingProvider = 'payple' | 'stripe'
/** 웹 결제사는 Payple(KRW) 하나다. Stripe는 2026-09-26 제거됐다. */
export type WebBillingProvider = 'payple'
export type BillingInterval = 'day' | 'week' | 'month' | 'year'
export interface BillingCatalogPrice {
@ -15,7 +16,7 @@ export interface BillingCatalog {
plans: Record<'pro' | 'pro_plus', BillingCatalogPrice[]>
}
const PROVIDERS = new Set<WebBillingProvider>(['payple', 'stripe'])
const PROVIDERS = new Set<WebBillingProvider>(['payple'])
const INTERVALS = new Set<BillingInterval>(['day', 'week', 'month', 'year'])
const PAID_TIERS = new Set(['pro', 'pro_plus'])
@ -30,7 +31,7 @@ export function parseBillingCatalog(value: unknown): BillingCatalog | null {
if (!rawPlan || typeof rawPlan !== 'object' || Array.isArray(rawPlan)) return null
const plan = rawPlan as { tier?: unknown; prices?: unknown }
if (typeof plan.tier !== 'string' || !PAID_TIERS.has(plan.tier) || seenTiers.has(plan.tier)) return null
if (!Array.isArray(plan.prices) || plan.prices.length > 2) return null
if (!Array.isArray(plan.prices) || plan.prices.length > PROVIDERS.size) return null
seenTiers.add(plan.tier)
const seenProviders = new Set<string>()
for (const rawPrice of plan.prices) {
@ -91,7 +92,5 @@ export function formatPlanCatalogPrice(
if (tier === 'free') return '무료'
if (!catalog) return null
const prices = catalog.plans[tier]
if (prices.length === 0) return null
if (prices.length === 1) return formatBillingPrice(prices[0])
return prices.map((price) => `${price.provider === 'payple' ? 'Payple' : 'Stripe'} ${formatBillingPrice(price)}`).join(' · ')
return prices.length === 0 ? null : formatBillingPrice(prices[0])
}

View file

@ -1,15 +1,10 @@
// apps/web/src/lib/web-app-url.ts
// 웹앱 안에서 쓰는 절대 URL·복귀 경로 헬퍼. 주소 정본은 @d3ro/core/web-urls 다.
//
// 결제사(Stripe·Payple)와 OAuth 는 절대 URL 을 요구한다. 운영은 d3ro.chanpaca.net/app,
// 결제사(Payple)와 OAuth 는 절대 URL 을 요구한다. 운영은 d3ro.chanpaca.net/app,
// 로컬 개발은 localhost:3000/app 이므로 origin 만 현재 브라우저 것으로 바꿔 끼운다.
import {
billingUrl,
PUBLIC_SITE_ORIGIN,
WEB_APP_BASE_PATH,
type BillingReturn
} from '@d3ro/core/web-urls'
import { billingUrl, PUBLIC_SITE_ORIGIN, WEB_APP_BASE_PATH } from '@d3ro/core/web-urls'
/** 로그인 뒤 돌아갈 경로를 proxy 가 (app) 레이아웃에 넘길 때 쓰는 요청 헤더. */
export const RETURN_PATH_HEADER = 'x-d3ro-return-path'
@ -39,7 +34,7 @@ export function appUrlFor(origin: string, path: string): string {
}
/** 브라우저에서 결제 페이지 절대 URL. 쿼리 형식은 core billingUrl() 을 그대로 따른다. */
export function browserBillingUrl(result?: BillingReturn): string {
const canonical = billingUrl(result ? { result } : {})
export function browserBillingUrl(): string {
const canonical = billingUrl()
return `${window.location.origin}${canonical.slice(PUBLIC_SITE_ORIGIN.length)}`
}