<!DOCTYPE html>
<html lang="en" class="cont-center">
<head>
	<title>in case Product Purchase impossible</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta name="format-detection" content="telephone=no">

	<meta name="title" content="" />
	<meta name="description" content=""/>
	<meta name="keywords" content=""/>

	<link type="text/css" rel="stylesheet" href="/gasp/payplanet/common/css/common.css" />
	<link type="text/css" rel="stylesheet" href="/gasp/payplanet/common/css/item_guide.css" />
	<link type="text/css" rel="stylesheet" href="/gasp/payplanet/common/css/layout_guide.css" />
	<link type="text/css" rel="stylesheet" href="/gasp/payplanet/common/css/popup_guide.css" />
	<link type="text/css" rel="stylesheet" href="/gasp/payplanet/en/css/layout.css" />
	<link type="text/css" rel="stylesheet" href="/gasp/payplanet/en/css/queries.css" />
	<link type="text/css" rel="stylesheet" href="/gasp/payplanet/en/css/layout_popup.css" />

	<script type="text/javascript" src="/gasp/payplanet/js/jquery.min.js" charset="utf-8"></script>
	<script type="text/javascript" src="/gasp/payplanet/js/ui.common.js" charset="utf-8"></script>
	<script type="text/javascript" src="/gasp/payplanet/js/ui.common.popup.js" charset="utf-8"></script>
	<script type="text/javascript" src="/gasp/payplanet/js/ui.popup.js" charset="utf-8"></script>

    <script>
        jQuery(document).ready(function ($) {

            jQuery('#endPayment').click(function () {
                //serviceErrorJSON();
                sendResultWithJson();
            });

            jQuery('#closePopup').click(function () {
                sendClose();
            });

        });

        function sendClose() {
            var res = new Object();
            res.responseCode = 9;
            res.purchaseDetail = null;
            res.billingKey = null;

            var jsonString = JSON.stringify(res);
            console.log('RESULT JSON = ' + jsonString);

            window.IAPLibrary.onPaymentResult('', '');
        }

        function onSystemEvent(eventJson) {
            var back = JSON.parse(eventJson);

            if (back.value == 'back') {
                sendResultWithJson();
            }

        }

        function sendResultWithJson() {
            var webResultCode = null;
            var orderId = null;
            var packageName = null;
            var productId = null;
            var purchaseTime = null;
            var purchaseId = null;
            var developerPayload = null;
            var signature = null;

            var res = new Object();
            if (webResultCode == 0) {
                var pd = new Object();
                pd.orderId = orderId;
                pd.packageName = packageName;
                pd.productId = productId;
                pd.purchaseTime = Number(purchaseTime);
                pd.purchaseId = purchaseId;
                pd.developerPayload = developerPayload;

                res.purchaseDetail = pd;
                res.purchaseSignature = signature;
            } else {
                if (webResultCode == undefined || webResultCode == "") {
                    res.responseCode = 9;
                } else {
                    res.responseCode = webResultCode;
                }
                res.purchaseDetail = null;
            }
            res.billingKey = null;

            var jsonString = JSON.stringify(res);
            console.log('RESULT JSON = ' + jsonString);

            window.IAPLibrary.onPaymentResult('', jsonString);
        }

    </script>
</head>
<body class="payment">

<div id="wrap">
	<!-- payment-state-header Start -->
	<div id="header" class="payment-state-header-wrap">
		<div class="payment-state-inner">
			<h1>Sandbox test</h1>
		</div>
	</div>
	<!-- payment-state-header End -->
	
	<!-- container Area -->
	<div id="container" class="pay-failed-ty2">
		<!-- payment-state-img Start -->
		<section class="payment-state-img-wrap window-center-align"> <!-- 컨텐츠 가운데 정렬시 class: window-center-align 추가 -->
			<div class="payment-state-img-inner payment-inner-type2">
				<em>
					<img src="/gasp/payplanet/common/images/icon/pic_pay_failed.png" alt="">
				</em>
				<div class="payment-state-tit">Sandbox test</div>
				<div class="payment-state-txt">This is an unusual request.<br />Please verify the status of the call.</div>
				<div class="payment-state-btn">	
					<a href="#none">OK</a>
				</div>
			</div>
		</section>
		<!-- payment-state-img End -->
	</div>
	<!-- // container Area -->
	
</div>

<!-- payment button -->
<div class="payment-bottom-submit pay-failed">
	<!-- payment-ok-btn Start -->
	<section class="payment-ok-btn">
		<div class="ok-module">
			<a href="javascript:" id="endPayment">
				<span class="fixed-ui-text"><em class="last-price"></em>OK</span>
			</a>
		</div>
	</section>
	<!--// payment-ok-btn End -->
</div>
<!-- // payment button -->
					
</body>
</html>