Procházet zdrojové kódy

Merge remote-tracking branch 'origin/xodud1202' into develop

xodud lee před 5 roky
rodič
revize
c16dcebf58

+ 0 - 2
src/main/java/com/style24/persistence/mybatis/shop/TsfCart.xml

@@ -352,7 +352,6 @@
 							 AND	NOT_APPLY.TMTB_SQ IS NULL
 							 AND	T.DEL_YN = 'N'
 							 AND	TAG.DEL_YN = 'N'
-							 AND	C.CART_GB = 'G026_BC'
 							 AND	G.GOODS_STAT = 'G008_90'
 							 AND	G.SELF_MALL_YN = 'Y'
 							 <if test="cartSqArr != null and cartSqArr.length > 0">
@@ -378,7 +377,6 @@
 				AND	T.DEL_YN = 'N'
 				AND	T.TMTB_ST_DT <![CDATA[<=]]> NOW()
 				AND	T.TMTB_ED_DT >= NOW()
-				AND	C.CART_GB = 'G026_BC'
 				AND	G.GOODS_STAT = 'G008_90'
 				AND	G.SELF_MALL_YN = 'Y'
 				<if test="cartSqArr != null and cartSqArr.length > 0">

+ 4 - 2
src/main/resources/config/application-locd.yml

@@ -69,8 +69,10 @@ pg:
         js.url: https://testpay.kcp.co.kr/plugin/payplus_web.jsp
         server: false
         site:
-            cd: U3476
-            key:
+            #cd: U3476
+            #key:
+            cd: T0000
+            key: 3grptw1.zW0GSo4PQdaGvsF__
             name: ISTYLE TEST
         log.level: 3
         module.type: 01

+ 1 - 0
src/main/webapp/WEB-INF/views/mob/order/OrderFormMob.html

@@ -24,6 +24,7 @@
 <!-- payment.js -->
 <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="/ux/plugins/approval_key.js"></script>
 
 <form id="order_info" name="order_info" method="post" action="/order/pay/result/response" ></form>
 

+ 1 - 3
src/main/webapp/WEB-INF/views/mob/pg/kcpOrderMob.html

@@ -4,7 +4,6 @@
 <meta http-equiv="Pragma" content="no-cache">
 <meta http-equiv="Expires" content="-1">
 
-<form id="order_info" name="order_info" method="post" action="/order/pay/result/response" >
 	<!-- 페이코 송부 정보 -->
 	<th:block th:if="${!#strings.isEmpty(payment.paycoDirect)}">
 		<input type="hidden" name="payco_direct"	th:value="${payment.paycoDirect}" />
@@ -15,7 +14,7 @@
 	<input type="hidden" name="pgGb"			th:value="${payment.pgGb}" />
 	<input type="hidden" name="payMeans"		th:value="${payment.payMeans}" />
 
-	<input type="hidden" name="encoding_trans"	value="UTF 8" />	<!-- 추가 인코딩 네임은 대문자 -->
+	<input type="hidden" name="encoding_trans"	value="UTF-8" />	<!-- 추가 인코딩 네임은 대문자 -->
 
 	<input type="hidden" name="req_tx"			th:value="${payment.reqTx}" />		<!-- 요청의 종류를 구분하는 변수 결제요청페이지의 경우 ‘pay’로 설정 -->
 	<input type="hidden" name="shop_name"		th:value="${payment.siteName}" />	<!-- 상점이름(영문으로 작성권장) -->
@@ -105,5 +104,4 @@
 	<!-- 네이버페이 관련 정보 -->
 	<input type="hidden" name="reserveId" th:value="${payment.reserveId}"/>
 	<input type="hidden" name="paymentId" value=""/>
-</form>
 </html>

+ 27 - 1
src/main/webapp/WEB-INF/views/web/goods/GoodsDetailFormWeb.html

@@ -431,7 +431,7 @@
 												cfnAddCart(compsList);
 											} else {
 												// TODO 세트상품 추가 예정
-												alert("개발 중");
+												//alert("개발 중");
 												let itemCds = [];
 												let optCds = [];
 												$("#cartForm .area_desc .option_box .opt_set_select .item_opt2 .list>li").each(function() {
@@ -441,6 +441,12 @@
 													}
 												});
 
