|
|
@@ -60,198 +60,10 @@
|
|
|
|
|
|
<div style="margin:20px;">
|
|
|
<input type="button" id="buyBtn" value="KCP테스트버튼" style="width:200px; height:70px; background-color: #fd4801; color: white; border: unset;"/>
|
|
|
- <input type="button" id="kakaoBtn" value="카카오테스트버튼" style="width:200px; height:70px; background-color: #fffa00; color: black; border: unset;"/>
|
|
|
- <input type="button" id="naverBtn" value="네이버테스트버튼" style="width:200px; height:70px; background-color: lawngreen; color: black; border: unset;"/>
|
|
|
</div>
|
|
|
<!-- // xodud1202 -->
|
|
|
|
|
|
|
|
|
-<!-- card007 -->
|
|
|
- <script th:inline="javascript">
|
|
|
- $(document).on("click", "#kakaoBtn", function() {
|
|
|
- let data = {};
|
|
|
- data.pgGb = "KAKAO";
|
|
|
- data.ordNo = 1000;
|
|
|
- data.goodsNm = '아이스타일24 테스트 상품';
|
|
|
- data.payAmt = 30000;
|
|
|
- data.ordGoodsQty = [[${goodsTotCnt}]];
|
|
|
-
|
|
|
- let jsonData = JSON.stringify(data);
|
|
|
- $.ajax({
|
|
|
- type: "POST",
|
|
|
- url : '/order/create/preOrder',
|
|
|
- dataType : 'html',
|
|
|
- data : jsonData,
|
|
|
- beforeSend : function(xhr, settings) {
|
|
|
- xhr.setRequestHeader("AJAX" , "true");
|
|
|
- xhr.setRequestHeader('Accept' , 'application/json');
|
|
|
- xhr.setRequestHeader('Content-Type' , 'application/json');
|
|
|
- gagajf.showProgressbar(true);
|
|
|
- },
|
|
|
- error : function(e) {
|
|
|
- mcxDialog.alert(e.responseText);
|
|
|
- },
|
|
|
- success : function(result) {
|
|
|
- $("#order_info").html(result);
|
|
|
- fnKakaoPaymentReady();
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
- // 카카오페이 결제준비 처리
|
|
|
- var fnKakaoPaymentReady = function() {
|
|
|
- let nextRedirectUrl = $('#order_info input[name=nextRedirectPcUrl]').val();
|
|
|
- let option = 'width=420, height=520';
|
|
|
-
|
|
|
- window.open(nextRedirectUrl, 'kakaoPaymentPopup', option);
|
|
|
- }
|
|
|
-
|
|
|
- // 카카오페이 결제 승인 요청
|
|
|
- var fnKakaoPaymentRequest = function(pgToken) {
|
|
|
- $('#order_info input[name=pgToken]').val(pgToken);
|
|
|
-
|
|
|
- // TODO
|
|
|
- // formSubmit
|
|
|
-
|
|
|
- // 테스트용 호출
|
|
|
- let url = '/order/kakao/payment/approve';
|
|
|
- let data = {};
|
|
|
- data.pgTid = $('#order_info input[name=pgTid]').val();
|
|
|
- data.partnerOrderId = $('#order_info input[name=partnerOrderId]').val();
|
|
|
- data.partnerUserId = $('#order_info input[name=partnerUserId]').val();
|
|
|
- data.pgToken = $('#order_info input[name=pgToken]').val();
|
|
|
-
|
|
|
- let jsonData = JSON.stringify(data);
|
|
|
-
|
|
|
- gagajf.ajaxJsonSubmit(url, jsonData, function(result) {
|
|
|
- console.log('====== kakaoPaymentRequest ======');
|
|
|
- console.log(result.payment);
|
|
|
- console.log(' ');
|
|
|
-
|
|
|
- let tag = '<input type="button" id="buyBtn" value="KCP테스트버튼" style="width:200px; height:70px; background-color: #fd4801; color: white; border: unset;"/>\n';
|
|
|
- tag += '<input type="button" id="kakaoCancelBtn" value="카카오취소테스트버튼" style="width:200px; height:70px; background-color: #fffa00; color: black; border: unset;"/>\n';
|
|
|
- tag += '<input type="button" id="naverBtn" value="네이버테스트버튼" style="width:200px; height:70px; background-color: lawngreen; color: black; border: unset;"/>';
|
|
|
- $('#kakaoBtn').parent().html(tag);
|
|
|
- });
|
|
|
-
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- // 카카오페이 결제 취소 (테스트용 호출)
|
|
|
- $(document).on("click", "#kakaoCancelBtn", function() {
|
|
|
- let url = '/order/kakao/payment/cancel';
|
|
|
- let data = {};
|
|
|
- data.pgTid = $('#order_info input[name=pgTid]').val();
|
|
|
- data.payAmt = 30000;
|
|
|
-
|
|
|
- let jsonData = JSON.stringify(data);
|
|
|
-
|
|
|
- gagajf.ajaxJsonSubmit(url, jsonData, function(result) {
|
|
|
- console.log('====== kakaoPaymentCancel ======');
|
|
|
- console.log(result.kakaoPay);
|
|
|
- console.log(' ');
|
|
|
-
|
|
|
- });
|
|
|
- });
|
|
|
- </script>
|
|
|
-
|
|
|
- <!-- =========== 네이버페이 ============= -->
|
|
|
- <script th:inline="javascript">
|
|
|
- $(document).on("click", "#naverBtn", function() {
|
|
|
- let data = {};
|
|
|
- data.pgGb = "NAVER";
|
|
|
- data.ordNo = 1000;
|
|
|
- data.goodsNm = '아이스타일24 테스트 상품';
|
|
|
- data.payAmt = 1000;
|
|
|
- data.ordGoodsQty = [[${goodsTotCnt}]];
|
|
|
-
|
|
|
- let jsonData = JSON.stringify(data);
|
|
|
- $.ajax({
|
|
|
- type: "POST",
|
|
|
- url : '/order/create/preOrder',
|
|
|
- dataType : 'html',
|
|
|
- data : jsonData,
|
|
|
- beforeSend : function(xhr, settings) {
|
|
|
- xhr.setRequestHeader("AJAX" , "true");
|
|
|
- xhr.setRequestHeader('Accept' , 'application/json');
|
|
|
- xhr.setRequestHeader('Content-Type' , 'application/json');
|
|
|
- gagajf.showProgressbar(true);
|
|
|
- },
|
|
|
- error : function(e) {
|
|
|
- mcxDialog.alert(e.responseText);
|
|
|
- },
|
|
|
- success : function(result) {
|
|
|
- $("#order_info").html(result);
|
|
|
- fnNaverPaymentReady();
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
- // 네이버페이 결제준비 처리
|
|
|
- var fnNaverPaymentReady = function() {
|
|
|
- let naverPayUrl = 'https://' + [[${@environment.getProperty('naverPay.payUrl.web')}]];
|
|
|
- let reserveId = $('#order_info input[name=reserveId]').val();
|
|
|
- let url = naverPayUrl + '/payments/' + reserveId;
|
|
|
- let option = 'width=750, height=' + $(window).height();
|
|
|
-
|
|
|
- window.open(url, 'naverPaymentPopup', option);
|
|
|
- }
|
|
|
-
|
|
|
- // 네이버페이 결제 승인 요청
|
|
|
- var fnNaverPaymentRequest = function(paymentId) {
|
|
|
- $('#order_info input[name=pgTid]').val(paymentId);
|
|
|
-
|
|
|
- // TODO
|
|
|
- // formSubmit
|
|
|
-
|
|
|
- // 테스트용 호출
|
|
|
- let url = '/order/naver/payment/approve';
|
|
|
- let data = {};
|
|
|
- data.pgTid = $('#order_info input[name=pgTid]').val();
|
|
|
- data.paySq = 1234;
|
|
|
- data.custNo = [[${sessionInfo.custNo}]];
|
|
|
- data.updNo = [[${sessionInfo.custNo}]];
|
|
|
-
|
|
|
- let jsonData = JSON.stringify(data);
|
|
|
-
|
|
|
- gagajf.ajaxJsonSubmit(url, jsonData, function(result) {
|
|
|
- console.log('====== naverPaymentRequest ======');
|
|
|
- console.log(result.payment);
|
|
|
- mcxDialog.alert('네이버페이 결제가 완료 되었습니다.<br />'+result.payment);
|
|
|
- console.log(' ');
|
|
|
-
|
|
|
- let tag = '<input type="button" id="buyBtn" value="KCP테스트버튼" style="width:200px; height:70px; background-color: #fd4801; color: white; border: unset;"/>\n';
|
|
|
- tag += '<input type="button" id="kakaoBtn" value="카카오테스트버튼" style="width:200px; height:70px; background-color: #fffa00; color: black; border: unset;"/>\n';
|
|
|
- tag += '<input type="button" id="naverCancelBtn" value="네이버취소테스트버튼" style="width:200px; height:70px; background-color: lawngreen; color: black; border: unset;"/>';
|
|
|
- $('#kakaoBtn').parent().html(tag);
|
|
|
- });
|
|
|
-
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- // 네이버페이 결제 취소 (테스트용 호출)
|
|
|
- $(document).on("click", "#naverCancelBtn", function() {
|
|
|
- let url = '/order/naver/payment/cancel';
|
|
|
- let data = {};
|
|
|
- data.pgTid = $('#order_info input[name=pgTid]').val();
|
|
|
- data.cancelRequester = '1';
|
|
|
- data.chgReasonNm = '고객변심';
|
|
|
- data.payAmt = 1000;
|
|
|
- data.paySq = 1234;
|
|
|
- data.custNo = [[${sessionInfo.custNo}]];
|
|
|
- data.updNo = [[${sessionInfo.custNo}]];
|
|
|
-
|
|
|
- let jsonData = JSON.stringify(data);
|
|
|
-
|
|
|
- gagajf.ajaxJsonSubmit(url, jsonData, function(result) {
|
|
|
- console.log('====== naverPaymentCancel ======');
|
|
|
- console.log(result.naverPay);
|
|
|
- mcxDialog.alert('네이버페이 결제취소가 완료 되었습니다.<br />'+result.naverPay);
|
|
|
- console.log(' ');
|
|
|
- });
|
|
|
- });
|
|
|
- </script>
|
|
|
-<!-- // card007 -->
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1022,6 +834,8 @@ var paymentInfoSet = function(jsonData) {
|
|
|
// 결재정보로드
|
|
|
$("#order_info").html(result);
|
|
|
jsf__pay(document.order_info);
|
|
|
+ //fnKakaoPaymentReady();
|
|
|
+ //fnNaverPaymentReady();
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
@@ -1978,6 +1792,46 @@ $(document).ready( function() {
|
|
|
$("#qPayidConfirm_pop").modal("show");
|
|
|
return false;
|
|
|
});
|
|
|
+
|
|
|
+ // 카카오페이 결제준비 처리
|
|
|
+ var fnKakaoPaymentReady = function() {
|
|
|
+ let nextRedirectUrl = $('#order_info input[name=nextRedirectPcUrl]').val();
|
|
|
+ let option = 'width=420, height=520';
|
|
|
+
|
|
|
+ window.open(nextRedirectUrl, 'kakaoPaymentPopup', option);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 카카오페이 결제 승인 요청
|
|
|
+ var fnKakaoPaymentRequest = function(pgToken) {
|
|
|
+ // Token 값 설정
|
|
|
+ $('#order_info input[name=pgToken]').val(pgToken);
|
|
|
+
|
|
|
+ // Form Submit
|
|
|
+ document.order_info.submit();
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 네이버페이 결제준비 처리
|
|
|
+ var fnNaverPaymentReady = function() {
|
|
|
+ let naverPayUrl = 'https://' + [[${@environment.getProperty('naverPay.payUrl.web')}]];
|
|
|
+ let reserveId = $('#order_info input[name=reserveId]').val();
|
|
|
+ let url = naverPayUrl + '/payments/' + reserveId;
|
|
|
+ let option = 'width=750, height=' + $(window).height();
|
|
|
+
|
|
|
+ window.open(url, 'naverPaymentPopup', option);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 네이버페이 결제 승인 요청
|
|
|
+ var fnNaverPaymentRequest = function(paymentId) {
|
|
|
+ // TID 설정
|
|
|
+ $('#order_info input[name=pgTid]').val(paymentId);
|
|
|
+
|
|
|
+ // Form Submit
|
|
|
+ document.order_info.submit();
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
});
|
|
|
</script>
|
|
|
|