feat(can-charge): 이롬넷(Payverse) 통합결제 추가

This commit is contained in:
Yu Sung
2025-10-01 01:48:18 +09:00
parent e62c89d7bc
commit d045722b8d
13 changed files with 639 additions and 72 deletions

View File

@@ -0,0 +1,31 @@
//
// Untitled.swift
// SodaLive
//
// Created by klaus on 9/29/25.
//
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<!-- PayVerse SDK -->
<script src="https://ui.payverseglobal.com/js/payments.js"></script>
</head>
<body>
<script>
// 안드로이드에서 JSON 문자열을 넘기면 이 함수를 호출
function startPay(payloadJson) {
try {
const p = JSON.parse(payloadJson);
// 즉시 실행: 페이지가 열리자마자 결제창 시작
window.payVerse.requestUI(p);
} catch (e) {
console.error('startPay error', e);
alert('결제 초기화에 실패했습니다.');
}
}
</script>
</body>
</html>

View File

@@ -0,0 +1,58 @@
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<title>PayVerse Starter</title>
<style>
html, body { margin:0; padding:0; height:100%; background:#111; color:#fff; font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
#app { padding:16px; }
#back { position:fixed; top:16px; left:16px; background:#333; color:#fff; border:none; padding:10px 14px; border-radius:8px; }
.log { font-size:12px; opacity:.8; white-space:pre-wrap; word-break:break-word; }
</style>
<!-- PayVerse SDK -->
<script src="https://ui-snd.payverseglobal.com/js/payments.js"
onload="console.log('✅ PayVerse SDK loaded');"
onerror="console.error('❌ PayVerse SDK failed to load');"></script>
</head>
<body>
<div id="app">
<h2>PayVerse Starter</h2>
<p>결제 모듈 로드를 준비중입니다...</p>
<div class="log" id="log"></div>
</div>
<script>
// 간단한 로깅 유틸 (iOS 콘솔 브릿지와 함께 동작)
(function(){
var el = document.getElementById('log');
var old = console.log;
console.log = function(){
var msg = Array.prototype.slice.call(arguments).join(' ');
if (el) { el.textContent += msg + "\n"; }
try { window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.console && window.webkit.messageHandlers.console.postMessage(msg); } catch(e) {}
old && old.apply(console, arguments);
};
})();
// 네이티브에서 JSON 문자열을 넘기면 이 함수를 호출
function startPay(payloadJson) {
try {
console.log('startPay called with payload:', payloadJson);
var p = JSON.parse(payloadJson);
if (!window.payVerse || !window.payVerse.requestUI) {
console.log('❌ payVerse SDK not ready');
alert('결제 모듈 초기화 중입니다. 잠시 후 다시 시도해주세요.');
return;
}
console.log('▶ calling payVerse.requestUI...');
window.payVerse.requestUI(p);
} catch (e) {
console.log('❌ startPay error:', e && e.message ? e.message : e);
alert('결제 초기화에 실패했습니다.');
}
}
</script>
</body>
</html>