+												let goodsList = {
+													cartCompsList : new Array()
+												}
+												let cartGoodsList = [];
+												let compsList = [];
+
 												for(let i = 0 ; i < itemCds.length ; i++) {
 													if (!itemCds[i]) {
 														mcxDialog.alert("구성 상품정보가 존재하지 않습니다. 새로고침 후 다시 시도해주세요.");
@@ -450,7 +456,27 @@
 														mcxDialog.alert("구성 상품 옵션을 확인 할 수 없습니다. 새로고침 후 다시 시도해주세요.");   /*옵션*/
 														return false;
 													}
+
+
+
+													let obj = new Object;
+													obj.goodsCd = goodsCd;
+													obj.itemCd = itemCds[i];
+													obj.optCd = optCds[i];
+													obj.goodsQty = goodsQty;
+													obj.goodsType = goodsType;
+													obj.cartGb = "N";
+													obj.afLinkCd =$("#cartForm  input[name=afLinkCd]").val();
+													obj.ithrCd =$("#cartForm  input[name=ithrCd]").val();
+													obj.contentsLoc =$("#cartForm  input[name=contentsLoc]").val();
+													obj.planDtlSq = $("#cartForm  input[name=planDtlSq]").val();
+													compsList.push(obj);
 												}
+
+												goodsList.cartCompsList = compsList;
+												cartGoodsList.push(goodsList);
+
+												cfnAddCart(cartGoodsList);
 											}
 
 											return false;

+ 182 - 0
src/main/webapp/ux/plugins/approval_key.js

