feat: 업그레이드 화면 인앱 결제 — Android 구매, PC는 앱 유도
CI / build (push) Failing after 15m11s

- billingApi(products/verifyGoogle), native/billing(테스트 구매 토큰 생성)
- Android 앱: 상품(월간/연간) 구매 버튼 → 검증 → 프로필 갱신
- PC(웹/데스크톱): 구매 대신 앱 다운로드 안내
- 프리미엄 이용 중이면 만료일 표시

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ByungCheol
2026-06-28 15:12:59 +09:00
parent ce5cefe64a
commit 823bdcafcf
3 changed files with 187 additions and 3 deletions
+26
View File
@@ -0,0 +1,26 @@
import { Capacitor } from '@capacitor/core'
// 인앱 결제(Google Play) 헬퍼.
// 결제는 Android 앱에서만 가능 — 웹/데스크톱(PC)은 앱 다운로드로 유도한다.
export const billing = {
// Capacitor 네이티브(안드로이드) 여부
isNative() {
return Capacitor.isNativePlatform()
},
/**
* 상품 구매 → 구매 토큰 반환.
* 스캐폴드(테스트): 실제 스토어 호출 없이 test- 토큰을 만들어 백엔드 검증 흐름을 태운다.
*
* TODO(실연동): Google Play Billing 플러그인(cordova-plugin-purchase 등)을 연결해
* 실제 구매 후 purchaseToken/orderId 를 받아 반환하도록 교체.
*/
async purchase(productId) {
const rand = (globalThis.crypto?.randomUUID?.() || `${Date.now()}-${Math.floor(Math.random() * 1e9)}`)
return {
productId,
purchaseToken: `test-${productId}-${rand}`,
orderId: `TEST-${rand}`,
}
},
}