|
|
@@ -25,6 +25,8 @@
|
|
|
<script type="text/javascript" th:src="${@environment.getProperty('pg.kcp.js.url')}" src=""></script>
|
|
|
<script type="text/javascript" src="/biz/payment.js"></script>
|
|
|
<script type="text/javascript" src="//wcs.naver.net/wcslog.js"></script>
|
|
|
+ <script type="text/javascript" th:src="${@environment.getProperty('naverPay.button.mobile.js.url')}" src="" charset="UTF-8"></script>
|
|
|
+ <form id="nPayForm" name="nPayForm"></form>
|
|
|
|
|
|
<!-- container -->
|
|
|
<div id="container" class="container od">
|
|
|
@@ -43,6 +45,84 @@
|
|
|
<div id="cartAjaxList" class="cont_body">
|
|
|
<!-- 장바구니 내용 -->
|
|
|
</div>
|
|
|
+ <th:block th:if="${sessionInfo != null and (sessionInfo.custId == 'xodud1202' or sessionInfo.custId == 'jsh77b' or sessionInfo.custId == 'card007')}">
|
|
|
+ <div style="margin-top:10px;">
|
|
|
+ <th:block th:with="buttonKey=${@environment.getProperty('naverPay.button.key')}">
|
|
|
+ <script type="text/javascript" th:src="${@environment.getProperty('naverPay.button.pc.js.url')}" src="" charset="UTF-8"></script>
|
|
|
+
|
|
|
+ <script th:inline="javascript">
|
|
|
+ if(!wcs_add) var wcs_add = {};
|
|
|
+ wcs_add["wa"] = [[${@environment.getProperty('naverPay.common.certification.key')}]];
|
|
|
+ wcs.inflow("style24.com");
|
|
|
+ wcs_do();
|
|
|
+ </script>
|
|
|
+
|
|
|
+ <script type="text/javascript">
|
|
|
+ /*버튼설정*/
|
|
|
+ naver.NaverPayButton.apply({
|
|
|
+ BUTTON_KEY : "[[${buttonKey}]]", // 네이버페이에서 제공받은 버튼 인증 키 입력
|
|
|
+ TYPE : "C", // 버튼 모음 종류 설정
|
|
|
+ COLOR : 1, // 버튼 모음의 색 설정
|
|
|
+ COUNT : 1, // 버튼 개수 설정. 구매하기 버튼만 있으면(장바구니 페이지) 1, 찜하기 버튼도 있으면(상품 상세 페이지) 2를 입력.
|
|
|
+ ENABLE : "Y", // 품절 등의 이유로 버튼 모음을 비활성화할 때에는 "N" 입력
|
|
|
+ BUY_BUTTON_HANDLER : buy_nc, // 구매하기 버튼 이벤트 Handler 함수 등록, 품절인 경우 not_buy_nc 함수 사용
|
|
|
+ "":""
|
|
|
+ });
|
|
|
+
|
|
|
+ /*네이버구매하기*/
|
|
|
+ function buy_nc() {
|
|
|
+ let cartSqArr = []
|
|
|
+ $("#cartListForm input[name=cartSqArr]:checked").each(function() {
|
|
|
+ cartSqArr.push($(this).val());
|
|
|
+ });
|
|
|
+
|
|
|
+ buy_nc_req(cartSqArr);
|
|
|
+ }
|
|
|
+
|
|
|
+ function buy_nc_req(cartSqArr) {
|
|
|
+ let data = { cartSqArr : cartSqArr
|
|
|
+ , backUrl : location.href
|
|
|
+ , goodsUrl : _PAGE_GOODS_DETAIL
|
|
|
+ };
|
|
|
+ let jsonData = JSON.stringify(data);
|
|
|
+
|
|
|
+ $.ajax( {
|
|
|
+ type : "POST",
|
|
|
+ url : "/pg/nPayReq",
|
|
|
+ dataType : 'json',
|
|
|
+ data : jsonData,
|
|
|
+ beforeSend : function(xhr, settings) {
|
|
|
+ xhr.setRequestHeader("AJAX" , "true");
|
|
|
+ xhr.setRequestHeader('Accept' , 'application/json');
|
|
|
+ xhr.setRequestHeader('Content-Type' , 'application/json');
|
|
|
+ },
|
|
|
+ error: function(xhr, status, error) {
|
|
|
+ mcxDialog.alert(status + '; ' + error);
|
|
|
+ },
|
|
|
+ success : function(result) {
|
|
|
+ if (result.state == "sucess") {
|
|
|
+ enp('create', 'conversion', 'is24', { device: 'W', paySys: 'naverPay' }); // 모비온 네이버주문형 클릭시
|
|
|
+ window.open('about:blank', 'popupView');
|
|
|
+ document.nPayForm.target = 'popupView';
|
|
|
+ document.nPayForm.action = result.npayOrderUrl + "/" + result.orderKey + "/" + result.resultNo;
|
|
|
+ document.nPayForm.submit();
|
|
|
+ } else {
|
|
|
+ mcxDialog.alert(result.message);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ <!-- 구매불가 -->
|
|
|
+ function not_buy_nc() {
|
|
|
+ mcxDialog.alert("죄송합니다. 네이버페이로 구매가 불가한 상품입니다.");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //]]>
|
|
|
+ </script>
|
|
|
+ </th:block>
|
|
|
+ </div>
|
|
|
+ </th:block>
|
|
|
</div>
|
|
|
|
|
|
<th:block th:if="${cartSize>0}">
|
|
|
@@ -183,7 +263,7 @@
|
|
|
dataType : 'html',
|
|
|
success : function(result) {
|
|
|
if (result != null) {
|
|
|
- $("#cartListForm").remove();
|
|
|
+ $("#cartListForm").remove();
|
|
|
$("#cartAjaxList").html(result);
|
|
|
}
|
|
|
}
|