|
|
@@ -52,21 +52,23 @@
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
- <script type="text/javascript" th:src="${@environment.getProperty('pg.kcp.js.url')}" src=""></script>
|
|
|
+ <script th:inline="javascript" th:src="|${@environment.getProperty('pg.kcp.js.url')}?v=${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}|" src=""></script>
|
|
|
+
|
|
|
+ <form id="order_info" name="order_info" method="post" action="/order/pay/result/response" >
|
|
|
+ <input type="button" id="kcpBuyBtn" value="테스트버튼" style="width:200px; height:200px;"/>
|
|
|
+ </form>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
/* 표준웹 실행 */
|
|
|
- function jsf__pay( form ) {
|
|
|
+ function jsf__pay(form) {
|
|
|
try {
|
|
|
- KCP_Pay_Execute( form );
|
|
|
+ KCP_Pay_Execute(form);
|
|
|
} catch (e) {
|
|
|
/* IE 에서 결제 정상종료시 throw로 스크립트 종료 */
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- $(document).on("click", "#buyBtn", function() {
|
|
|
+ $("#kcpBuyBtn").click(function() {
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
url : '/order/create/order',
|
|
|
@@ -82,11 +84,6 @@
|
|
|
});
|
|
|
});
|
|
|
</script>
|
|
|
-
|
|
|
- <form id="order_info" name="order_info" method="post" action="/order/pay/result/response" >
|
|
|
- <input type="button" id="buyBtn" value="테스트버튼" style="width:200px; height:200px;"/>
|
|
|
- </form>
|
|
|
-
|
|
|
<!-- // xodud1202 -->
|
|
|
|
|
|
|
|
|
@@ -118,14 +115,14 @@
|
|
|
data.approvalUrl = protocol + _frontUrl + redirectUrl;
|
|
|
data.failUrl = protocol + _frontUrl + redirectUrl;
|
|
|
data.cancelUrl = protocol + _frontUrl + redirectUrl;
|
|
|
-
|
|
|
+
|
|
|
let jsonData = JSON.stringify(data);
|
|
|
-
|
|
|
+
|
|
|
gagajf.ajaxJsonSubmit(url, jsonData, function(result) {
|
|
|
let tid = result.kakaoPay.tid;
|
|
|
let nextRedirectUrl = result.kakaoPay.next_redirect_pc_url;
|
|
|
let option = 'width=420, height=520';
|
|
|
-
|
|
|
+
|
|
|
$('#order_info').append('<input type=hidden name="pgTid" value="' + tid + '" />');
|
|
|
|
|
|
window.open(nextRedirectUrl, 'kakaoPaymentPopup', option);
|
|
|
@@ -141,16 +138,16 @@
|
|
|
data.pgTid = $('#order_info input[name=pgTid]').val();
|
|
|
data.ordNo = $('#order_info input[name=ordr_idxx]').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(' ');
|
|
|
fnKakaoPaymentOrder();
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
@@ -159,16 +156,16 @@
|
|
|
let url = '/order/kakao/payment/order';
|
|
|
let data = {};
|
|
|
data.pgTid = $('#order_info input[name=pgTid]').val();
|
|
|
-
|
|
|
+
|
|
|
let jsonData = JSON.stringify(data);
|
|
|
-
|
|
|
+
|
|
|
gagajf.ajaxJsonSubmit(url, jsonData, function(result) {
|
|
|
console.log('====== kakaoPaymentOrder ======');
|
|
|
console.log(result.kakaoPay);
|
|
|
console.log(' ');
|
|
|
fnCancelKakaoPayment();
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
@@ -179,19 +176,19 @@
|
|
|
data.pgTid = $('#order_info input[name=pgTid]').val();
|
|
|
data.cnclRtnAmt = 1000;
|
|
|
//data.allCanYn = 'Y';
|
|
|
-
|
|
|
+
|
|
|
let jsonData = JSON.stringify(data);
|
|
|
-
|
|
|
+
|
|
|
gagajf.ajaxJsonSubmit(url, jsonData, function(result) {
|
|
|
console.log('====== kakaoPaymentCancel ======');
|
|
|
console.log(result.kakaoPay);
|
|
|
console.log(' ');
|
|
|
-
|
|
|
+
|
|
|
});
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
- <form id="kakao_order_info" name="order_info" method="post" action="/order/pay/result/response" >
|
|
|
+ <form id="kakao_order_info" name="kakao_order_info" method="post" action="/order/pay/result/response" >
|
|
|
<input type="button" id="kakaoBtn" value="카카오테스트버튼" style="width:200px; height:200px;"/>
|
|
|
</form>
|
|
|
<!-- // card007 -->
|