Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Commit

Permalink
KCP 웹표준 모듈 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
chicpro committed Apr 27, 2016
1 parent b7e1612 commit 9095c5e
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 141 deletions.
130 changes: 32 additions & 98 deletions shop/kcp/orderform.1.php
@@ -1,125 +1,59 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

/* ============================================================================== */
/* = Javascript source Include = */
/* = -------------------------------------------------------------------------- = */
/* = ※ 필수 = */
/* = -------------------------------------------------------------------------- = */

// kcp 전자결제를 사용할 때만 실행
if($default['de_iche_use'] || $default['de_vbank_use'] || $default['de_hp_use'] || $default['de_card_use'] || $default['de_easy_pay_use']) {
?>
<script src="<?php echo $g_conf_js_url; ?>"></script>
<?php
/* = -------------------------------------------------------------------------- = */
/* = Javascript source Include END = */
/* ============================================================================== */
?>
<script>
StartSmartUpdate();

function CheckPayplusInstall()
<script type="text/javascript">
/****************************************************************/
/* m_Completepayment 설명 */
/****************************************************************/
/* 인증완료시 재귀 함수 */
/* 해당 함수명은 절대 변경하면 안됩니다. */
/* 해당 함수의 위치는 payplus.js 보다먼저 선언되어여 합니다. */
/* Web 방식의 경우 리턴 값이 form 으로 넘어옴 */
/* EXE 방식의 경우 리턴 값이 json 으로 넘어옴 */
/****************************************************************/
function m_Completepayment( FormOrJson, closeEvent )
{
setTimeout("init_pay_button();",300);
}
var frm = document.forderform;

/* Payplus Plug-in 실행 */
function jsf__pay( form )
{
var RetVal = false;
/********************************************************************/
/* FormOrJson은 가맹점 임의 활용 금지 */
/* frm 값에 FormOrJson 값이 설정 됨 frm 값으로 활용 하셔야 됩니다. */
/* FormOrJson 값을 활용 하시려면 기술지원팀으로 문의바랍니다. */
/********************************************************************/
GetField( frm, FormOrJson );

/* Payplus Plugin 실행 */
if ( MakePayMessage( form ) == true )
if( frm.res_cd.value == "0000" )
{
//openwin = window.open( "./kcp/proc_win.html", "proc_win", "width=449, height=209, top=300, left=300" );
document.getElementById("display_pay_button").style.display = "none" ;
document.getElementById("display_pay_process").style.display = "" ;
RetVal = true ;
}

frm.submit();
}
else
{
/* res_cd와 res_msg변수에 해당 오류코드와 오류메시지가 설정됩니다.
ex) 고객이 Payplus Plugin에서 취소 버튼 클릭시 res_cd=3001, res_msg=사용자 취소
값이 설정됩니다.
*/
res_cd = document.forderform.res_cd.value ;
res_msg = document.forderform.res_msg.value ;
alert( "[" + frm.res_cd.value + "] " + frm.res_msg.value );

closeEvent();
}

return RetVal ;
}
</script>

// Payplus Plug-in 설치 안내

function init_pay_button()
<script src="<?php echo $g_conf_js_url; ?>"></script>
<script>
/* Payplus Plug-in 실행 */
function jsf__pay( form )
{
if ((navigator.userAgent.indexOf('MSIE') > 0) || (navigator.userAgent.indexOf('Trident/7.0') > 0))
try
{
try
{
if( document.Payplus.object == null )
{
document.getElementById("display_setup_message_top").style.display = "" ;
document.getElementById("display_setup_message").style.display = "" ;
document.getElementById("display_pay_button").style.display = "none" ;
//document.getElementById("display_setup_message").scrollIntoView();
}
else{
document.getElementById("display_setup_message_top").style.display = "none" ;
document.getElementById("display_setup_message").style.display = "none" ;
document.getElementById("display_pay_button").style.display = "" ;
}
}
catch (e)
{
document.getElementById("display_setup_message_top").style.display = "" ;
document.getElementById("display_setup_message").style.display = "" ;
document.getElementById("display_pay_button").style.display = "none" ;
//document.getElementById("display_setup_message").scrollIntoView();
}
KCP_Pay_Execute( form );
}
else
catch (e)
{
try
{
if( Payplus == null )
{
document.getElementById("display_setup_message_top").style.display = "" ;
document.getElementById("display_setup_message").style.display = "" ;
document.getElementById("display_pay_button").style.display = "none" ;
//document.getElementById("display_setup_message").scrollIntoView();
}
else{
document.getElementById("display_setup_message_top").style.display = "none" ;
document.getElementById("display_setup_message").style.display = "none" ;
document.getElementById("display_pay_button").style.display = "" ;
}
}
catch (e)
{
document.getElementById("display_setup_message_top").style.display = "" ;
document.getElementById("display_setup_message").style.display = "" ;
document.getElementById("display_pay_button").style.display = "none" ;
//document.getElementById("display_setup_message").scrollIntoView();
}
/* IE 에서 결제 정상종료시 throw로 스크립트 종료 */
}
}

function get_intall_file()
{
document.location.href = GetInstallFile();
return false;
}
</script>