@@ -0,0 +1,182 @@
+    var ajax_flag = true;
+    var req01_AJAX;
+    var PayUrl="";
+
+    function initRequest()
+    {
+        if ( window.XMLHttpRequest )
+        {
+            return new XMLHttpRequest();
+        } else if ( window.ActiveXObject )
+        {
+            return new ActiveXObject( "Microsoft.XMLHTTP" );
+        }
+    }
+
+    function sendRequest( url )
+    {
+        req01_AJAX = null;
+        req01_AJAX = initRequest();
+
+        if ( req01_AJAX )
+        {
+            req01_AJAX.onreadystatechange = process_AJAX;
+            req01_AJAX.open( "POST", url, true );
+            req01_AJAX.send( null );
+        }
+    }
+
+    function kcp_AJAX()
+    {
+        // 해당 소스는 jQuery를 사용 하지 않는 업체에서도 작동 할수 있도록 구현되었습니다.
+        // 이 부분은 javascript로 구현시 jQuery를 이용하면 더욱 쉽게 구현 할수 있습니다. 
+        // 또는
+        // javascript를 통한 ajax 통신을 할 필요 없이 소스내에 order_approval.jsp를 연동해서 사용 하셔도 관계 없으며
+        // 제공되는 jar 파일에 직접 전달된 데이터를 사용할수 있도록 method가 구현 되어 있습니다.
+        if(ajax_flag)
+        {
+            var url    = "order_approval.jsp";
+            var form = document.order_info;
+            var params = "?site_cd=" + form.site_cd.value
+                       + "&ordr_idxx=" + form.ordr_idxx.value
+                       + "&good_mny=" + form.good_mny.value
+                       + "&pay_method=" + form.pay_method.value
+                       + "&escw_used=" + form.escw_used.value
+                       + "&good_name=" + form.good_name.value
+                       + "&response_type=" + form.response_type.value
+                       + "&Ret_URL=" + form.Ret_URL.value;
+            sendRequest( url + params );
+            
+            ajax_flag = false;
+        }
+        else
+        {
+            alert("통신 중입니다. 잠시만 기다려 주세요.");
+        }
+            
+    }
+
+    function process_AJAX()
+    {
+        if ( req01_AJAX.readyState == 4 ) //READY_STATE_COMPLETE = 4
+        {
+            if ( req01_AJAX.status == 200 )
+            {
+                if ( req01_AJAX.responseText != null )
+                {
+                    // 해당 소스는 jQuery를 사용 하지 않는 업체에서도 작동 할수 있도록 구현되었습니다.
+                    // 이 부분은 javascript로 구현시 jQuery를 이용하면 더욱 쉽게 구현 할수 있습니다. 
+                    // 또는
+                    // javascript를 통한 ajax 통신을 할 필요 없이 소스내에 order_approval.jsp를 연동해서 사용 하셔도 관계 없으며
+                    // 제공되는 jar 파일에 직접 전달된 데이터를 사용할수 있도록 method가 구현 되어 있습니다.
+                    try
+                    {
+                        var form = document.order_info;
+                        
+                        if( form.response_type.value == "JSON" )
+                        {
+                            StateChangeForJSON( req01_AJAX ); // JSON 방식일 경우
+                        }
+                        else if( form.response_type.value == "XML" )
+                        {
+                            StateChangeForXML( req01_AJAX ); // XML 방식일 경우
+                        }
+                        else if( form.response_type.value == "TEXT" || form.response_type.value == "" )
+                        {
+                            StateChangeForText( req01_AJAX ); // TEXT 방식일 경우
+                        }
+                    }
+                    catch( e )
+                    {
+                        StateChangeForText( req01_AJAX ); // TEXT 방식일 경우
+                    }
+                }
+            }
+            else
+            {
+                ajax_flag=true;
+                alert( req01_AJAX.responseJSON );
+            }
+        }
+    }
+    
+    function StateChangeForText( req )
+    {
+        var txt = req01_AJAX.responseText.split( ":" );
+
+        if( txt[0].replace(/^\s*/,'').replace(/\s*$/,'') == '0000' )
+        {
+            document.getElementById( "approval" ).value = txt[1].replace(/^\s*/,'').replace(/\s*$/,'');
+            // 아래 alert는 삭제 해도됨
+            alert("성공적으로 거래가 등록 되었습니다.");
+            PayUrl = decodeURIComponent( txt[2].replace(/^\s*/,'').replace(/\s*$/,'') );
+            
+            document.getElementById( "traceNo" ).value = txt[3].replace(/^\s*/,'').replace(/\s*$/,'');
+            
+            if( txt.length == 6 )
+            document.getElementById( "PayUrl"  ).value = txt[5].replace(/^\s*/,'').replace(/\s*$/,'');
+            
+            call_pay_form();
+        }
+        else
+        {
+            var res_msg = txt[2].replace(/^\s*/,'').replace(/\s*$/,'');
+            
+            ajax_flag=true;
+            alert("실패 되었습니다.[" + res_msg + "]");
+        }
+    }
+    
+    function StateChangeForXML( req )
+    {
+        var xmlDoc = ( new DOMParser() ).parseFromString( req.responseText.replace(/^\s*/,'').replace(/\s*$/,''), "text/xml" ).documentElement;
+        
+        var x = xmlDoc.getElementsByTagName( "data" );
+        
+        if( x[0].getElementsByTagName( "Code" )[0].childNodes[0].nodeValue == '0000' )
+        {
+            document.getElementById( "approval" ).value = x[0].getElementsByTagName( "approvalKey" )[0].childNodes[0].nodeValue;
+            // 아래 alert는 삭제 해도됨
+            alert("성공적으로 거래가 등록 되었습니다.");
+            PayUrl = x[0].getElementsByTagName( "PayUrl" )[0].childNodes[0].nodeValue;
+            
+            document.getElementById( "traceNo" ).value = x[0].getElementsByTagName( "traceNo"     )[0].childNodes[0].nodeValue;
+            
+            try{
+                document.getElementById( "PayUrl"  ).value = x[0].getElementsByTagName( "request_URI" )[0].childNodes[0].nodeValue;
+            }catch(e){}
+            
+            call_pay_form();
+        }
+        else
+        {
+            ajax_flag=true;
+            
+            alert("실패 되었습니다.[" + x[0].getElementsByTagName( "Message" )[0].childNodes[0].nodeValue + "]");
+        }
+    }
+    
+    
+    function StateChangeForJSON( xmlHttpRequest )
+    {
+        var json = eval('('+ xmlHttpRequest.responseText +')');
+        
+        if( json.Code == '0000' )
+        {
+            document.getElementById( "approval" ).value = json.approvalKey;
+            // 아래 alert는 삭제 해도됨
+            alert("성공적으로 거래가 등록 되었습니다.");
+            PayUrl = json.PayUrl;
+            
+            document.getElementById( "PayUrl"  ).value = json.request_URI;
+            document.getElementById( "traceNo" ).value = json.traceNo;
+            
+            call_pay_form();
+        }
+        else
+        {
+            ajax_flag=true;
+            
+            alert("실패 되었습니다.[" + json.Message + "]");
+        }
+    }