결제 - 키움결제 적용 2차
This commit is contained in:
@@ -53,7 +53,10 @@
|
||||
const gcpayCardUseAt = $('#gcpayCardUseAt').val();
|
||||
let gcpayAt = ( gcpayCardUseAt === 'Y')? 'Y' : 'N';
|
||||
const setleTy = $('#setleSetupTyCd').val();
|
||||
const setleTyCd = (setleTy==='01')?'#pg04':'#pg03';
|
||||
let setleTyCd = '#pg04';
|
||||
if(setleTy==='01')setleTyCd = '#pg04'; //kcp
|
||||
else if(setleTy==='02')setleTyCd = '#pg03'; //toss
|
||||
else if(setleTy==='03')setleTyCd = '#pg06'; //kiwoom
|
||||
|
||||
if (gcpayAt === 'N') {
|
||||
$(setleTyCd).click();
|
||||
@@ -525,11 +528,16 @@
|
||||
|
||||
$(form).find('.pgContent').hide();
|
||||
$(form).find('#' + id + 'Content').show();
|
||||
$(form).find('#setleSetupTyCd').val() === '01' ? $(form).find('#pg04Content').show() : $(form).find('#pg03Content').show();
|
||||
|
||||
//$(form).find('#setleSetupTyCd').val() === '01' ? $(form).find('#pg04Content').show() : $(form).find('#pg03Content').show();
|
||||
if($(form).find('#setleSetupTyCd').val() === '01'){$(form).find('#pg04Content').show();}
|
||||
else if($(form).find('#setleSetupTyCd').val() === '02'){$(form).find('#pg03Content').show();}
|
||||
else if($(form).find('#setleSetupTyCd').val() === '03'){$(form).find('#pg06Content').show();}
|
||||
|
||||
$('.order-method-normal__btn').removeClass('active');
|
||||
$(form).find('#pgCmpnyNm').val(pgCmpnyNm);
|
||||
|
||||
if ('pg01' === id || 'pg02' === id) {
|
||||
if ('pg01' === id || 'pg02' === id) { //GC페이
|
||||
if ('pg02' === id) {
|
||||
$('#gc-pay-bank-cash-receipt').prop('checked', true).trigger("click");
|
||||
|
||||
@@ -549,7 +557,7 @@
|
||||
$(form).find('#setleTyCd').val('pg01' === id ? '01' : '03');
|
||||
|
||||
$('.bankSlideW, .cardSlideW').slick('setPosition');
|
||||
} else if('pg05' === id){
|
||||
} else if('pg05' === id){ //퀵계좌이체
|
||||
$('#transfer-cash-receipt').prop('checked', true).trigger("click");
|
||||
|
||||
$(form).find('#transfer-cash-receipt').on('click', function () {
|
||||
@@ -579,7 +587,10 @@
|
||||
const content = $('.order-method-normal__content');
|
||||
const useCashMlgAmt = $('#useCashMlgAmt').val();
|
||||
|
||||
$('#setleSetupTyCd').val() === '01' ? $('#pg04').click() : $('#pg03').click();
|
||||
//$('#setleSetupTyCd').val() === '01' ? $('#pg04').click() : $('#pg03').click();
|
||||
if($('#setleSetupTyCd').val() === '01'){$('#pg04').click();}
|
||||
else if($('#setleSetupTyCd').val() === '02'){$('#pg03').click();}
|
||||
else if($('#setleSetupTyCd').val() === '03'){$('#pg05').click();}
|
||||
|
||||
$('.order-method-normal__btn').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
@@ -2987,7 +2998,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
if ('kcp' === pgCmpnyNm || 'toss' === pgCmpnyNm) {
|
||||
if ('kcp' === pgCmpnyNm || 'toss' === pgCmpnyNm || 'kiwoom' === pgCmpnyNm) {
|
||||
const div = $('#setleForm').find('.order-method-normal');
|
||||
|
||||
if (!$(div).find('.order-method-normal__btn-container button').hasClass('active')) {
|
||||
@@ -3028,7 +3039,12 @@
|
||||
const id = '01' === issuTrgetDvCd ? 'issuTrgetMbtlnb' : 'issuTrgetBsnmNb';
|
||||
let rlPgCmpnyNm = $('#pgCmpnyNm').val();
|
||||
|
||||
let setleTyId = $('kcp' === pgCmpnyNm ? '#pg04Content' : '#pg03Content').find('button[name="' + setleTyCd + '"]').attr('id');
|
||||
let pgCont = "";
|
||||
if('kiwoom' === pgCmpnyNm) pgCont='pg06Content';
|
||||
else if('kcp' === pgCmpnyNm) pgCont='pg04Content';
|
||||
else pgCont='pg03Content';
|
||||
let setleTyId = $('#'+pgCont).find('button[name="' + setleTyCd + '"]').attr('id');
|
||||
|
||||
|
||||
if ('tosspay' === rlPgCmpnyNm) {
|
||||
setleTyId = 'acount'
|
||||
@@ -3077,7 +3093,7 @@
|
||||
|
||||
$('#setleForm').find('#pgCmpnyNm').val(pgCmpnyNm);
|
||||
$('#setleForm').find('#setleTyCd').val(setleTyCd);
|
||||
} else {
|
||||
} else { //gc페이
|
||||
if ('01' === setleTyCd) { // 카드
|
||||
const index = $('.cardSlideW').slick('slickCurrentSlide');
|
||||
const curCardId = $('#gcCardId' + index).val();
|
||||
@@ -3524,6 +3540,82 @@
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var pf;
|
||||
function kiwoomPay() {
|
||||
|
||||
console.log("kiwoomPay script start :::::");
|
||||
|
||||
pf = document.payForm;
|
||||
|
||||
// 입력값 가져오기
|
||||
var CPID = pf.CPID.value;
|
||||
var PAYMETHOD = pf.PAYMETHOD.value;
|
||||
var ORDERNO = pf.ORDERNO.value;
|
||||
var TYPE = pf.TYPE.value;
|
||||
var AMOUNT = pf.AMOUNT.value;
|
||||
|
||||
const url = '<c:url value="/sopmal/pay/kiwoomPayGetEnc"/>';
|
||||
|
||||
// AJAX로 kiwoom_ENC 값 요청
|
||||
$.ajax({
|
||||
url : url,
|
||||
type : "POST",
|
||||
dataType : "json",
|
||||
data : {
|
||||
CPID : CPID,
|
||||
PAYMETHOD : PAYMETHOD,
|
||||
ORDERNO : ORDERNO,
|
||||
TYPE : TYPE,
|
||||
AMOUNT : AMOUNT
|
||||
},
|
||||
success : function(res) {
|
||||
|
||||
console.log("response :::::",res);
|
||||
console.log("response KIWOOM_ENC :::::",JSON.parse(res.response).KIWOOM_ENC);
|
||||
|
||||
var enc = JSON.parse(res.response).KIWOOM_ENC;
|
||||
|
||||
if (enc) {
|
||||
// kiwoom_ENC 값 입력
|
||||
pf.KIWOOM_ENC.value = enc;
|
||||
|
||||
console.log("response enc :::::",enc);
|
||||
|
||||
// 결제창 URL 설정
|
||||
var PayServer = pf.SERVER.value;
|
||||
var PayType = pf.TYPE.value;
|
||||
var fileName = "";
|
||||
console.log("response PayServer :::::", PayServer);
|
||||
console.log("response PayType :::::", PayType);
|
||||
if (PayServer === "DEV") {
|
||||
fileName = "https://apitest.kiwoompay.co.kr/pay/linkEnc";
|
||||
} else if (PayServer === "LIVE") {
|
||||
fileName = "https://api.kiwoompay.co.kr/pay/linkEnc";
|
||||
}
|
||||
console.log("response fileName :::::", fileName);
|
||||
if (PayType === "P") {
|
||||
var KIWOOMPAY = window.open("", "KIWOOMPAY", "width=468,height=750");
|
||||
pf.target = "KIWOOMPAY";
|
||||
} else if (PayType === "M" || PayType === "W") {
|
||||
pf.target = "_self";
|
||||
}
|
||||
|
||||
pf.action = fileName;
|
||||
pf.method = "post";
|
||||
pf.submit();
|
||||
} else {
|
||||
alert("결제 정보를 가져오지 못했습니다.");
|
||||
}
|
||||
},
|
||||
error : function(xhr, status, error) {
|
||||
console.log("AJAX Error:", error);
|
||||
alert("파일을 연동바랍니다.");
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<%-- 공통 Header --%>
|
||||
@@ -4437,6 +4529,138 @@
|
||||
</div>
|
||||
</c:if>
|
||||
<%-- kcp 결제 종료 --%>
|
||||
|
||||
<%-- 키움 결제 시작 --%>
|
||||
<c:if test="${'03' eq payInfo.setleSetupTyCd}">
|
||||
<div class="custom-radio is-medium">
|
||||
<input type="radio" name="pg" id="pg06" value="kiwoom">
|
||||
<label for="pg06">일반결제</label>
|
||||
</div>
|
||||
<div id="pg06Content" class="pgContent order-method-normal" <%-- style="display: none"--%>>
|
||||
<div class="order-method-normal__btn-container">
|
||||
<c:if test="${'Y' eq payInfo.cardUseAt}">
|
||||
<button type="button" name="01" id="card" class="order-method-normal__btn gift_pay">
|
||||
<div class="order-method-normal__icon order-method-normal__icon--card"></div>신용카드
|
||||
</button>
|
||||
</c:if>
|
||||
<%--
|
||||
<c:if test="${'Y' eq payInfo.rltmAcntUseAt}">
|
||||
<button type="button" name="03" id="acount" class="order-method-normal__btn gift_pay">
|
||||
<div class="order-method-normal__icon order-method-normal__icon--transfer"></div>실시간 계좌이체
|
||||
</button>
|
||||
</c:if>
|
||||
--%>
|
||||
<c:if test="${'Y' eq payInfo.virtlAcntUseAt}">
|
||||
<button type="button" name="04" id="virtual" class="order-method-normal__btn">
|
||||
<div class="order-method-normal__icon order-method-normal__icon--account"></div>가상계좌
|
||||
</button>
|
||||
</c:if>
|
||||
<c:if test="${'Y' eq payInfo.virtlAcntEscwUseAt}">
|
||||
<button type="button" name="05" id="escrow-virtual" class="order-method-normal__btn not_multi_pay">
|
||||
<div class="order-method-normal__icon order-method-normal__icon--account"></div>가상계좌(에스크로)
|
||||
</button>
|
||||
</c:if>
|
||||
<c:if test="${'Y' eq payInfo.nbkkUseAt}">
|
||||
<button type="button" name="02" id="bank" class="order-method-normal__btn">
|
||||
<div class="order-method-normal__icon order-method-normal__icon--deposit"></div>무통장
|
||||
</button>
|
||||
</c:if>
|
||||
<c:if test="${'Y' eq payInfo.paycoUseAt}">
|
||||
<button type="button" name="10" id="payco" class="order-method-normal__btn gift_pay">
|
||||
<div class="order-method-normal__icon order-method-normal__icon--payco"></div>PAYCO
|
||||
</button>
|
||||
</c:if>
|
||||
<c:if test="${'Y' eq payInfo.tpayUseAt}">
|
||||
<button type="button" name="tosspay" id="tosspay" class="order-method-normal__btn gift_pay">
|
||||
<div class="order-method-normal__icon order-method-normal__icon--toss"></div>토스페이
|
||||
</button>
|
||||
</c:if>
|
||||
<c:if test="${'Y' eq payInfo.npayUseAt}">
|
||||
<button type="button" name="naverpay" id="naverpay" class="order-method-normal__btn gift_pay">
|
||||
<div class="order-method-normal__icon order-method-normal__icon--naver"></div>네이버페이
|
||||
</button>
|
||||
</c:if>
|
||||
<c:if test="${'Y' eq payInfo.kpayUseAt}">
|
||||
<button type="button" name="kakaopay" id="kakaopay" class="order-method-normal__btn gift_pay">
|
||||
<div class="order-method-normal__icon order-method-normal__icon--kakao"></div>카카오페이
|
||||
</button>
|
||||
</c:if>
|
||||
</div>
|
||||
<div class="order-method-normal__content-wrapper">
|
||||
<c:if test="${'Y' eq payInfo.cardUseAt}">
|
||||
<div id="card-content" class="order-method-normal__content" style="display: none">
|
||||
<div id="card-content-inner" class="order-method-normal__content-inner">
|
||||
<p class="fyi gray-7 mt-10 ml-10 noempty">발급정보 : 카드매출전표(또는 휴대폰결제전표)로 대체합니다.</p>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<%--
|
||||
<c:if test="${'Y' eq payInfo.rltmAcntUseAt}">
|
||||
<div id="acount-content" class="order-method-normal__content" style="display: none">
|
||||
<div id="acount-content-inner" class="order-method-normal__content-inner"></div>
|
||||
</div>
|
||||
</c:if>
|
||||
--%>
|
||||
<c:if test="${'Y' eq payInfo.virtlAcntUseAt}">
|
||||
<div id="virtual-content" class="order-method-normal__content" style="display: none">
|
||||
<div id="virtual-content-inner" class="order-method-normal__content-inner"></div>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${'Y' eq payInfo.virtlAcntEscwUseAt}">
|
||||
<div id="escrow-virtual-content" class="order-method-normal__content" style="display: none">
|
||||
<div id="escrow-virtual-content-inner" class="order-method-normal__content-inner"></div>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${'Y' eq payInfo.nbkkUseAt}">
|
||||
<div id="bank-content" class="order-method-normal__content" style="display: none">
|
||||
<div id="bank-content-inner" class="order-method-normal__content-inner"></div>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${'Y' eq payInfo.paycoUseAt}">
|
||||
<div id="payco-content" class="order-method-normal__content" style="display: none">
|
||||
<div id="payco-content-inner" class="order-method-normal__content-inner">
|
||||
<div class="infoBox noempty">
|
||||
<h6 class="infoBox__title">PAYCO 간편결제 안내</h6>
|
||||
<ol class="infoBox__list">
|
||||
<li>PAYCO는 온/오프라인 쇼핑은 물론 송금, 멤버십 적립까지 가능한 통합 서비스입니다.</li>
|
||||
<li>휴대폰과 카드 명의자가 동일해야 결제 가능하며, 결제금액 제한은 없습니다.
|
||||
<br>- 지원카드: 모든 국내 신용/체크카드
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<p class="textInfo noempty"><i class="icon icon_textInfo--sm"></i>발급정보 : 카드매출전표(또는 휴대폰결제전표)로 대체합니다.</p>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${'Y' eq payInfo.tpayUseAt}">
|
||||
<div id="acount-content" class="order-method-normal__content" style="display: none">
|
||||
<div id="acount-content-inner" class="order-method-normal__content-inner">
|
||||
<p class="fyi gray-7 mt-10 ml-10 noempty">발급정보 : 카드매출전표(또는 휴대폰결제전표)로 대체합니다.</p>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${'Y' eq payInfo.npayUseAt}">
|
||||
<div id="naverpay-content" class="order-method-normal__content" style="display: none">
|
||||
<div id="naverpay-content-inner" class="order-method-normal__content-inner">
|
||||
<div class="noempty">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<c:if test="${'Y' eq payInfo.kpayUseAt}">
|
||||
<div id="kakaopay-content" class="order-method-normal__content" style="display: none">
|
||||
<div id="kakaopay-content-inner" class="order-method-normal__content-inner">
|
||||
<div class="noempty">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
<%-- 키움 결제 종료 --%>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user