<!-- Payplus Plug-in 설치 안내 -->
<p id="display_setup_message_top" class="display_setup_message" style="display:block">
<strong>결제안내</strong>
<span class="red">결제를 하시려면 상단의 노란색 표시줄을 클릭</span>하시거나, <a href="https://pay.kcp.co.kr/plugin_new/file/KCPPluginSetup.exe" onclick="return get_intall_file();"><span class="bold">[수동설치]</span></a>를 눌러 Payplus Plug-in을 설치하시기 바랍니다.<br>
[수동설치]를 눌러 설치하신 경우 <span class="red bold">새로고침(F5)키</span>를 눌러 진행하시기 바랍니다.
</p>

<?php } ?>
9 changes: 7 additions & 2 deletions shop/kcp/orderform.2.php
Expand Up @@ -10,7 +10,7 @@
?>
<input type="hidden" name="req_tx" value="pay">
<input type="hidden" name="site_cd" value="<?php echo $default['de_kcp_mid']; ?>">
<input type="hidden" name="site_name" value="<?php echo $default['de_admin_company_name']; ?>">
<input type="hidden" name="site_name" value="<?php echo $g_conf_site_name; ?>">
<input type="hidden" name="def_site_cd" value="<?php echo $default['de_kcp_mid']; ?>">

<?php
Expand Down Expand Up @@ -96,6 +96,11 @@
-->
<input type="hidden" name="good_expr" value="0">

<!-- 가맹점에서 관리하는 고객 아이디 설정을 해야 합니다.(필수 설정) -->
<input type="hidden" name="shop_user_id" value=""/>
<!-- 복지포인트 결제시 가맹점에 할당되어진 코드 값을 입력해야합니다.(필수 설정) -->
<input type="hidden" name="pt_memcorp_cd" value=""/>

<!-- 에스크로 항목 -->

<!-- 에스크로 사용 여부 : 반드시 Y 로 세팅 -->
Expand Down Expand Up @@ -185,7 +190,7 @@
<?php
}
?>
<input type="hidden" name="wish_vbank_list" value="05:03:04:07:11:23:26:32:34:81:71">
<input type="hidden" name="wish_vbank_list" value="">
<?php


Expand Down
28 changes: 3 additions & 25 deletions shop/kcp/orderform.3.php
@@ -1,34 +1,12 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

// kcp 전자결제를 사용할 때만 실행
if($default['de_iche_use'] || $default['de_vbank_use'] || $default['de_hp_use'] || $default['de_card_use'] || $default['de_easy_pay_use']) {
?>

<!-- Payplus Plug-in 설치 안내 시작 { -->
<p id="display_setup_message" class="display_setup_message" style="display:block">
<span class="red">결제를 계속 하시려면 상단의 노란색 표시줄을 클릭</span>하시거나 <a href="https://pay.kcp.co.kr/plugin_new/file/KCPPluginSetup.exe" onclick="return get_intall_file();"><b><u>[수동설치]</u></b></a>를 눌러 다운로드 된 Payplus Plug-in을 설치하시기 바랍니다.<br>
[수동설치]를 눌러 설치하신 경우 <span class="red bold">새로고침(F5)키</span>를 눌러 진행하시기 바랍니다.<br>
새로고침(F5) 한후에도 계속 설치파일이 다운로드 되거나 결제가 되지 않으면 브라우저를 새로 열어서 주문해 주시기 바랍니다.<br>
브라우저가 익스플로러가 아닌 경우 Payplus Plug-in 설치에 문제가 있을수 있음을 알려 드립니다.
</p>
<!-- } Payplus Plug-in 설치 안내 끝 -->
<?php } ?>

<div id="display_pay_button" class="btn_confirm" style="display:none">
<input type="submit" value="주문하기" onclick="return forderform_check(this.form);" class="btn_submit">
<div id="display_pay_button" class="btn_confirm">
<input type="button" value="주문하기" onclick="forderform_check(this.form);" class="btn_submit">
<a href="javascript:history.go(-1);" class="btn01">취소</a>
</div>
<div id="display_pay_process" style="display:none">
<img src="<?php echo G5_URL; ?>/shop/img/loading.gif" alt="">
<span>주문완료 중입니다. 잠시만 기다려 주십시오.</span>
</div>

<?php
// 무통장 입금만 사용할 때는 주문하기 버튼 보이게
if(!($default['de_iche_use'] || $default['de_vbank_use'] || $default['de_hp_use'] || $default['de_card_use'] || $default['de_easy_pay_use'])) {
?>
<script>
document.getElementById("display_pay_button").style.display = "" ;
</script>
<?php } ?>
</div>
16 changes: 14 additions & 2 deletions shop/kcp/pp_ax_hub.php
Expand Up @@ -23,6 +23,18 @@
/* ============================================================================== */
?>

<?php
/* ============================================================================== */
/* = POST 형식 체크부분 = */
/* = -------------------------------------------------------------------------- = */
if ( $_SERVER['REQUEST_METHOD'] != 'POST' )
{
echo('잘못된 경로로 접속하였습니다.');
exit;
}
/* ============================================================================== */
?>

