feat: SIRK 전용 카카오페이 연동 종료와 기존 주문 지원 절차 추가

전용 신규 결제와 자동 취소를 차단하고 기존 주문 조회 및 실제 PG 취소 확인 후 수동 정리를 지원한다. 기존 DB와 일반 PG 경로를 보존하고 5.6.37 전환 및 사후지원 절차를 문서화한다.

검증: 변경 PHP 문법, SIRK 요청 차단, 설치 스키마 및 쇼핑몰 후설치 검사 통과. 실제 PG 결제·취소 검증은 별도 진행한다.
This commit is contained in:
whitedot
2026-09-09 07:58:05 +00:00
parent e74486e171
commit e784186b0f
41 changed files with 161 additions and 1352 deletions
-2
View File
@@ -696,7 +696,6 @@ a.scf_pgreg {display:inline-block;margin:5px 0 0;padding:5px 10px;background:#22
a.kcp_btn {display:inline-block;margin:5px 0 0;padding:5px 10px;background:#226C8B;color:#fff;font-weight:normal;text-decoration:none}
a.lg_btn{display:inline-block;margin:5px 0 0;padding:5px 10px;background:#ED008C;color:#fff;font-weight:normal;text-decoration:none}
a.kg_btn{display:inline-block;margin:5px 0 0;padding:5px 10px;background:#4A2C7C;color:#fff;font-weight:normal;text-decoration:none}
a.kakao_btn{display:inline-block;margin:5px 0 0;padding:5px 10px;background:#FDDC2F;color:#3B1E1E;font-weight:normal;text-decoration:none}
a.naver_btn {display:inline-block;margin:5px 0 0;padding:5px 10px;background:#00C73C;color:#fff;font-weight:normal;text-decoration:none}
a.nicepay_btn{display:inline-block;margin:5px 0 0;padding:5px 10px;background:#0057bf;color:#fff;font-weight:normal;text-decoration:none}
@@ -740,7 +739,6 @@ ul.de_pg_tab li.tab-current a{background:#2CC185;color:#fff}
.lg_info_fld th{background-color:#FFF4FA}
.lg_info_fld_v2 th{background-color:#ffe8f5}
.inicis_info_fld th{background-color:#F6F1FF}
.kakao_info_fld th{background-color:#FFFCED}
.naver_info_fld th{background-color:#F3FFF3}
.nicepay_info_fld th{background-color:#d1e6ff}
+7 -62
View File
@@ -31,11 +31,15 @@ if( function_exists('pg_setting_check') ){
pg_setting_check(true);
}
if(!$default['de_kakaopay_cancelpwd']){
$default['de_kakaopay_cancelpwd'] = '1111';
}
?>
<?php if (!empty($default['de_kakaopay_mid']) || !empty($default['de_kakaopay_enckey'])) { ?>
<div class="local_desc01 local_desc">
<p>5.6.37부터 SIRK 전용 카카오페이 연동을 지원하지 않습니다. 기존 거래는 이니시스 상점관리자에서 승인·취소 내역을 확인해 주십시오.</p>
<p>기존 이용 고객 지원: 김민섭 <a href="mailto:minsup@sir.kr">minsup@sir.kr</a></p>
</div>
<?php } ?>
<form name="fconfig" action="./configformupdate.php" onsubmit="return fconfig_check(this)" method="post" enctype="MULTIPART/FORM-DATA">
<input type="hidden" name="token" value="">
<section id="anc_scf_info">
@@ -780,46 +784,6 @@ if(!$default['de_kakaopay_cancelpwd']){
<input type="checkbox" name="de_inicis_cartpoint_use" value="1" id="de_inicis_cartpoint_use"<?php echo $default['de_inicis_cartpoint_use']?' checked':''; ?>> <label for="de_inicis_cartpoint_use">사용</label>
</td>
</tr>
<tr class="kakao_info_fld">
<th scope="row">
<label for="de_kakaopay_mid">카카오페이 상점아이디<br>( KG이니시스 )</label>
<a href="http://sir.kr/main/service/kakaopay.php?kk=yc5" target="_blank" class="kakao_btn">카카오페이 서비스신청하기</a>
</th>
<td>
<?php echo help("KG이니시스로 부터 카카오페이 간편결제만 사용용도로 발급 받으신 상점아이디(MID) 10자리 중 SIRK 을 제외한 나머지 6자리를 입력 합니다."); ?>
<span class="sitecode">SIRK</span> <input type="text" name="de_kakaopay_mid" value="<?php echo get_sanitize_input($default['de_kakaopay_mid']); ?>" id="de_kakaopay_mid" class="frm_input code_input" size="10" maxlength="7">
</td>
</tr>
<tr class="kakao_info_fld">
<th scope="row"><label for="de_kakaopay_key">카카오페이 상점키<br>( KG이니시스 )</label></th>
<td>
<?php echo help("SIRK****** 아이디로 KG이니시스에서 발급받은 웹결제 사인키를 입력합니다.\nKG이니시스 상점관리자 > 상점정보 > 계약정보 > 부가정보의 웹결제 signkey생성 조회 버튼 클릭, 팝업창에서 생성 버튼 클릭 후 해당 값을 입력합니다."); ?>
<input type="text" name="de_kakaopay_key" value="<?php echo get_sanitize_input($default['de_kakaopay_key']); ?>" id="de_kakaopay_key" class="frm_input" size="100">
</td>
</tr>
<tr class="kakao_info_fld">
<th scope="row"><label for="de_kakaopay_cancelpwd">카카오페이 키패스워드<br>( KG이니시스 )</label></th>
<td>
<?php echo help("SIRK****** 아이디로 KG이니시스에서 발급받은 4자리 상점 키패스워드를 입력합니다.\nKG이니시스 상점관리자 패스워드와 관련이 없습니다.\n키패스워드 값을 확인하시려면 상점측에 발급된 키파일 안의 readme.txt 파일을 참조해 주십시오"); ?>
<input type="text" name="de_kakaopay_cancelpwd" value="<?php echo get_sanitize_input($default['de_kakaopay_cancelpwd']); ?>" id="de_kakaopay_cancelpwd" class="frm_input" size="20">
</td>
</tr>
<tr class="kakao_info_fld">
<th scope="row">
<label for="de_kakaopay_enckey">KG이니시스<br>카카오페이 사용</label>
</th>
<td>
<?php echo help("체크시 카카오페이 (KG 이니시스)를 사용합니다. <br >KG 이니시스의 SIRK****** 아이디를 받은 상점만 해당됩니다.", 50); ?>
<input type="checkbox" name="de_kakaopay_enckey" value="1" id="de_kakaopay_enckey"<?php echo $default['de_kakaopay_enckey']?' checked':''; ?>> <label for="de_kakaopay_enckey">사용</label>
</td>
</tr>
<tr class="kakao_info_fld" style="display:none">
<th scope="row"><label for="de_kakaopay_hashkey">카카오페이 상점 HashKey</label></th>
<td>
<?php echo help("카카오페이로 부터 발급 받으신 상점 인증 전용 HashKey를 입력합니다."); ?>
<input type="text" name="de_kakaopay_hashkey" value="<?php echo get_sanitize_input($default['de_kakaopay_hashkey']); ?>" id="de_kakaopay_hashkey" class="frm_input" size="20">
</td>
</tr>
<tr class="pg_info_fld nicepay_info_fld" id="nicepay_info_anchor">
<th scope="row"><label for="de_nicepay_mid">NICEPAY MID</label><br><a href="http://sir.kr/main/service/nicepayments_pg.php" target="_blank" id="scf_nicepay_reg" class="nicepay_btn">NICEPAY 신청하기</a></th>
@@ -2005,26 +1969,7 @@ if($default['de_iche_use'] || $default['de_vbank_use'] || $default['de_hp_use']
}
}
// 카카오페이의 경우 log 디렉토리 체크
if($default['de_kakaopay_mid'] && $default['de_kakaopay_key'] && $default['de_kakaopay_enckey'] && $default['de_kakaopay_hashkey'] && $default['de_kakaopay_cancelpwd']) {
$log_path = G5_SHOP_PATH.'/kakaopay/log';
if(!is_dir($log_path)) {
echo '<script>'.PHP_EOL;
echo 'alert("'.str_replace(G5_PATH.'/', '', G5_SHOP_PATH).'/kakaopay 폴더 안에 log 폴더를 생성하신 후 쓰기권한을 부여해 주십시오.\n> mkdir log\n> chmod 707 log");'.PHP_EOL;
echo '</script>'.PHP_EOL;
} else {
if(!is_writable($log_path)) {
echo '<script>'.PHP_EOL;
echo 'alert("'.str_replace(G5_PATH.'/', '',$log_path).' 폴더에 쓰기권한을 부여해 주십시오.\n> chmod 707 log");'.PHP_EOL;
echo '</script>'.PHP_EOL;
} else {
if( function_exists('check_log_folder') && is_writable($log_path) ){
check_log_folder($log_path);
}
}
}
}
}
-15
View File
@@ -189,11 +189,6 @@ $check_sanitize_keys = array(
'de_inicis_cartpoint_use', //KG이니시스 신용카드 포인트 결제
'de_nicepay_mid', //NICEPAY 상점아이디
'de_nicepay_key', //NICEPAY 상점키
'de_kakaopay_mid', //카카오페이 상점MID
'de_kakaopay_key', //카카오페이 상점키
'de_kakaopay_enckey', //카카오페이 상점 EncKey
'de_kakaopay_hashkey', //카카오페이 상점 HashKey
'de_kakaopay_cancelpwd', //카카오페이 결제취소 비밀번호
'de_naverpay_mid', //네이버페이 가맹점 아이디
'de_naverpay_cert_key', //네이버페이 가맹점 인증키
'de_naverpay_button_key', //네이버페이 버튼 인증키
@@ -300,11 +295,6 @@ if($de_pg_service == 'kcp' && ! $de_card_test && ($de_iche_use || $de_vbank_use
alert('NHN KCP SITE KEY를 입력해 주십시오.');
}
if( $de_kakaopay_enckey && ($de_pg_service === 'inicis' || $de_inicis_lpay_use || $de_inicis_kakaopay_use) ){
$warning_msg = 'KG 이니시스 결제 또는 L.pay 또는 KG이니시스 카카오페이를 사용시 결제모듈 중복문제로 카카오페이를 활성화 할수 없습니다. \\n\\n카카오페이 사용을 비활성화 합니다.';
$de_kakaopay_enckey = '';
}
//
// 영카트 default
@@ -481,11 +471,6 @@ $sql = " update {$g5['g5_shop_default_table']}
de_hp_use = '{$de_hp_use}',
de_escrow_use = '{$de_escrow_use}',
de_tax_flag_use = '{$de_tax_flag_use}',
de_kakaopay_mid = '{$de_kakaopay_mid}',
de_kakaopay_key = '{$de_kakaopay_key}',
de_kakaopay_enckey = '{$de_kakaopay_enckey}',
de_kakaopay_hashkey = '{$de_kakaopay_hashkey}',
de_kakaopay_cancelpwd = '{$de_kakaopay_cancelpwd}',
de_member_reg_coupon_use = '{$de_member_reg_coupon_use}',
de_member_reg_coupon_term = '{$de_member_reg_coupon_term}',
de_member_reg_coupon_price = '{$de_member_reg_coupon_price}',
+3 -2
View File
@@ -30,6 +30,9 @@ if($w == 'd') {
// 주문정보
$data = unserialize(base64_decode($od['dt_data']));
if (isset($data['od_settle_case']) && $data['od_settle_case'] === 'KAKAOPAY') {
alert('SIRK 전용 카카오페이 미완료 주문은 결제 상태를 이니시스에서 확인한 뒤 사후지원 담당자에게 문의해 주십시오.');
}
$data_od_cp_id = isset($data['od_cp_id']) ? safe_replace_regex($data['od_cp_id'], 'cp_id') : '';
$data_sc_cp_id = isset($data['sc_cp_id']) ? safe_replace_regex($data['sc_cp_id'], 'cp_id') : '';
@@ -210,8 +213,6 @@ if($default['de_tax_flag_use']) {
}
$od_pg = $default['de_pg_service'];
if($data['od_settle_case'] == 'KAKAOPAY')
$od_pg = 'KAKAOPAY';
$od_email = get_email_address($data['od_email']);
$od_name = addslashes(clean_xss_tags($data['od_name']));
+10 -6
View File
@@ -239,6 +239,13 @@ if ($is_nicepay_vbank_pg_cancel) {
<input type="hidden" name="search" value="<?php echo $search; ?>">
<input type="hidden" name="page" value="<?php echo $page;?>">
<input type="hidden" name="pg_cancel" value="0">
<?php if ($od['od_pg'] === 'KAKAOPAY') { ?>
<div class="local_desc01 local_desc">
<p>SIRK 전용 카카오페이의 자동 취소 지원이 종료되었습니다. <a href="https://iniweb.inicis.com/" target="_blank" rel="noopener noreferrer">이니시스 상점관리자</a>에서 전체·부분취소를 처리한 뒤 주문 상태와 환불금액을 정리해 주십시오. 이 화면의 상태 변경은 PG 취소를 수행하지 않습니다.</p>
<p>기존 이용 고객 지원: 김민섭 <a href="mailto:minsup@sir.kr">minsup@sir.kr</a></p>
<label><input type="checkbox" name="sirk_cancel_confirmed" value="1"> 이니시스에서 실제 취소 여부와 금액을 확인했습니다. 선택한 상품의 주문 상태만 변경합니다.</label>
</div>
<?php } ?>
<input type="hidden" name="submit_ct_status" value="">
<?php if ($is_nicepay_vbank_pg_cancel) { ?>
<input type="hidden" name="RefundAcctNo" value="">
@@ -1018,7 +1025,7 @@ if ($is_nicepay_vbank_pg_cancel) {
<?php if($od['od_status'] == '주문' && $od['od_misu'] > 0) { ?>
<a href="./personalpayform.php?popup=yes&amp;od_id=<?php echo $od_id; ?>" id="personalpay_add" class="btn btn_02">개인결제추가</a>
<?php } ?>
<?php if($od['od_misu'] < 0 && ($od['od_receipt_price'] - $od['od_refund_price']) > 0 && ($od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == '계좌이체' || $od['od_settle_case'] == 'KAKAOPAY' || ($od['od_pg'] == 'nicepay' && $od['od_settle_case'] == '간편결제'))) { ?>
<?php if($od['od_pg'] !== 'KAKAOPAY' && $od['od_misu'] < 0 && ($od['od_receipt_price'] - $od['od_refund_price']) > 0 && ($od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == '계좌이체' || $od['od_settle_case'] == 'KAKAOPAY' || ($od['od_pg'] == 'nicepay' && $od['od_settle_case'] == '간편결제'))) { ?>
<a href="./orderpartcancel.php?od_id=<?php echo $od_id; ?>" id="orderpartcancel" class="btn btn_02"><?php echo get_text($od['od_settle_case']); ?> 부분취소</a>
<?php } ?>
<a href="./orderlist.php?<?php echo $qstr; ?>" class="btn btn_02">목록</a>
@@ -1455,16 +1462,13 @@ function form_submit(f)
var msg = "";
<?php if (is_cancel_shop_pg_order($od)) { ?>
<?php if ($od['od_pg'] !== 'KAKAOPAY' && is_cancel_shop_pg_order($od)) { ?>
if(status == "취소" || status == "반품" || status == "품절") {
var $ct_chk = $("input[name^=ct_chk]");
var chk_cnt = $ct_chk.length;
var chked_cnt = $ct_chk.filter(":checked").length;
<?php if($od['od_pg'] == 'KAKAOPAY') { ?>
var cancel_pg = "카카오페이";
<?php } else { ?>
var cancel_pg = "PG사의 <?php echo get_text($od['od_settle_case']); ?>";
<?php } ?>
// 체크하지 않은 나머지 품목이 모두 취소류 상태이면 이번 처리로 주문 전체가 취소된다.
var remain_active_cnt = $ct_chk.not(":checked").filter(function() {
+12 -6
View File
@@ -29,6 +29,16 @@ if (in_array($ct_status, $status_normal) || in_array($ct_status, $status_cancel)
alert('변경할 상태가 올바르지 않습니다.');
}
// SIRK 주문은 PG 취소를 호출하지 않고, 실제 취소를 확인한 운영자만 로컬 상태를 정리한다.
if (in_array($ct_status, $status_cancel, true)) {
$sirk_order = sql_fetch(" select od_pg from {$g5['g5_shop_order_table']} where od_id = '" . sql_escape_string($od_id) . "' ");
if (isset($sirk_order['od_pg']) && $sirk_order['od_pg'] === 'KAKAOPAY') {
if ($pg_cancel || empty($_POST['sirk_cancel_confirmed'])) {
alert('SIRK 전용 카카오페이는 이니시스 상점관리자에서 실제 취소 여부를 확인한 뒤 주문 상태만 변경해 주십시오.');
}
}
}
// INIpay PRO 전체취소는 로컬 상품상태를 바꾸기 전에 PG 취소를 먼저 확정한다.
// PG 취소 실패 후에도 주문만 취소되어 가상계좌 입금이 남는 상태를 방지한다.
$inicis_pro_cancel_preprocessed = false;
@@ -455,12 +465,8 @@ if (in_array($ct_status, $status_cancel)) {
break;
case 'KAKAOPAY':
include_once(G5_SHOP_PATH.'/settle_kakaopay.inc.php');
$_REQUEST['TID'] = $od['od_tno'];
$_REQUEST['Amt'] = $od['od_receipt_price'];
$_REQUEST['CancelMsg'] = '쇼핑몰 운영자 승인 취소';
$_REQUEST['PartialCancelCode'] = 0;
include G5_SHOP_PATH.'/kakaopay/kakaopay_cancel.php';
$pg_res_cd = 'SIRK_RETIRED';
$pg_res_msg = 'SIRK 전용 카카오페이는 이니시스 상점관리자에서 취소해 주십시오.';
break;
default:
include_once(G5_SHOP_PATH.'/settle_kcp.inc.php');
+4
View File
@@ -12,6 +12,10 @@ $od = sql_fetch($sql);
if(! (isset($od['od_id']) && $od['od_id']))
alert_close('주문정보가 존재하지 않습니다.');
if ($od['od_pg'] === 'KAKAOPAY') {
alert_close('SIRK 전용 카카오페이의 자동 취소 지원이 종료되었습니다. 이니시스 상점관리자에서 실제 취소 후 주문 상태와 환불금액을 확인해 주십시오.');
}
if($od['od_pg'] == 'inicis' && $od['od_settle_case'] == '계좌이체')
alert_close('KG이니시스는 신용카드만 부분취소가 가능합니다.');
+4
View File
@@ -27,6 +27,10 @@ if(! (isset($od['od_id']) && $od['od_id']))
if($od['od_settle_case'] == '계좌이체' && substr($od['od_receipt_time'], 0, 10) >= G5_TIME_YMD)
alert_close('실시간 계좌이체건의 부분취소 요청은 결제일 익일에 가능합니다.');
if ($od['od_pg'] === 'KAKAOPAY') {
alert_close('SIRK 전용 카카오페이의 자동 취소 지원이 종료되었습니다. 이니시스 상점관리자에서 실제 취소 후 주문 상태와 환불금액을 확인해 주십시오.');
}
// 금액비교
$od_misu = abs($od['od_misu']);