59 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			59 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<!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>
 |