<?php
/* ============================================================================== */
/* = 01. 지불 요청 정보 설정 = */
Expand Down Expand Up @@ -87,7 +99,7 @@
$commid = ""; // 통신사 코드
$mobile_no = ""; // 휴대폰 번호
/* = -------------------------------------------------------------------------- = */
$tk_shop_id = $_POST[ "tk_shop_id" ]; // 가맹점 고객 아이디
$shop_user_id = $_POST[ "shop_user_id" ]; // 가맹점 고객 아이디
$tk_van_code = ""; // 발급사 코드
$tk_app_no = ""; // 상품권 승인 번호
/* = -------------------------------------------------------------------------- = */
Expand Down Expand Up @@ -199,7 +211,7 @@
{
$c_PayPlus->mf_do_tx( $trace_no, $g_conf_home_dir, $g_conf_site_cd, $g_conf_site_key, $tran_cd, "",
$g_conf_gw_url, $g_conf_gw_port, "payplus_cli_slib", $ordr_idxx,
$cust_ip, "3" , 0, 0, $g_conf_key_dir, $g_conf_log_dir); // 응답 전문 처리
$cust_ip, $g_conf_log_level , 0, 0, $g_conf_key_dir, $g_conf_log_dir); // 응답 전문 처리

$res_cd = $c_PayPlus->m_res_cd; // 결과 코드
$res_msg = $c_PayPlus->m_res_msg; // 결과 메시지
Expand Down
2 changes: 1 addition & 1 deletion shop/kcp/pp_ax_hub_cancel.php
Expand Up @@ -64,7 +64,7 @@
$c_PayPlus->mf_do_tx( $tno, $g_conf_home_dir, $g_conf_site_cd,
$g_conf_site_key, $tran_cd, "",
$g_conf_gw_url, $g_conf_gw_port, "payplus_cli_slib",
$ordr_idxx, $cust_ip, "3" ,
$ordr_idxx, $cust_ip, $g_conf_log_level ,
0, 0, $g_conf_key_dir, $g_conf_log_dir);

$res_cd = $c_PayPlus->m_res_cd;
Expand Down
2 changes: 1 addition & 1 deletion shop/orderform.php
Expand Up @@ -40,7 +40,7 @@
$g5['body_script'] = ' onload="javascript:enable_click()"';
break;
default:
$g5['body_script'] = ' onload="CheckPayplusInstall();"';
$g5['body_script'] = '';
break;
}
}
Expand Down
6 changes: 3 additions & 3 deletions shop/orderform.sub.php
Expand Up @@ -1410,9 +1410,9 @@ function forderform_check(f)
f.rcvr_add2.value = f.od_b_addr2.value;

if(f.pay_method.value != "무통장") {
return jsf__pay( f );
jsf__pay( f );
} else {
return true;
f.submit();
}
<?php } ?>
<?php if($default['de_pg_service'] == 'lg') { ?>
Expand All @@ -1433,7 +1433,7 @@ function forderform_check(f)
<?php } ?>

if(f.LGD_CUSTOM_FIRSTPAY.value != "무통장") {
launchCrossPlatform(f);
launchCrossPlatform(f);
} else {
f.submit();
}
Expand Down
4 changes: 2 additions & 2 deletions shop/personalpayform.sub.php
Expand Up @@ -239,9 +239,9 @@ function forderform_check(f)
f.rcvr_mail.value = f.pp_email.value;

if(f.pay_method.value != "무통장") {
return jsf__pay( f );
jsf__pay( f );
} else {
return true;
f.submit();
}
<?php } ?>
<?php if($default['de_pg_service'] == 'lg') { ?>
Expand Down
13 changes: 6 additions & 7 deletions shop/settle_kcp.inc.php
@@ -1,8 +1,6 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

$test = "";

if ($default['de_card_test']) {
if ($default['de_escrow_use'] == 1) {
// 에스크로결제 테스트
Expand All @@ -15,10 +13,11 @@
$default['de_kcp_site_key'] = '3grptw1.zW0GSo4PQdaGvsF__';
}

$test = "_test";
$g_conf_js_url = 'https://testpay.kcp.co.kr/plugin/payplus_web.jsp';
}
else {
$default['de_kcp_mid'] = "SR".$default['de_kcp_mid'];
$g_conf_js_url = 'https://pay.kcp.co.kr/plugin/payplus_web.jsp';
}

$g_conf_home_dir = G5_SHOP_PATH.'/kcp';
Expand Down Expand Up @@ -63,8 +62,8 @@
alert('KCP SITE KEY를 입력해 주십시오.');
}

$g_conf_js_url = "https://pay.kcp.co.kr/plugin/payplus{$test}_un.js";

$g_conf_log_level = "3"; // 변경불가
$g_conf_gw_port = "8090"; // 포트번호(변경불가)
$g_conf_site_name = $default['de_admin_company_name'];
$g_conf_log_level = '3'; // 변경불가
$g_conf_gw_port = '8090'; // 포트번호(변경불가)
$module_type = '01'; // 변경불가
?>

0 comments on commit 9095c5e

Please sign in to comment.