NHN KCP 휴대폰 본인확인(api_v2) 버전 추가
This commit is contained in:
+24
-7
@@ -415,10 +415,10 @@ if (!isset($config['cf_cert_use_seed'])) {
|
|||||||
sql_query($sql, false);
|
sql_query($sql, false);
|
||||||
}
|
}
|
||||||
if (!isset($config['cf_cert_kcp_enckey'])) {
|
if (!isset($config['cf_cert_kcp_enckey'])) {
|
||||||
$sql = "ALTER TABLE `{$g5['config_table']}`
|
$sql = "ALTER TABLE `{$g5['config_table']}`
|
||||||
ADD COLUMN `cf_cert_kcp_enckey` VARCHAR(100) NOT NULL DEFAULT '' AFTER `cf_cert_kcp_cd`; ";
|
ADD COLUMN `cf_cert_kcp_enckey` VARCHAR(100) NOT NULL DEFAULT '' AFTER `cf_cert_kcp_cd`; ";
|
||||||
sql_query($sql, false);
|
sql_query($sql, false);
|
||||||
|
|
||||||
$config['cf_cert_kcp_enckey'] = '';
|
$config['cf_cert_kcp_enckey'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1068,7 +1068,24 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
|
|||||||
<?php echo option_selected("", $config['cf_cert_hp'], "사용안함"); ?>
|
<?php echo option_selected("", $config['cf_cert_hp'], "사용안함"); ?>
|
||||||
<?php echo option_selected("kcb", $config['cf_cert_hp'], "코리아크레딧뷰로(KCB) 휴대폰 본인확인"); ?>
|
<?php echo option_selected("kcb", $config['cf_cert_hp'], "코리아크레딧뷰로(KCB) 휴대폰 본인확인"); ?>
|
||||||
<?php echo option_selected("kcp", $config['cf_cert_hp'], "NHN KCP 휴대폰 본인확인"); ?>
|
<?php echo option_selected("kcp", $config['cf_cert_hp'], "NHN KCP 휴대폰 본인확인"); ?>
|
||||||
|
<?php echo option_selected("kcp_v2", $config['cf_cert_hp'], "NHN KCP 휴대폰 본인확인(api_v2)"); ?>
|
||||||
</select>
|
</select>
|
||||||
|
<div id="cf_cert_hp_kcp_v2_notice" style="display:<?php echo ($config['cf_cert_hp'] == 'kcp_v2') ? 'block' : 'none'; ?>; margin-top:8px; padding:10px 12px; background:#fff8e1; border:1px solid #ffd54f; border-radius:4px; color:#5d4037; line-height:1.5;">
|
||||||
|
<strong>NHN KCP 휴대폰 본인확인(api_v2)</strong> 사용 시,<br>
|
||||||
|
NHN KCP 상점관리자 > 부가서비스 > 휴대폰본인확인 > 연동방식 설정 에서 <strong>신규 연동방식(V2) 사용여부를 ‘사용’</strong> 으로 변경해야 정상 동작합니다.
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
jQuery(function($){
|
||||||
|
function toggle_kcp_v2_notice() {
|
||||||
|
var is_kcp_v2 = $('#cf_cert_hp').val() === 'kcp_v2';
|
||||||
|
$('#cf_cert_hp_kcp_v2_notice').toggle(is_kcp_v2);
|
||||||
|
$('#cf_cert_kcp_cd_prefix').toggle(!is_kcp_v2);
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#cf_cert_hp').on('change', toggle_kcp_v2_notice);
|
||||||
|
toggle_kcp_v2_notice();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -1104,16 +1121,16 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) {
|
|||||||
<tr>
|
<tr>
|
||||||
<th scope="row" class="cf_cert_service"><label for="cf_cert_kcp_cd">NHN KCP 사이트코드</label></th>
|
<th scope="row" class="cf_cert_service"><label for="cf_cert_kcp_cd">NHN KCP 사이트코드</label></th>
|
||||||
<td class="cf_cert_service">
|
<td class="cf_cert_service">
|
||||||
<?php echo help('SM으로 시작하는 5자리 사이트 코드중 뒤의 3자리만 입력해 주십시오.<br>서비스에 가입되어 있지 않다면, 본인확인 서비스 신청페이지에서 서비스 신청 후 사이트코드를 발급 받으실 수 있습니다.') ?>
|
<?php echo help('기존 NHN KCP 휴대폰 본인확인은 SM으로 시작하는 5자리 사이트 코드 중 뒤의 3자리만 입력해 주십시오.<br>NHN KCP 휴대폰 본인확인(api_v2)은 KCP에서 발급받은 5자리 사이트코드를 그대로 입력해 주십시오.<br>서비스에 가입되어 있지 않다면, 본인확인 서비스 신청페이지에서 서비스 신청 후 사이트코드를 발급 받으실 수 있습니다.') ?>
|
||||||
<span class="sitecode">SM</span>
|
<span class="sitecode" id="cf_cert_kcp_cd_prefix" style="display:<?php echo ($config['cf_cert_hp'] == 'kcp_v2') ? 'none' : 'inline'; ?>;">SM</span>
|
||||||
<input type="text" name="cf_cert_kcp_cd" value="<?php echo get_sanitize_input($config['cf_cert_kcp_cd']); ?>" id="cf_cert_kcp_cd" class="frm_input" size="3"> <a href="http://sir.kr/main/service/p_cert.php" target="_blank" class="btn_frmline">NHN KCP 휴대폰 본인확인 서비스 신청페이지</a>
|
<input type="text" name="cf_cert_kcp_cd" value="<?php echo get_sanitize_input($config['cf_cert_kcp_cd']); ?>" id="cf_cert_kcp_cd" class="frm_input" size="10" maxlength="10"> <a href="http://sir.kr/main/service/p_cert.php" target="_blank" class="btn_frmline">NHN KCP 휴대폰 본인확인 서비스 신청페이지</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row" class="cf_cert_service"><label for="cf_cert_kcp_enckey">NHN KCP 가맹점 인증키</label></th>
|
<th scope="row" class="cf_cert_service"><label for="cf_cert_kcp_enckey">NHN KCP 가맹점 인증키</label></th>
|
||||||
<td class="cf_cert_service">
|
<td class="cf_cert_service">
|
||||||
<?php echo help('(선택사항, 추후 NHN_KCP 상점관리자에서 인증키 발급 메뉴 오픈일정 이후부터 적용되는 내용입니다.)<br>NHN_KCP 상점관리자 > 기술관리센터 > 인증센터 > 가맹점 인증키관리 에서 인증키 발급 후에 인증키 정보를 입력') ?>
|
<?php echo help('NHN KCP 상점관리자 > 기술관리센터 > 인증센터 > 가맹점 인증키관리 에서 인증키를 발급받아 입력해 주십시오.<br>NHN KCP 휴대폰 본인확인(api_v2)도 이 인증키 값을 사용합니다.') ?>
|
||||||
<input type="text" name="cf_cert_kcp_enckey" value="<?php echo get_sanitize_input($config['cf_cert_kcp_enckey']); ?>" id="cf_cert_kcp_enckey" class="frm_input" maxlength="100" size="40"> <a href="https://partner.kcp.co.kr" target="_blank" class="btn_frmline">NHN KCP 상점관리자</a>
|
<input type="text" name="cf_cert_kcp_enckey" value="<?php echo get_sanitize_input($config['cf_cert_kcp_enckey']); ?>" id="cf_cert_kcp_enckey" class="frm_input" maxlength="100" size="70"> <a href="https://partner.kcp.co.kr" target="_blank" class="btn_frmline">NHN KCP 상점관리자</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ define('G5_MOBILE_DIR', 'mobile');
|
|||||||
define('G5_OKNAME_DIR', 'okname');
|
define('G5_OKNAME_DIR', 'okname');
|
||||||
|
|
||||||
define('G5_KCPCERT_DIR', 'kcpcert');
|
define('G5_KCPCERT_DIR', 'kcpcert');
|
||||||
|
define('G5_KCPCERT_V2_DIR', 'kcpcert_v2');
|
||||||
define('G5_INICERT_DIR', 'inicert');
|
define('G5_INICERT_DIR', 'inicert');
|
||||||
define('G5_LGXPAY_DIR', 'lgxpay');
|
define('G5_LGXPAY_DIR', 'lgxpay');
|
||||||
|
|
||||||
@@ -103,6 +104,7 @@ define('G5_PLUGIN_URL', G5_URL.'/'.G5_PLUGIN_DIR);
|
|||||||
define('G5_EDITOR_URL', G5_PLUGIN_URL.'/'.G5_EDITOR_DIR);
|
define('G5_EDITOR_URL', G5_PLUGIN_URL.'/'.G5_EDITOR_DIR);
|
||||||
define('G5_OKNAME_URL', G5_PLUGIN_URL.'/'.G5_OKNAME_DIR);
|
define('G5_OKNAME_URL', G5_PLUGIN_URL.'/'.G5_OKNAME_DIR);
|
||||||
define('G5_KCPCERT_URL', G5_PLUGIN_URL.'/'.G5_KCPCERT_DIR);
|
define('G5_KCPCERT_URL', G5_PLUGIN_URL.'/'.G5_KCPCERT_DIR);
|
||||||
|
define('G5_KCPCERT_V2_URL', G5_PLUGIN_URL.'/'.G5_KCPCERT_V2_DIR);
|
||||||
define('G5_INICERT_URL', G5_PLUGIN_URL.'/'.G5_INICERT_DIR);
|
define('G5_INICERT_URL', G5_PLUGIN_URL.'/'.G5_INICERT_DIR);
|
||||||
define('G5_LGXPAY_URL', G5_PLUGIN_URL.'/'.G5_LGXPAY_DIR);
|
define('G5_LGXPAY_URL', G5_PLUGIN_URL.'/'.G5_LGXPAY_DIR);
|
||||||
define('G5_SNS_URL', G5_PLUGIN_URL.'/'.G5_SNS_DIR);
|
define('G5_SNS_URL', G5_PLUGIN_URL.'/'.G5_SNS_DIR);
|
||||||
@@ -123,6 +125,7 @@ define('G5_EDITOR_PATH', G5_PLUGIN_PATH.'/'.G5_EDITOR_DIR);
|
|||||||
define('G5_OKNAME_PATH', G5_PLUGIN_PATH.'/'.G5_OKNAME_DIR);
|
define('G5_OKNAME_PATH', G5_PLUGIN_PATH.'/'.G5_OKNAME_DIR);
|
||||||
|
|
||||||
define('G5_KCPCERT_PATH', G5_PLUGIN_PATH.'/'.G5_KCPCERT_DIR);
|
define('G5_KCPCERT_PATH', G5_PLUGIN_PATH.'/'.G5_KCPCERT_DIR);
|
||||||
|
define('G5_KCPCERT_V2_PATH', G5_PLUGIN_PATH.'/'.G5_KCPCERT_V2_DIR);
|
||||||
define('G5_INICERT_PATH', G5_PLUGIN_PATH.'/'.G5_INICERT_DIR);
|
define('G5_INICERT_PATH', G5_PLUGIN_PATH.'/'.G5_INICERT_DIR);
|
||||||
define('G5_LGXPAY_PATH', G5_PLUGIN_PATH.'/'.G5_LGXPAY_DIR);
|
define('G5_LGXPAY_PATH', G5_PLUGIN_PATH.'/'.G5_LGXPAY_DIR);
|
||||||
|
|
||||||
|
|||||||
@@ -5,4 +5,4 @@ if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
|||||||
// 예) https://도메인/css/default.css?ver=220620
|
// 예) https://도메인/css/default.css?ver=220620
|
||||||
// 예) https://도메인/js/common.js?ver=220620
|
// 예) https://도메인/js/common.js?ver=220620
|
||||||
define('G5_CSS_VER', '2303229');
|
define('G5_CSS_VER', '2303229');
|
||||||
define('G5_JS_VER', '2304171');
|
define('G5_JS_VER', '2605291');
|
||||||
|
|||||||
@@ -64,6 +64,19 @@ function certify_win_open(type, url, event) {
|
|||||||
var AUTH_POP = window.open(url,'auth_popup', winopts + position);
|
var AUTH_POP = window.open(url,'auth_popup', winopts + position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(type == 'kcp_v2-hp')
|
||||||
|
{
|
||||||
|
var width = 410;
|
||||||
|
var height = 500;
|
||||||
|
|
||||||
|
var leftpos = screen.width / 2 - ( width / 2 );
|
||||||
|
var toppos = screen.height / 2 - ( height / 2 );
|
||||||
|
|
||||||
|
var winopts = "width=" + width + ", height=" + height + ", toolbar=no,status=no,statusbar=no,menubar=no,scrollbars=no,resizable=no";
|
||||||
|
var position = ",left=" + leftpos + ", top=" + toppos;
|
||||||
|
var AUTH_POP = window.open(url, 'auth_popup', winopts + position);
|
||||||
|
if (AUTH_POP) AUTH_POP.focus();
|
||||||
|
}
|
||||||
else if(type == 'lg-hp')
|
else if(type == 'lg-hp')
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -121,6 +121,10 @@ if ($config['cf_cert_use'] && ($config['cf_cert_simple'] || $config['cf_cert_ipi
|
|||||||
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
||||||
$cert_type = 'kcp-hp';
|
$cert_type = 'kcp-hp';
|
||||||
break;
|
break;
|
||||||
|
case 'kcp_v2':
|
||||||
|
$cert_url = G5_KCPCERT_V2_URL.'/kcpcert_form.php';
|
||||||
|
$cert_type = 'kcp_v2-hp';
|
||||||
|
break;
|
||||||
case 'lg':
|
case 'lg':
|
||||||
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
||||||
$cert_type = 'lg-hp';
|
$cert_type = 'lg-hp';
|
||||||
|
|||||||
@@ -92,6 +92,10 @@ $(function() {
|
|||||||
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
||||||
$cert_type = 'kcp-hp';
|
$cert_type = 'kcp-hp';
|
||||||
break;
|
break;
|
||||||
|
case 'kcp_v2':
|
||||||
|
$cert_url = G5_KCPCERT_V2_URL.'/kcpcert_form.php';
|
||||||
|
$cert_type = 'kcp_v2-hp';
|
||||||
|
break;
|
||||||
case 'lg':
|
case 'lg':
|
||||||
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
||||||
$cert_type = 'lg-hp';
|
$cert_type = 'lg-hp';
|
||||||
|
|||||||
@@ -428,6 +428,10 @@ if ($config['cf_cert_use'] && ($config['cf_cert_simple'] || $config['cf_cert_ipi
|
|||||||
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
||||||
$cert_type = 'kcp-hp';
|
$cert_type = 'kcp-hp';
|
||||||
break;
|
break;
|
||||||
|
case 'kcp_v2':
|
||||||
|
$cert_url = G5_KCPCERT_V2_URL.'/kcpcert_form.php';
|
||||||
|
$cert_type = 'kcp_v2-hp';
|
||||||
|
break;
|
||||||
case 'lg':
|
case 'lg':
|
||||||
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
||||||
$cert_type = 'lg-hp';
|
$cert_type = 'lg-hp';
|
||||||
|
|||||||
@@ -357,6 +357,10 @@ $email_msg = $is_exists_email ? '등록할 이메일이 중복되었습니다.
|
|||||||
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
||||||
$cert_type = 'kcp-hp';
|
$cert_type = 'kcp-hp';
|
||||||
break;
|
break;
|
||||||
|
case 'kcp_v2':
|
||||||
|
$cert_url = G5_KCPCERT_V2_URL.'/kcpcert_form.php';
|
||||||
|
$cert_type = 'kcp_v2-hp';
|
||||||
|
break;
|
||||||
case 'lg':
|
case 'lg':
|
||||||
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
||||||
$cert_type = 'lg-hp';
|
$cert_type = 'lg-hp';
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<?php
|
||||||
|
define('G5_CERT_IN_PROG', true);
|
||||||
|
include_once('../../common.php');
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
<?php
|
||||||
|
include_once('./_common.php');
|
||||||
|
include_once(G5_KCPCERT_V2_PATH.'/kcpcert_config.php');
|
||||||
|
|
||||||
|
$res_cd = isset($_POST['res_cd']) ? trim($_POST['res_cd']) : '';
|
||||||
|
$res_msg = isset($_POST['res_msg']) ? trim($_POST['res_msg']) : '';
|
||||||
|
|
||||||
|
$reg_cert_key = get_session('ss_kcp_v2_reg_cert_key');
|
||||||
|
$ordr_idxx = get_session('ss_kcp_v2_ordr_idxx');
|
||||||
|
|
||||||
|
set_session('ss_kcp_v2_reg_cert_key', '');
|
||||||
|
set_session('ss_kcp_v2_ordr_idxx', '');
|
||||||
|
set_session('ss_kcp_v2_page_type', '');
|
||||||
|
|
||||||
|
$g5['title'] = '휴대폰인증 결과';
|
||||||
|
include_once(G5_PATH.'/head.sub.php');
|
||||||
|
|
||||||
|
if ($res_cd === '') {
|
||||||
|
alert_close('본인확인 응답값이 없습니다. 처음부터 다시 시도해 주세요.');
|
||||||
|
}
|
||||||
|
|
||||||
|
@insert_cert_history($member['mb_id'], 'kcp_v2', 'hp');
|
||||||
|
|
||||||
|
if ($res_cd === '9999') {
|
||||||
|
alert_close('휴대폰 본인확인을 취소 하셨습니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($res_cd !== '0000') {
|
||||||
|
alert_close('코드 : '.$res_cd.' '.urldecode($res_msg));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$reg_cert_key || !$ordr_idxx) {
|
||||||
|
alert_close('본인확인 세션이 만료되었습니다. 처음부터 다시 시도해 주세요.');
|
||||||
|
}
|
||||||
|
|
||||||
|
$api = new C_KCP_API_V2($site_cd, $kcp_enc_key, $cert_reg_url, $cert_dec_url);
|
||||||
|
$cert = $api->get_cert_data($reg_cert_key, $ordr_idxx);
|
||||||
|
|
||||||
|
if ($cert['res_cd'] !== '0000') {
|
||||||
|
alert_close('본인확인 결과조회 실패 ('.$cert['res_cd'].' : '.$cert['res_msg'].')');
|
||||||
|
}
|
||||||
|
|
||||||
|
$phone_no = trim($cert['phone_no']);
|
||||||
|
$user_name = trim($cert['user_name']);
|
||||||
|
$birth_day = trim($cert['birth_day']);
|
||||||
|
$sex_code = trim($cert['sex_code']);
|
||||||
|
$ci = trim($cert['ci']);
|
||||||
|
$di = trim($cert['di']);
|
||||||
|
|
||||||
|
if (!$phone_no || !$user_name || !$birth_day || !$ci || !$di) {
|
||||||
|
alert_close('정상적인 인증이 아닙니다. 올바른 방법으로 이용해 주세요.');
|
||||||
|
}
|
||||||
|
|
||||||
|
$phone_no = hyphen_hp_number($phone_no);
|
||||||
|
$mb_dupinfo = $di;
|
||||||
|
$md5_ci = md5($ci.$ci);
|
||||||
|
$sql_dupinfo = sql_real_escape_string($mb_dupinfo);
|
||||||
|
$sql_md5_ci = sql_real_escape_string($md5_ci);
|
||||||
|
|
||||||
|
$row = sql_fetch("select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$sql_md5_ci}'");
|
||||||
|
if (empty($row['mb_id'])) {
|
||||||
|
$row = sql_fetch("select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$sql_dupinfo}'");
|
||||||
|
if (empty($row['mb_id'])) {
|
||||||
|
alert_close('인증하신 정보로 가입된 회원정보가 없습니다.');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$mb_dupinfo = $md5_ci;
|
||||||
|
}
|
||||||
|
|
||||||
|
$cert_type = 'hp';
|
||||||
|
$md5_cert_no = md5($reg_cert_key);
|
||||||
|
$hash_data = md5($user_name.$cert_type.$birth_day.$phone_no.$md5_cert_no);
|
||||||
|
|
||||||
|
$adult_day = date('Ymd', strtotime('-19 years', G5_SERVER_TIME));
|
||||||
|
$adult = ((int)$birth_day <= (int)$adult_day) ? 1 : 0;
|
||||||
|
|
||||||
|
set_session('ss_cert_type', $cert_type);
|
||||||
|
set_session('ss_cert_no', $md5_cert_no);
|
||||||
|
set_session('ss_cert_hash', $hash_data);
|
||||||
|
set_session('ss_cert_adult', $adult);
|
||||||
|
set_session('ss_cert_birth', $birth_day);
|
||||||
|
set_session('ss_cert_sex', ($sex_code == '01' ? 'M' : 'F'));
|
||||||
|
set_session('ss_cert_dupinfo', $mb_dupinfo);
|
||||||
|
set_session('ss_cert_mb_id', $row['mb_id']);
|
||||||
|
?>
|
||||||
|
<form name="mbFindForm" method="POST">
|
||||||
|
<input type="hidden" name="mb_id" value="<?php echo $row['mb_id']; ?>">
|
||||||
|
</form>
|
||||||
|
<script>
|
||||||
|
jQuery(function($) {
|
||||||
|
var $opener = window.opener;
|
||||||
|
if (!$opener) { window.close(); return; }
|
||||||
|
$opener.name = "parentPage";
|
||||||
|
|
||||||
|
document.mbFindForm.target = "parentPage";
|
||||||
|
document.mbFindForm.action = "<?php echo G5_BBS_URL.'/password_reset.php'; ?>";
|
||||||
|
document.mbFindForm.submit();
|
||||||
|
|
||||||
|
alert("본인인증이 완료되었습니다.");
|
||||||
|
window.close();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
include_once(G5_PATH.'/tail.sub.php');
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
if (!defined('_GNUBOARD_')) exit;
|
||||||
|
|
||||||
|
if (version_compare(PHP_VERSION, '7.0.0', '<')) {
|
||||||
|
alert('KCP 휴대폰 본인확인 V2 모듈은 PHP 7.0 이상 환경에서만 동작합니다.\n관리자 > 기본환경설정에서 V1 모듈을 선택해 주세요.', G5_URL);
|
||||||
|
}
|
||||||
|
if (!extension_loaded('openssl') || !function_exists('hash_pbkdf2') || !extension_loaded('curl')) {
|
||||||
|
alert('KCP 휴대폰 본인확인 V2 모듈에 필요한 PHP 확장(openssl/curl/hash_pbkdf2)이 활성화되어 있지 않습니다.', G5_URL);
|
||||||
|
}
|
||||||
|
|
||||||
|
$web_siteid = '';
|
||||||
|
|
||||||
|
if ($config['cf_cert_use'] == 2) {
|
||||||
|
$site_cd = isset($config['cf_cert_kcp_cd']) ? trim($config['cf_cert_kcp_cd']) : '';
|
||||||
|
if (strlen($site_cd) === 3) {
|
||||||
|
$site_cd = 'SM'.$site_cd;
|
||||||
|
}
|
||||||
|
$kcp_enc_key = isset($config['cf_cert_kcp_enckey']) ? $config['cf_cert_kcp_enckey'] : '';
|
||||||
|
$cert_reg_url = 'https://cert.kcp.co.kr/api/reg/certDataReg.do';
|
||||||
|
$cert_dec_url = 'https://cert.kcp.co.kr/api/query/getCertData.do';
|
||||||
|
} else if ($config['cf_cert_use'] == 1) {
|
||||||
|
$site_cd = 'AO7F3';
|
||||||
|
$kcp_enc_key = 'c2a22fa3ebe4698075bcac6b433d52e351c881b02fb83488d4283a43385b1f8e';
|
||||||
|
$cert_reg_url = 'https://testcert.kcp.co.kr/api/reg/certDataReg.do';
|
||||||
|
$cert_dec_url = 'https://testcert.kcp.co.kr/api/query/getCertData.do';
|
||||||
|
} else {
|
||||||
|
$site_cd = $kcp_enc_key = $cert_reg_url = $cert_dec_url = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$site_cd || !$kcp_enc_key) {
|
||||||
|
alert('KCP 휴대폰 본인확인 V2 사이트코드 또는 ENC_KEY 가 설정되지 않았습니다.\n관리자 > 기본환경설정에서 입력해 주세요.', G5_URL);
|
||||||
|
}
|
||||||
|
|
||||||
|
require_once G5_KCPCERT_V2_PATH.'/lib/Crypto.php';
|
||||||
|
require_once G5_KCPCERT_V2_PATH.'/lib/kcp_api.php';
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
<?php
|
||||||
|
include_once('./_common.php');
|
||||||
|
|
||||||
|
setlocale(LC_CTYPE, 'ko_KR.UTF-8');
|
||||||
|
|
||||||
|
$page_type = isset($_GET['pageType']) ? $_GET['pageType'] : '';
|
||||||
|
|
||||||
|
switch ($page_type) {
|
||||||
|
case 'register':
|
||||||
|
$result_url = G5_KCPCERT_V2_URL.'/kcpcert_result.php';
|
||||||
|
break;
|
||||||
|
case 'find':
|
||||||
|
$result_url = G5_KCPCERT_V2_URL.'/find_kcpcert_result.php';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
alert_close('잘못된 접근입니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
certify_count_check($member['mb_id'], 'hp');
|
||||||
|
|
||||||
|
include_once(G5_KCPCERT_V2_PATH.'/kcpcert_config.php');
|
||||||
|
|
||||||
|
$ordr_idxx = get_session('ss_uniqid');
|
||||||
|
if (!$ordr_idxx) $ordr_idxx = get_uniqid();
|
||||||
|
|
||||||
|
$api = new C_KCP_API_V2($site_cd, $kcp_enc_key, $cert_reg_url, $cert_dec_url);
|
||||||
|
|
||||||
|
$reg = $api->trade_reg($ordr_idxx, $result_url, $web_siteid);
|
||||||
|
|
||||||
|
if ($reg['res_cd'] !== '0000' || !$reg['call_url'] || !$reg['reg_cert_key']) {
|
||||||
|
$err = '본인확인 거래등록에 실패했습니다.\n('.$reg['res_cd'].' : '.$reg['res_msg'].')';
|
||||||
|
alert_close($err);
|
||||||
|
}
|
||||||
|
|
||||||
|
set_session('ss_kcp_v2_reg_cert_key', $reg['reg_cert_key']);
|
||||||
|
set_session('ss_kcp_v2_ordr_idxx', $ordr_idxx);
|
||||||
|
set_session('ss_kcp_v2_page_type', $page_type);
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<?php if (is_mobile()) { ?>
|
||||||
|
<meta name="viewport" content="user-scalable=yes, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, width=device-width, target-densitydpi=medium-dpi">
|
||||||
|
<?php } ?>
|
||||||
|
<title>휴대폰 본인확인</title>
|
||||||
|
</head>
|
||||||
|
<body oncontextmenu="return false;" ondragstart="return false;" onselectstart="return false;">
|
||||||
|
<form name="form_auth" method="post" action="<?php echo htmlspecialchars($reg['call_url'], ENT_QUOTES); ?>">
|
||||||
|
<input type="hidden" name="reg_cert_key" value="<?php echo htmlspecialchars($reg['reg_cert_key'], ENT_QUOTES); ?>">
|
||||||
|
<input type="hidden" name="kcp_page_submit_yn" value="Y">
|
||||||
|
</form>
|
||||||
|
<script>
|
||||||
|
window.onload = function() {
|
||||||
|
document.form_auth.submit();
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
<?php
|
||||||
|
include_once('./_common.php');
|
||||||
|
include_once(G5_KCPCERT_V2_PATH.'/kcpcert_config.php');
|
||||||
|
|
||||||
|
$res_cd = isset($_POST['res_cd']) ? trim($_POST['res_cd']) : '';
|
||||||
|
$res_msg = isset($_POST['res_msg']) ? trim($_POST['res_msg']) : '';
|
||||||
|
|
||||||
|
$reg_cert_key = get_session('ss_kcp_v2_reg_cert_key');
|
||||||
|
$ordr_idxx = get_session('ss_kcp_v2_ordr_idxx');
|
||||||
|
|
||||||
|
set_session('ss_kcp_v2_reg_cert_key', '');
|
||||||
|
set_session('ss_kcp_v2_ordr_idxx', '');
|
||||||
|
set_session('ss_kcp_v2_page_type', '');
|
||||||
|
|
||||||
|
$g5['title'] = '휴대폰인증 결과';
|
||||||
|
include_once(G5_PATH.'/head.sub.php');
|
||||||
|
|
||||||
|
if ($res_cd === '') {
|
||||||
|
alert_close('본인확인 응답값이 없습니다. 처음부터 다시 시도해 주세요.');
|
||||||
|
}
|
||||||
|
|
||||||
|
@insert_cert_history($member['mb_id'], 'kcp_v2', 'hp');
|
||||||
|
|
||||||
|
if ($res_cd === '9999') {
|
||||||
|
alert_close('휴대폰 본인확인을 취소 하셨습니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($res_cd !== '0000') {
|
||||||
|
alert_close('코드 : '.$res_cd.' '.urldecode($res_msg));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$reg_cert_key || !$ordr_idxx) {
|
||||||
|
alert_close('본인확인 세션이 만료되었습니다. 처음부터 다시 시도해 주세요.');
|
||||||
|
}
|
||||||
|
|
||||||
|
$api = new C_KCP_API_V2($site_cd, $kcp_enc_key, $cert_reg_url, $cert_dec_url);
|
||||||
|
$cert = $api->get_cert_data($reg_cert_key, $ordr_idxx);
|
||||||
|
|
||||||
|
if ($cert['res_cd'] !== '0000') {
|
||||||
|
alert_close('본인확인 결과조회 실패 ('.$cert['res_cd'].' : '.$cert['res_msg'].')');
|
||||||
|
}
|
||||||
|
|
||||||
|
$phone_no = trim($cert['phone_no']);
|
||||||
|
$user_name = trim($cert['user_name']);
|
||||||
|
$birth_day = trim($cert['birth_day']);
|
||||||
|
$sex_code = trim($cert['sex_code']);
|
||||||
|
$ci = trim($cert['ci']);
|
||||||
|
$di = trim($cert['di']);
|
||||||
|
|
||||||
|
if (!$phone_no || !$user_name || !$birth_day || !$ci || !$di) {
|
||||||
|
alert_close('정상적인 인증이 아닙니다. 올바른 방법으로 이용해 주세요.');
|
||||||
|
}
|
||||||
|
|
||||||
|
$phone_no = hyphen_hp_number($phone_no);
|
||||||
|
$mb_dupinfo = md5($ci.$ci);
|
||||||
|
$sql_dupinfo = sql_real_escape_string($mb_dupinfo);
|
||||||
|
|
||||||
|
if (!empty($member['mb_certify']) && !empty($member['mb_dupinfo']) && strlen($member['mb_dupinfo']) != 64) {
|
||||||
|
if ($member['mb_dupinfo'] != $mb_dupinfo) {
|
||||||
|
alert_close('해당 계정은 이미 다른명의로 본인인증 되어있는 계정입니다.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = " select mb_id from {$g5['member_table']} where mb_id <> '{$member['mb_id']}' and mb_dupinfo = '{$sql_dupinfo}' ";
|
||||||
|
$row = sql_fetch($sql);
|
||||||
|
if (!empty($row['mb_id'])) {
|
||||||
|
alert_close("입력하신 본인확인 정보로 가입된 내역이 존재합니다.\\n회원아이디 : ".$row['mb_id']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$cert_type = 'hp';
|
||||||
|
$md5_cert_no = md5($reg_cert_key);
|
||||||
|
$hash_data = md5($user_name.$cert_type.$birth_day.$phone_no.$md5_cert_no);
|
||||||
|
|
||||||
|
$adult_day = date('Ymd', strtotime('-19 years', G5_SERVER_TIME));
|
||||||
|
$adult = ((int)$birth_day <= (int)$adult_day) ? 1 : 0;
|
||||||
|
|
||||||
|
set_session('ss_cert_type', $cert_type);
|
||||||
|
set_session('ss_cert_no', $md5_cert_no);
|
||||||
|
set_session('ss_cert_hash', $hash_data);
|
||||||
|
set_session('ss_cert_adult', $adult);
|
||||||
|
set_session('ss_cert_birth', $birth_day);
|
||||||
|
set_session('ss_cert_sex', ($sex_code == '01' ? 'M' : 'F'));
|
||||||
|
set_session('ss_cert_dupinfo', $mb_dupinfo);
|
||||||
|
?>
|
||||||
|
<script>
|
||||||
|
jQuery(function($) {
|
||||||
|
var $opener = window.opener;
|
||||||
|
if (!$opener) { window.close(); return; }
|
||||||
|
|
||||||
|
$opener.$("input[name=cert_type]").val(<?php echo get_js_safe_string($cert_type); ?>);
|
||||||
|
$opener.$("input[name=mb_name]").val(<?php echo get_js_safe_string($user_name); ?>).attr("readonly", true);
|
||||||
|
$opener.$("input[name=mb_hp]").val(<?php echo get_js_safe_string($phone_no); ?>).attr("readonly", true);
|
||||||
|
$opener.$("input[name=cert_no]").val(<?php echo get_js_safe_string($md5_cert_no); ?>);
|
||||||
|
|
||||||
|
alert("본인의 휴대폰번호로 확인 되었습니다.");
|
||||||
|
|
||||||
|
if ($opener.$("form[name=fcertrefreshform]").length) {
|
||||||
|
$opener.$("form[name=fcertrefreshform]").submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
window.close();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<?php
|
||||||
|
include_once(G5_PATH.'/tail.sub.php');
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
if (!class_exists('Crypto_KCP_V2')) {
|
||||||
|
class Crypto_KCP_V2
|
||||||
|
{
|
||||||
|
private static $a = "c2hhMjU2";
|
||||||
|
private static $b = 10000;
|
||||||
|
private static $c = 32;
|
||||||
|
private static $d = "QUVTLTI1Ni1DQkM=";
|
||||||
|
|
||||||
|
private static function x($p, $s)
|
||||||
|
{
|
||||||
|
return hash_pbkdf2(base64_decode(self::$a), $p, $s, self::$b, self::$c, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function y($d, $k, $i)
|
||||||
|
{
|
||||||
|
return openssl_encrypt($d, base64_decode(self::$d), $k, OPENSSL_RAW_DATA, $i);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function z($d, $k, $i)
|
||||||
|
{
|
||||||
|
return openssl_decrypt($d, base64_decode(self::$d), $k, OPENSSL_RAW_DATA, $i);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function encryptJson($data, $key, $site)
|
||||||
|
{
|
||||||
|
$s = random_bytes(16);
|
||||||
|
|
||||||
|
$k = self::x($key, $s);
|
||||||
|
$v = self::x($site, $s);
|
||||||
|
|
||||||
|
$i = substr($v, 0, 16);
|
||||||
|
|
||||||
|
$e = self::y($data, $k, $i);
|
||||||
|
|
||||||
|
return array(
|
||||||
|
"encData" => base64_encode($e),
|
||||||
|
"rv" => base64_encode($s),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function decryptJson($enc, $rv, $key, $site)
|
||||||
|
{
|
||||||
|
$s = base64_decode($rv);
|
||||||
|
|
||||||
|
$k = self::x($key, $s);
|
||||||
|
$v = self::x($site, $s);
|
||||||
|
|
||||||
|
$i = substr($v, 0, 16);
|
||||||
|
|
||||||
|
return self::z(base64_decode($enc), $k, $i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,183 @@
|
|||||||
|
<?php
|
||||||
|
if (!defined('_GNUBOARD_')) exit;
|
||||||
|
|
||||||
|
if (!class_exists('C_KCP_API_V2')) {
|
||||||
|
class C_KCP_API_V2
|
||||||
|
{
|
||||||
|
private $site_cd;
|
||||||
|
private $enc_key;
|
||||||
|
private $reg_url;
|
||||||
|
private $dec_url;
|
||||||
|
private $last_error = '';
|
||||||
|
|
||||||
|
public function __construct($site_cd, $enc_key, $reg_url, $dec_url)
|
||||||
|
{
|
||||||
|
$this->site_cd = $site_cd;
|
||||||
|
$this->enc_key = $enc_key;
|
||||||
|
$this->reg_url = $reg_url;
|
||||||
|
$this->dec_url = $dec_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function trade_reg($ordr_idxx, $ret_url, $web_siteid = '', $opt1 = '', $opt2 = '', $opt3 = '')
|
||||||
|
{
|
||||||
|
$payload = array(
|
||||||
|
'site_cd' => $this->site_cd,
|
||||||
|
'ordr_idxx' => $ordr_idxx,
|
||||||
|
'Ret_URL' => $ret_url,
|
||||||
|
'web_siteid' => $web_siteid,
|
||||||
|
'param_opt_1' => $opt1,
|
||||||
|
'param_opt_2' => $opt2,
|
||||||
|
'param_opt_3' => $opt3,
|
||||||
|
);
|
||||||
|
|
||||||
|
$req_json = json_encode($payload, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
||||||
|
if ($req_json === false) {
|
||||||
|
return array(
|
||||||
|
'res_cd' => 'JSON_ERROR',
|
||||||
|
'res_msg' => 'KCP 거래등록 요청 데이터를 생성할 수 없습니다.',
|
||||||
|
'call_url' => '',
|
||||||
|
'reg_cert_key' => '',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$enc = Crypto_KCP_V2::encryptJson($req_json, $this->enc_key, $this->site_cd);
|
||||||
|
if (empty($enc['encData']) || empty($enc['rv'])) {
|
||||||
|
return array(
|
||||||
|
'res_cd' => 'ENCRYPT_ERROR',
|
||||||
|
'res_msg' => 'KCP 거래등록 요청 데이터를 암호화할 수 없습니다.',
|
||||||
|
'call_url' => '',
|
||||||
|
'reg_cert_key' => '',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$headers = array(
|
||||||
|
'Content-Type: application/json',
|
||||||
|
'site_cd: '.$this->site_cd,
|
||||||
|
'rv: '.$enc['rv'],
|
||||||
|
);
|
||||||
|
|
||||||
|
$body = $this->http_post($this->reg_url, $enc['encData'], $headers);
|
||||||
|
if ($body === false || $body === '') {
|
||||||
|
return array(
|
||||||
|
'res_cd' => 'HTTP_ERROR',
|
||||||
|
'res_msg' => $this->last_error ? $this->last_error : 'KCP 거래등록 API 응답이 없습니다.',
|
||||||
|
'call_url' => '',
|
||||||
|
'reg_cert_key' => '',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$res = json_decode($body, true);
|
||||||
|
if (!is_array($res)) {
|
||||||
|
return array(
|
||||||
|
'res_cd' => 'JSON_ERROR',
|
||||||
|
'res_msg' => 'KCP 거래등록 API 응답을 해석할 수 없습니다.',
|
||||||
|
'call_url' => '',
|
||||||
|
'reg_cert_key' => '',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'res_cd' => isset($res['res_cd']) ? $res['res_cd'] : '',
|
||||||
|
'res_msg' => isset($res['res_msg']) ? $res['res_msg'] : '',
|
||||||
|
'call_url' => isset($res['call_url']) ? $res['call_url'] : '',
|
||||||
|
'reg_cert_key' => isset($res['reg_cert_key']) ? $res['reg_cert_key'] : '',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function get_cert_data($reg_cert_key, $ordr_idxx)
|
||||||
|
{
|
||||||
|
$req_json = json_encode(array(
|
||||||
|
'reg_cert_key' => $reg_cert_key,
|
||||||
|
'ordr_idxx' => $ordr_idxx,
|
||||||
|
), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
||||||
|
if ($req_json === false) {
|
||||||
|
return array('res_cd' => 'JSON_ERROR', 'res_msg' => 'KCP 본인확인 결과조회 요청 데이터를 생성할 수 없습니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
$headers = array(
|
||||||
|
'Content-Type: application/json',
|
||||||
|
'site_cd: '.$this->site_cd,
|
||||||
|
);
|
||||||
|
|
||||||
|
$body = $this->http_post($this->dec_url, $req_json, $headers);
|
||||||
|
if ($body === false || $body === '') {
|
||||||
|
return array(
|
||||||
|
'res_cd' => 'HTTP_ERROR',
|
||||||
|
'res_msg' => $this->last_error ? $this->last_error : 'KCP 본인확인 결과조회 API 응답이 없습니다.',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$res = json_decode($body, true);
|
||||||
|
if (!is_array($res)) {
|
||||||
|
return array('res_cd' => 'JSON_ERROR', 'res_msg' => 'KCP 본인확인 결과조회 API 응답을 해석할 수 없습니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
$res_cd = isset($res['res_cd']) ? $res['res_cd'] : '';
|
||||||
|
$res_msg = isset($res['res_msg']) ? $res['res_msg'] : '';
|
||||||
|
|
||||||
|
if ($res_cd !== '0000') {
|
||||||
|
return array('res_cd' => $res_cd, 'res_msg' => $res_msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
$enc_cert_data = isset($res['enc_cert_data']) ? $res['enc_cert_data'] : '';
|
||||||
|
$rv = isset($res['rv']) ? $res['rv'] : '';
|
||||||
|
|
||||||
|
$plain = Crypto_KCP_V2::decryptJson($enc_cert_data, $rv, $this->enc_key, $this->site_cd);
|
||||||
|
if ($plain === false || $plain === '') {
|
||||||
|
return array('res_cd' => 'DECRYPT_ERROR', 'res_msg' => 'KCP 본인확인 결과 데이터를 복호화할 수 없습니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
$dec = json_decode($plain, true);
|
||||||
|
if (!is_array($dec)) {
|
||||||
|
return array('res_cd' => 'JSON_ERROR', 'res_msg' => 'KCP 본인확인 복호화 데이터를 해석할 수 없습니다.');
|
||||||
|
}
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'res_cd' => $res_cd,
|
||||||
|
'res_msg' => $res_msg,
|
||||||
|
'phone_no' => isset($dec['phone_no']) ? $dec['phone_no'] : '',
|
||||||
|
'user_name' => isset($dec['user_name']) ? $dec['user_name'] : '',
|
||||||
|
'birth_day' => isset($dec['birth_day']) ? $dec['birth_day'] : '',
|
||||||
|
'comm_id' => isset($dec['comm_id']) ? $dec['comm_id'] : '',
|
||||||
|
'sex_code' => isset($dec['sex_code']) ? $dec['sex_code'] : '',
|
||||||
|
'local_code' => isset($dec['local_code']) ? $dec['local_code'] : '',
|
||||||
|
'ci' => isset($dec['CI']) ? $dec['CI'] : (isset($dec['ci']) ? $dec['ci'] : ''),
|
||||||
|
'di' => isset($dec['DI']) ? $dec['DI'] : (isset($dec['di']) ? $dec['di'] : ''),
|
||||||
|
'ci_url' => isset($dec['CI_URL']) ? urldecode($dec['CI_URL']) : '',
|
||||||
|
'di_url' => isset($dec['DI_URL']) ? urldecode($dec['DI_URL']) : '',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function http_post($url, $body, $headers)
|
||||||
|
{
|
||||||
|
$this->last_error = '';
|
||||||
|
|
||||||
|
$ch = curl_init($url);
|
||||||
|
if (!$ch) {
|
||||||
|
$this->last_error = 'cURL 초기화에 실패했습니다.';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
curl_setopt($ch, CURLOPT_POST, true);
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
||||||
|
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||||
|
$resp = curl_exec($ch);
|
||||||
|
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||||
|
if ($resp === false) {
|
||||||
|
$this->last_error = 'KCP API 통신 실패: '.curl_error($ch);
|
||||||
|
} else if ($http_code && ($http_code < 200 || $http_code >= 300)) {
|
||||||
|
$this->last_error = 'KCP API HTTP 오류: '.$http_code;
|
||||||
|
}
|
||||||
|
curl_close($ch);
|
||||||
|
|
||||||
|
if ($this->last_error) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $resp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -117,6 +117,10 @@ if ($config['cf_cert_use'] && ($config['cf_cert_simple'] || $config['cf_cert_ipi
|
|||||||
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
||||||
$cert_type = 'kcp-hp';
|
$cert_type = 'kcp-hp';
|
||||||
break;
|
break;
|
||||||
|
case 'kcp_v2':
|
||||||
|
$cert_url = G5_KCPCERT_V2_URL.'/kcpcert_form.php';
|
||||||
|
$cert_type = 'kcp_v2-hp';
|
||||||
|
break;
|
||||||
case 'lg':
|
case 'lg':
|
||||||
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
||||||
$cert_type = 'lg-hp';
|
$cert_type = 'lg-hp';
|
||||||
|
|||||||
@@ -92,6 +92,10 @@ $(function() {
|
|||||||
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
||||||
$cert_type = 'kcp-hp';
|
$cert_type = 'kcp-hp';
|
||||||
break;
|
break;
|
||||||
|
case 'kcp_v2':
|
||||||
|
$cert_url = G5_KCPCERT_V2_URL.'/kcpcert_form.php';
|
||||||
|
$cert_type = 'kcp_v2-hp';
|
||||||
|
break;
|
||||||
case 'lg':
|
case 'lg':
|
||||||
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
||||||
$cert_type = 'lg-hp';
|
$cert_type = 'lg-hp';
|
||||||
|
|||||||
@@ -440,6 +440,10 @@ $(function() {
|
|||||||
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
||||||
$cert_type = 'kcp-hp';
|
$cert_type = 'kcp-hp';
|
||||||
break;
|
break;
|
||||||
|
case 'kcp_v2':
|
||||||
|
$cert_url = G5_KCPCERT_V2_URL.'/kcpcert_form.php';
|
||||||
|
$cert_type = 'kcp_v2-hp';
|
||||||
|
break;
|
||||||
case 'lg':
|
case 'lg':
|
||||||
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
||||||
$cert_type = 'lg-hp';
|
$cert_type = 'lg-hp';
|
||||||
|
|||||||
@@ -354,6 +354,10 @@ $email_msg = $is_exists_email ? '등록할 이메일이 중복되었습니다.
|
|||||||
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
||||||
$cert_type = 'kcp-hp';
|
$cert_type = 'kcp-hp';
|
||||||
break;
|
break;
|
||||||
|
case 'kcp_v2':
|
||||||
|
$cert_url = G5_KCPCERT_V2_URL.'/kcpcert_form.php';
|
||||||
|
$cert_type = 'kcp_v2-hp';
|
||||||
|
break;
|
||||||
case 'lg':
|
case 'lg':
|
||||||
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
||||||
$cert_type = 'lg-hp';
|
$cert_type = 'lg-hp';
|
||||||
|
|||||||
@@ -121,6 +121,10 @@ if ($config['cf_cert_use'] && ($config['cf_cert_simple'] || $config['cf_cert_ipi
|
|||||||
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
||||||
$cert_type = 'kcp-hp';
|
$cert_type = 'kcp-hp';
|
||||||
break;
|
break;
|
||||||
|
case 'kcp_v2':
|
||||||
|
$cert_url = G5_KCPCERT_V2_URL.'/kcpcert_form.php';
|
||||||
|
$cert_type = 'kcp_v2-hp';
|
||||||
|
break;
|
||||||
case 'lg':
|
case 'lg':
|
||||||
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
||||||
$cert_type = 'lg-hp';
|
$cert_type = 'lg-hp';
|
||||||
|
|||||||
@@ -92,6 +92,10 @@ $(function() {
|
|||||||
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
||||||
$cert_type = 'kcp-hp';
|
$cert_type = 'kcp-hp';
|
||||||
break;
|
break;
|
||||||
|
case 'kcp_v2':
|
||||||
|
$cert_url = G5_KCPCERT_V2_URL.'/kcpcert_form.php';
|
||||||
|
$cert_type = 'kcp_v2-hp';
|
||||||
|
break;
|
||||||
case 'lg':
|
case 'lg':
|
||||||
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
||||||
$cert_type = 'lg-hp';
|
$cert_type = 'lg-hp';
|
||||||
|
|||||||
@@ -427,6 +427,10 @@ if ($config['cf_cert_use'] && ($config['cf_cert_simple'] || $config['cf_cert_ipi
|
|||||||
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
||||||
$cert_type = 'kcp-hp';
|
$cert_type = 'kcp-hp';
|
||||||
break;
|
break;
|
||||||
|
case 'kcp_v2':
|
||||||
|
$cert_url = G5_KCPCERT_V2_URL.'/kcpcert_form.php';
|
||||||
|
$cert_type = 'kcp_v2-hp';
|
||||||
|
break;
|
||||||
case 'lg':
|
case 'lg':
|
||||||
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
||||||
$cert_type = 'lg-hp';
|
$cert_type = 'lg-hp';
|
||||||
|
|||||||
@@ -117,6 +117,10 @@ if ($config['cf_cert_use'] && ($config['cf_cert_simple'] || $config['cf_cert_ipi
|
|||||||
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
||||||
$cert_type = 'kcp-hp';
|
$cert_type = 'kcp-hp';
|
||||||
break;
|
break;
|
||||||
|
case 'kcp_v2':
|
||||||
|
$cert_url = G5_KCPCERT_V2_URL.'/kcpcert_form.php';
|
||||||
|
$cert_type = 'kcp_v2-hp';
|
||||||
|
break;
|
||||||
case 'lg':
|
case 'lg':
|
||||||
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
||||||
$cert_type = 'lg-hp';
|
$cert_type = 'lg-hp';
|
||||||
|
|||||||
@@ -92,6 +92,10 @@ $(function() {
|
|||||||
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
||||||
$cert_type = 'kcp-hp';
|
$cert_type = 'kcp-hp';
|
||||||
break;
|
break;
|
||||||
|
case 'kcp_v2':
|
||||||
|
$cert_url = G5_KCPCERT_V2_URL.'/kcpcert_form.php';
|
||||||
|
$cert_type = 'kcp_v2-hp';
|
||||||
|
break;
|
||||||
case 'lg':
|
case 'lg':
|
||||||
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
||||||
$cert_type = 'lg-hp';
|
$cert_type = 'lg-hp';
|
||||||
|
|||||||
@@ -440,6 +440,10 @@ $(function() {
|
|||||||
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
$cert_url = G5_KCPCERT_URL.'/kcpcert_form.php';
|
||||||
$cert_type = 'kcp-hp';
|
$cert_type = 'kcp-hp';
|
||||||
break;
|
break;
|
||||||
|
case 'kcp_v2':
|
||||||
|
$cert_url = G5_KCPCERT_V2_URL.'/kcpcert_form.php';
|
||||||
|
$cert_type = 'kcp_v2-hp';
|
||||||
|
break;
|
||||||
case 'lg':
|
case 'lg':
|
||||||
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
$cert_url = G5_LGXPAY_URL.'/AuthOnlyReq.php';
|
||||||
$cert_type = 'lg-hp';
|
$cert_type = 'lg-hp';
|
||||||
|
|||||||
Reference in New Issue
Block a user