first commit 2

This commit is contained in:
hmw1001
2026-06-11 18:47:38 +09:00
parent c768729ce6
commit 6f534e33a6
11095 changed files with 1595758 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_MOBILE_PATH.'/head.php');
+4
View File
@@ -0,0 +1,4 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_MOBILE_PATH.'/tail.php');
+59
View File
@@ -0,0 +1,59 @@
<?php
include_once('./_common.php');
if (! (isset($co['co_id']) && $co['co_id']))
alert('등록된 내용이 없습니다.');
$g5['title'] = $co['co_subject'];
include_once('./_head.php');
$co_content = $co['co_mobile_content'] ? $co['co_mobile_content'] : $co['co_content'];
$str = conv_content($co_content, $co['co_html'], $co['co_tag_filter_use']);
// $src 를 $dst 로 변환
$src = $dst = array();
$src[] = "/{{쇼핑몰명}}|{{홈페이지제목}}/";
$dst[] = $config['cf_title'];
if(isset($default) && isset($default['de_admin_company_name'])){
$src[] = "/{{회사명}}|{{상호}}/";
$dst[] = isset($default['de_admin_company_name']) ? $default['de_admin_company_name'] : '';
$src[] = "/{{대표자명}}/";
$dst[] = isset($default['de_admin_company_owner']) ? $default['de_admin_company_owner'] : '';
$src[] = "/{{사업자등록번호}}/";
$dst[] = isset($default['de_admin_company_saupja_no']) ? $default['de_admin_company_saupja_no'] : '';
$src[] = "/{{대표전화번호}}/";
$dst[] = isset($default['de_admin_company_tel']) ? $default['de_admin_company_tel'] : '';
$src[] = "/{{팩스번호}}/";
$dst[] = isset($default['de_admin_company_fax']) ? $default['de_admin_company_fax'] : '';
$src[] = "/{{통신판매업신고번호}}/";
$dst[] = isset($default['de_admin_company_tongsin_no']) ? $default['de_admin_company_tongsin_no'] : '';
$src[] = "/{{사업장우편번호}}/";
$dst[] = isset($default['de_admin_company_zip']) ? $default['de_admin_company_zip'] : '';
$src[] = "/{{사업장주소}}/";
$dst[] = isset($default['de_admin_company_addr']) ? $default['de_admin_company_addr'] : '';
$src[] = "/{{운영자명}}|{{관리자명}}/";
$dst[] = isset($default['de_admin_name']) ? $default['de_admin_name'] : '';
$src[] = "/{{운영자e-mail}}|{{관리자e-mail}}/i";
$dst[] = isset($default['de_admin_email']) ? $default['de_admin_email'] : '';
$src[] = "/{{정보관리책임자명}}/";
$dst[] = isset($default['de_admin_info_name']) ? $default['de_admin_info_name'] : '';
$src[] = "/{{정보관리책임자e-mail}}|{{정보책임자e-mail}}/i";
$dst[] = isset($default['de_admin_info_email']) ? $default['de_admin_info_email'] : '';
}
$str = preg_replace($src, $dst, $str);
// 스킨경로
if(trim($co['co_mobile_skin']) == '')
$co['co_mobile_skin'] = 'basic';
$content_skin_path = get_skin_path('content', $co['co_mobile_skin']);
$content_skin_url = get_skin_url('content', $co['co_mobile_skin']);
$skin_file = $content_skin_path.'/content.skin.php';
if(is_file($skin_file)) {
include($skin_file);
} else {
echo '<p>'.str_replace(G5_PATH.'/', '', $skin_file).'이 존재하지 않습니다.</p>';
}
include_once('./_tail.php');
+34
View File
@@ -0,0 +1,34 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if(!$is_admin && $group['gr_device'] == 'pc')
alert($group['gr_subject'].' 그룹은 PC에서만 접근할 수 있습니다.');
include_once(G5_MOBILE_PATH.'/_head.php');
?>
<!-- 메인화면 최신글 시작 -->
<?php
// 최신글
$sql = " select bo_table, bo_subject
from {$g5['board_table']}
where gr_id = '{$gr_id}'
and bo_list_level <= '{$member['mb_level']}'
and bo_device <> 'pc' ";
if(!$is_admin)
$sql .= " and bo_use_cert = '' ";
$sql .= " order by bo_order ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 이 함수가 바로 최신글을 추출하는 역할을 합니다.
// 스킨은 입력하지 않을 경우 관리자 > 환경설정의 최신글 스킨경로를 기본 스킨으로 합니다.
// 사용방법
// latest(스킨, 게시판아이디, 출력라인, 글자수);
echo latest('basic', $row['bo_table'], 5, 70);
}
?>
<!-- 메인화면 최신글 끝 -->
<?php
include_once(G5_MOBILE_PATH.'/_tail.php');
+193
View File
@@ -0,0 +1,193 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if(defined('G5_THEME_PATH')) {
require_once(G5_THEME_PATH.'/head.php');
return;
}
include_once(G5_PATH.'/head.sub.php');
include_once(G5_LIB_PATH.'/latest.lib.php');
include_once(G5_LIB_PATH.'/outlogin.lib.php');
include_once(G5_LIB_PATH.'/poll.lib.php');
include_once(G5_LIB_PATH.'/visit.lib.php');
include_once(G5_LIB_PATH.'/connect.lib.php');
include_once(G5_LIB_PATH.'/popular.lib.php');
?>
<header id="hd">
<h1 id="hd_h1"><?php echo $g5['title'] ?></h1>
<div class="to_content"><a href="#container">본문 바로가기</a></div>
<?php
if(defined('_INDEX_')) { // index에서만 실행
include G5_MOBILE_PATH.'/newwin.inc.php'; // 팝업레이어
} ?>
<div id="hd_wrapper">
<div id="logo">
<a href="<?php echo G5_URL ?>"><img src="<?php echo G5_IMG_URL ?>/m_logo.png" alt="<?php echo $config['cf_title']; ?>"></a>
</div>
<button type="button" id="gnb_open" class="hd_opener"><i class="fa fa-bars" aria-hidden="true"></i><span class="sound_only"> 메뉴열기</span></button>
<div id="gnb" class="hd_div">
<button type="button" id="gnb_close" class="hd_closer"><span class="sound_only">메뉴 닫기</span><i class="fa fa-times" aria-hidden="true"></i></button>
<?php echo outlogin('basic'); // 외부 로그인 ?>
<ul id="gnb_1dul">
<?php
$menu_datas = get_menu_db(1, true);
$i = 0;
foreach( $menu_datas as $row ){
if( empty($row) ) continue;
?>
<li class="gnb_1dli">
<a href="<?php echo $row['me_link']; ?>" target="_<?php echo $row['me_target']; ?>" class="gnb_1da"><?php echo $row['me_name'] ?></a>
<?php
$k = 0;
foreach( (array) $row['sub'] as $row2 ){
if( empty($row2) ) continue;
if($k == 0)
echo '<button type="button" class="btn_gnb_op"><span class="sound_only">하위분류</span></button><ul class="gnb_2dul">'.PHP_EOL;
?>
<li class="gnb_2dli"><a href="<?php echo $row2['me_link']; ?>" target="_<?php echo $row2['me_target']; ?>" class="gnb_2da"><span></span><?php echo $row2['me_name'] ?></a></li>
<?php
$k++;
} //end foreach $row2
if($k > 0)
echo '</ul>'.PHP_EOL;
?>
</li>
<?php
$i++;
} //end foreach $row
if ($i == 0) { ?>
<li id="gnb_empty">메뉴 준비 중입니다.<?php if ($is_admin) { ?> <br><a href="<?php echo G5_ADMIN_URL; ?>/menu_list.php">관리자모드 &gt; 환경설정 &gt; 메뉴설정</a>에서 설정하세요.<?php } ?></li>
<?php } ?>
<?php if (defined('G5_USE_SHOP') && G5_USE_SHOP) { ?>
<li class="gnb_1dli"><a href="<?php echo G5_SHOP_URL ?>" class="gnb_1da"> 쇼핑몰</a></li>
<?php } ?>
</ul>
<ul id="hd_nb">
<li class="hd_nb1"><a href="<?php echo G5_BBS_URL ?>/faq.php" id="snb_faq"><i class="fa fa-question" aria-hidden="true"></i>FAQ</a></li>
<li class="hd_nb2"><a href="<?php echo G5_BBS_URL ?>/qalist.php" id="snb_qa"><i class="fa fa-comments" aria-hidden="true"></i>1:1문의</a></li>
<li class="hd_nb3"><a href="<?php echo G5_BBS_URL ?>/current_connect.php" id="snb_cnt"><i class="fa fa-users" aria-hidden="true"></i>접속자 <span><?php echo connect('basic'); // 현재 접속자수 ?></span></a></li>
<li class="hd_nb4"><a href="<?php echo G5_BBS_URL ?>/new.php" id="snb_new"><i class="fa fa-history" aria-hidden="true"></i>새글</a></li>
</ul>
</div>
<button type="button" id="user_btn" class="hd_opener"><i class="fa fa-search" aria-hidden="true"></i><span class="sound_only">사용자메뉴</span></button>
<div class="hd_div" id="user_menu">
<button type="button" id="user_close" class="hd_closer"><span class="sound_only">메뉴 닫기</span><i class="fa fa-times" aria-hidden="true"></i></button>
<div id="hd_sch">
<h2>사이트 내 전체검색</h2>
<form name="fsearchbox" action="<?php echo G5_BBS_URL ?>/search.php" onsubmit="return fsearchbox_submit(this);" method="get">
<input type="hidden" name="sfl" value="wr_subject||wr_content">
<input type="hidden" name="sop" value="and">
<input type="text" name="stx" id="sch_stx" placeholder="검색어를 입력해주세요" required maxlength="20">
<button type="submit" value="검색" id="sch_submit"><i class="fa fa-search" aria-hidden="true"></i><span class="sound_only">검색</span></button>
</form>
<script>
function fsearchbox_submit(f)
{
var stx = f.stx.value.trim();
if (stx.length < 2) {
alert("검색어는 두글자 이상 입력하십시오.");
f.stx.select();
f.stx.focus();
return false;
}
// 검색에 많은 부하가 걸리는 경우 이 주석을 제거하세요.
var cnt = 0;
for (var i = 0; i < stx.length; i++) {
if (stx.charAt(i) == ' ')
cnt++;
}
if (cnt > 1) {
alert("빠른 검색을 위하여 검색어에 공백은 한개만 입력할 수 있습니다.");
f.stx.select();
f.stx.focus();
return false;
}
f.stx.value = stx;
return true;
}
</script>
</div>
<?php echo popular('basic'); // 인기검색어 ?>
<div id="text_size">
<!-- font_resize('엘리먼트id', '제거할 class', '추가할 class'); -->
<button id="size_down" onclick="font_resize('container', 'ts_up ts_up2', '', this);" class="select"><img src="<?php echo G5_URL; ?>/img/ts01.png" width="20" alt="기본"></button>
<button id="size_def" onclick="font_resize('container', 'ts_up ts_up2', 'ts_up', this);"><img src="<?php echo G5_URL; ?>/img/ts02.png" width="20" alt="크게"></button>
<button id="size_up" onclick="font_resize('container', 'ts_up ts_up2', 'ts_up2', this);"><img src="<?php echo G5_URL; ?>/img/ts03.png" width="20" alt="더크게"></button>
</div>
</div>
<script>
$(function () {
//폰트 크기 조정 위치 지정
var font_resize_class = get_cookie("ck_font_resize_add_class");
if( font_resize_class == 'ts_up' ){
$("#text_size button").removeClass("select");
$("#size_def").addClass("select");
} else if (font_resize_class == 'ts_up2') {
$("#text_size button").removeClass("select");
$("#size_up").addClass("select");
}
$(".hd_opener").on("click", function() {
var $this = $(this);
var $hd_layer = $this.next(".hd_div");
if($hd_layer.is(":visible")) {
$hd_layer.hide();
$this.find("span").text("열기");
} else {
var $hd_layer2 = $(".hd_div:visible");
$hd_layer2.prev(".hd_opener").find("span").text("열기");
$hd_layer2.hide();
$hd_layer.show();
$this.find("span").text("닫기");
}
});
$("#container").on("click", function() {
$(".hd_div").hide();
});
$(".btn_gnb_op").click(function(){
$(this).toggleClass("btn_gnb_cl").next(".gnb_2dul").slideToggle(300);
});
$(".hd_closer").on("click", function() {
var idx = $(".hd_closer").index($(this));
$(".hd_div:visible").hide();
$(".hd_opener:eq("+idx+")").find("span").text("열기");
});
});
</script>
</div>
</header>
<div id="wrapper">
<div id="container">
<?php if (!defined("_INDEX_")) { ?>
<h2 id="container_title" class="top" title="<?php echo get_text($g5['title']); ?>">
<a href="javascript:history.back();"><i class="fa fa-chevron-left" aria-hidden="true"></i><span class="sound_only">뒤로가기</span></a> <?php echo get_head_title($g5['title']); ?>
</h2>
<?php }
+35
View File
@@ -0,0 +1,35 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
if(defined('G5_THEME_PATH')) {
require_once(G5_THEME_PATH.'/index.php');
return;
}
include_once(G5_MOBILE_PATH.'/head.php');
?>
<!-- 메인화면 최신글 시작 -->
<?php
// 최신글
$sql = " select bo_table
from `{$g5['board_table']}` a left join `{$g5['group_table']}` b on (a.gr_id=b.gr_id)
where a.bo_device <> 'pc' ";
if(!$is_admin) {
$sql .= " and a.bo_use_cert = '' ";
}
$sql .= " order by b.gr_order, a.bo_order ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
// 이 함수가 바로 최신글을 추출하는 역할을 합니다.
// 스킨은 입력하지 않을 경우 관리자 > 환경설정의 최신글 스킨경로를 기본 스킨으로 합니다.
// 사용방법
// latest(스킨, 게시판아이디, 출력라인, 글자수);
echo latest('basic', $row['bo_table'], 12, 25);
}
?>
<!-- 메인화면 최신글 끝 -->
<?php
include_once(G5_MOBILE_PATH.'/tail.php');
+58
View File
@@ -0,0 +1,58 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!defined('_SHOP_')) {
$pop_division = 'comm';
} else {
$pop_division = 'shop';
}
$sql = " select * from {$g5['new_win_table']}
where '".G5_TIME_YMDHIS."' between nw_begin_time and nw_end_time
and nw_device IN ( 'both', 'mobile' ) and nw_division IN ( 'both', '".$pop_division."' )
order by nw_id asc ";
$result = sql_query($sql, false);
?>
<!-- 팝업레이어 시작 { -->
<div id="hd_pop">
<h2>팝업레이어 알림</h2>
<?php
for ($i=0; $nw=sql_fetch_array($result); $i++)
{
// 이미 체크 되었다면 Continue
if (isset($_COOKIE["hd_pops_{$nw['nw_id']}"]) && $_COOKIE["hd_pops_{$nw['nw_id']}"])
continue;
?>
<div id="hd_pops_<?php echo $nw['nw_id'] ?>" class="hd_pops" style="top:<?php echo $nw['nw_top']?>px;left:<?php echo $nw['nw_left']?>px;">
<div class="hd_pops_con" style="width:<?php echo $nw['nw_width'] ?>px;height:<?php echo $nw['nw_height'] ?>px">
<?php echo conv_content($nw['nw_content'], 1); ?>
</div>
<div class="hd_pops_footer">
<button class="hd_pops_reject hd_pops_<?php echo $nw['nw_id']; ?> <?php echo $nw['nw_disable_hours']; ?>"><strong><?php echo $nw['nw_disable_hours']; ?></strong>시간 동안 다시 열람하지 않습니다.</button>
<button class="hd_pops_close hd_pops_<?php echo $nw['nw_id']; ?>">닫기</button>
</div>
</div>
<?php }
if ($i == 0) echo '<span class="sound_only">팝업레이어 알림이 없습니다.</span>';
?>
</div>
<script>
$(function() {
$(".hd_pops_reject").click(function() {
var id = $(this).attr('class').split(' ');
var ck_name = id[1];
var exp_time = parseInt(id[2]);
$("#"+id[1]).css("display", "none");
set_cookie(ck_name, 1, exp_time, g5_cookie_domain);
});
$('.hd_pops_close').click(function() {
var idb = $(this).attr('class').split(' ');
$('#'+idb[1]).css('display','none');
});
});
</script>
<!-- } 팝업레이어 끝 -->
+19
View File
@@ -0,0 +1,19 @@
<?php
include_once('../../common.php');
if (isset($_REQUEST['sort'])) {
$sort = trim($_REQUEST['sort']);
$sort = preg_replace("/[\<\>\'\"\\\'\\\"\%\=\(\)\s]/", "", $sort);
} else {
$sort = '';
}
if (isset($_REQUEST['sortodr'])) {
$sortodr = preg_match("/^(asc|desc)$/i", $sortodr) ? $sortodr : '';
} else {
$sortodr = '';
}
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP)
die('<p>쇼핑몰 설치 후 이용해 주십시오.</p>');
define('_SHOP_', true);
+3
View File
@@ -0,0 +1,3 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_MSHOP_PATH.'/shop.head.php');
+3
View File
@@ -0,0 +1,3 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_MSHOP_PATH.'/shop.tail.php');
+276
View File
@@ -0,0 +1,276 @@
<?php
include_once('./_common.php');
$cart_action_url = G5_SHOP_URL.'/cartupdate.php';
// 테마에 cart.php 있으면 include
if(defined('G5_THEME_MSHOP_PATH')) {
$theme_cart_file = G5_THEME_MSHOP_PATH.'/cart.php';
if(is_file($theme_cart_file)) {
include_once($theme_cart_file);
return;
unset($theme_cart_file);
}
}
$g5['title'] = '장바구니';
include_once(G5_MSHOP_PATH.'/_head.php');
// $s_cart_id 로 현재 장바구니 자료 쿼리
$sql = " select a.ct_id,
a.it_id,
a.it_name,
a.ct_price,
a.ct_point,
a.ct_qty,
a.ct_status,
a.ct_send_cost,
a.it_sc_type,
b.ca_id
from {$g5['g5_shop_cart_table']} a left join {$g5['g5_shop_item_table']} b on ( a.it_id = b.it_id )
where a.od_id = '$s_cart_id' ";
$sql .= " group by a.it_id ";
$sql .= " order by a.ct_id ";
$result = sql_query($sql);
$cart_count = sql_num_rows($result);
?>
<script src="<?php echo G5_JS_URL; ?>/shop.js?ver=<?php echo G5_JS_VER; ?>"></script>
<script src="<?php echo G5_JS_URL; ?>/shop.override.js?ver=<?php echo G5_JS_VER; ?>"></script>
<div id="sod_bsk">
<form name="frmcartlist" id="sod_bsk_list" class="2017_renewal_itemform" method="post" action="<?php echo $cart_action_url; ?>">
<?php if($cart_count) { ?>
<div id="sod_chk" class="chk_box">
<input type="checkbox" name="ct_all" value="1" id="ct_all" class="selec_chk" checked>
<label for="ct_all"><span></span>상품 전체</label>
</div>
<?php } ?>
<ul class="sod_list">
<?php
$tot_point = 0;
$tot_sell_price = 0;
$it_send_cost = 0;
for ($i=0; $row=sql_fetch_array($result); $i++)
{
// 합계금액 계산
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,
SUM(ct_point * ct_qty) as point,
SUM(ct_qty) as qty
from {$g5['g5_shop_cart_table']}
where it_id = '{$row['it_id']}'
and od_id = '$s_cart_id' ";
$sum = sql_fetch($sql);
if ($i==0) { // 계속쇼핑
$continue_ca_id = $row['ca_id'];
}
$a1 = '<a href="'.shop_item_url($row['it_id']).'"><strong>';
$a2 = '</strong></a>';
$image_width = 65;
$image_height = 65;
$image = get_it_image($row['it_id'], $image_width, $image_height);
$it_name = $a1 . stripslashes($row['it_name']) . $a2;
$it_options = print_item_options($row['it_id'], $s_cart_id);
if($it_options) {
$mod_options = '<button type="button" id="mod_opt_'.$row['it_id'].'" class="mod_btn mod_options">선택사항수정</button>';
// $it_name .= ;
}
// 배송비
switch($row['ct_send_cost'])
{
case 1:
$ct_send_cost = '착불';
break;
case 2:
$ct_send_cost = '무료';
break;
default:
$ct_send_cost = '선불';
break;
}
// 조건부무료
if($row['it_sc_type'] == 2) {
$sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $s_cart_id);
if($sendcost == 0)
$ct_send_cost = '무료';
}
$point = $sum['point'];
$sell_price = $sum['price'];
?>
<li class="sod_li">
<input type="hidden" name="it_id[<?php echo $i; ?>]" value="<?php echo $row['it_id']; ?>">
<input type="hidden" name="it_name[<?php echo $i; ?>]" value="<?php echo get_text($row['it_name']); ?>">
<div class="li_op_wr">
<div class="li_chk chk_box">
<input type="checkbox" name="ct_chk[<?php echo $i; ?>]" value="1" id="ct_chk_<?php echo $i; ?>" class="selec_chk" checked>
<label for="ct_chk_<?php echo $i; ?>"><span></span><b class="sound_only">상품선택</b></label>
</div>
<div class="li_name"><?php echo $it_name; ?></div>
<div class="total_img"><?php echo $image; ?></div>
<div class="li_mod"><?php echo $mod_options; ?></div>
</div>
<div class="sod_opt"><?php echo $it_options; ?></div>
<div class="li_prqty">
<span class="prqty_price li_prqty_sp"><span>판매가 </span><?php echo number_format($row['ct_price']); ?></span>
<span class="prqty_qty li_prqty_sp"><span>수량 </span><?php echo number_format($sum['qty']); ?></span>
<span class="prqty_sc li_prqty_sp"><span>배송비 </span><?php echo $ct_send_cost; ?></span>
<span class="total_point li_prqty_sp"><span>적립포인트 </span><strong><?php echo number_format($sum['point']); ?></strong></span>
</div>
<div class="total_price total_span"><span>소계 </span><strong><?php echo number_format($sell_price); ?></strong>원</div>
</li>
<?php
$tot_point += $point;
$tot_sell_price += $sell_price;
} // for 끝
if ($i == 0) {
echo '<li class="empty_list">장바구니에 담긴 상품이 없습니다.</li>';
} else {
// 배송비 계산
$send_cost = get_sendcost($s_cart_id, 0);
}
?>
</ul>
<div class="btn_del_wr">
<button type="button" onclick="return form_check('seldelete');" class="btn01">선택삭제</button>
<button type="button" onclick="return form_check('alldelete');" class="btn01">비우기</button>
</div>
<?php if ($i == 0) { ?>
<div class="go_shopping"><a href="<?php echo G5_SHOP_URL; ?>/" class="btn01">쇼핑 계속하기</a></div>
<?php } else { ?>
<div class="sod_ta_wr">
<?php
$tot_price = $tot_sell_price + $send_cost; // 총계 = 주문상품금액합계 + 배송비
if ($tot_price > 0 || $send_cost > 0) {
?>
<dl id="m_sod_bsk_tot">
<?php if ($send_cost > 0) { // 배송비가 0 보다 크다면 (있다면) ?>
<dt class="sod_bsk_dvr">배송비</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($send_cost); ?> 원</strong></dd>
<?php } ?>
<?php if ($tot_price > 0) { ?>
<dt>포인트</dt>
<dd><strong><?php echo number_format($tot_point); ?> 점</strong></dd>
<dt class="sod_bsk_cnt">총계</dt>
<dd class="sod_bsk_cnt"><strong><?php echo number_format($tot_price); ?></strong> 원</dd>
<?php } ?>
</dl>
<?php } ?>
<div id="sod_bsk_act" class="btn_confirm">
<div class="total">총계 <strong class="total_cnt"><?php echo number_format($tot_price); ?>원</strong></div>
<input type="hidden" name="url" value="<?php echo G5_SHOP_URL; ?>/orderform.php">
<input type="hidden" name="act" value="">
<input type="hidden" name="records" value="<?php echo $i; ?>">
<button type="button" onclick="return form_check('buy');" class="btn_submit">주문하기</button>
</div>
</div>
<?php } ?>
<?php if ($naverpay_button_js) { ?>
<div class="naverpay-cart"><?php echo $naverpay_request_js.$naverpay_button_js; ?></div>
<?php } ?>
</form>
</div>
<script>
$(function() {
var close_btn_idx;
// 선택사항수정
$(".mod_options").click(function() {
var it_id = $(this).attr("id").replace("mod_opt_", "");
var $this = $(this);
close_btn_idx = $(".mod_options").index($(this));
$.post(
"./cartoption.php",
{ it_id: it_id },
function(data) {
$("#mod_option_frm").remove();
$this.after("<div id=\"mod_option_frm\"></div><div class=\"mod_option_bg\"></div>");
$("#mod_option_frm").html(data);
price_calculate();
}
);
});
// 모두선택
$("input[name=ct_all]").click(function() {
if($(this).is(":checked"))
$("input[name^=ct_chk]").attr("checked", true);
else
$("input[name^=ct_chk]").attr("checked", false);
});
// 옵션수정 닫기
$(document).on("click", "#mod_option_close", function() {
$("#mod_option_frm, .mod_option_bg").remove();
$("#win_mask, .window").hide();
$(".mod_options").eq(close_btn_idx).focus();
});
$("#win_mask").click(function () {
$("#mod_option_frm").remove();
$("#win_mask").hide();
$(".mod_options").eq(close_btn_idx).focus();
});
});
function fsubmit_check(f) {
if($("input[name^=ct_chk]:checked").length < 1) {
alert("구매하실 상품을 하나이상 선택해 주십시오.");
return false;
}
return true;
}
function form_check(act) {
var f = document.frmcartlist;
var cnt = f.records.value;
if (act == "buy")
{
f.act.value = act;
f.submit();
}
else if (act == "alldelete")
{
f.act.value = act;
f.submit();
}
else if (act == "seldelete")
{
if($("input[name^=ct_chk]:checked").length < 1) {
alert("삭제하실 상품을 하나이상 선택해 주십시오.");
return false;
}
f.act.value = act;
f.submit();
}
return true;
}
</script>
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
+167
View File
@@ -0,0 +1,167 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
function get_mshop_category($ca_id, $len)
{
global $g5;
$sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']}
where ca_use = '1' ";
if($ca_id)
$sql .= " and ca_id like '$ca_id%' ";
$sql .= " and length(ca_id) = '$len' order by ca_order, ca_id ";
return $sql;
}
$mshop_categories = get_shop_category_array(true);
?>
<div id="category" class="menu">
<div class="menu_wr">
<?php echo outlogin('shop_basic'); // 외부 로그인 ?>
<div class="content">
<?php
$i = 0;
foreach($mshop_categories as $cate1){
if( empty($cate1) ) continue;
$mshop_ca_row1 = $cate1['text'];
if($i == 0)
echo '<ul class="cate">'.PHP_EOL;
?>
<li>
<a href="<?php echo $mshop_ca_row1['url']; ?>"><?php echo get_text($mshop_ca_row1['ca_name']); ?></a>
<?php
if( count($cate1) > 1 )
echo '<button class="sub_ct_toggle ct_op">'.get_text($mshop_ca_row1['ca_name']).' 하위분류 열기</button>'.PHP_EOL;
$j=0;
foreach($cate1 as $key=>$cate2){
if( empty($cate2) || $key === 'text' ) continue;
$mshop_ca_row2 = $cate2['text'];
if($j == 0)
echo '<ul class="sub_cate sub_cate1">'.PHP_EOL;
?>
<li>
<a href="<?php echo $mshop_ca_row2['url']; ?>"><?php echo get_text($mshop_ca_row2['ca_name']); ?></a>
<?php
$mshop_ca_res3 = sql_query(get_mshop_category($mshop_ca_row2['ca_id'], 6));
if( count($cate2) > 1 )
echo '<button type="button" class="sub_ct_toggle ct_op">'.get_text($mshop_ca_row2['ca_name']).' 하위분류 열기</button>'.PHP_EOL;
$k = 0;
foreach($cate2 as $cate3_key=>$cate3){
if( empty($cate2) || $cate3_key === 'text' ) continue;
$mshop_ca_row3 = $cate3['text'];
if($k == 0)
echo '<ul class="sub_cate sub_cate2">'.PHP_EOL;
?>
<li>
<a href="<?php echo $mshop_ca_row3['url']; ?>"><?php echo get_text($mshop_ca_row3['ca_name']); ?></a>
<?php
$mshop_ca_res4 = sql_query(get_mshop_category($mshop_ca_row3['ca_id'], 8));
if(sql_num_rows($mshop_ca_res4))
echo '<button type="button" class="sub_ct_toggle ct_op">'.get_text($mshop_ca_row3['ca_name']).' 하위분류 열기</button>'.PHP_EOL;
for($m=0; $mshop_ca_row4=sql_fetch_array($mshop_ca_res4); $m++) {
if($m == 0)
echo '<ul class="sub_cate sub_cate3">'.PHP_EOL;
?>
<li>
<a href="<?php echo $mshop_ca_href.$mshop_ca_row4['ca_id']; ?>"><?php echo get_text($mshop_ca_row4['ca_name']); ?></a>
<?php
$mshop_ca_res5 = sql_query(get_mshop_category($mshop_ca_row4['ca_id'], 10));
if(sql_num_rows($mshop_ca_res5))
echo '<button type="button" class="sub_ct_toggle ct_op">'.get_text($mshop_ca_row4['ca_name']).' 하위분류 열기</button>'.PHP_EOL;
for($n=0; $mshop_ca_row5=sql_fetch_array($mshop_ca_res5); $n++) {
if($n == 0)
echo '<ul class="sub_cate sub_cate4">'.PHP_EOL;
?>
<li>
<a href="<?php echo $mshop_ca_href.$mshop_ca_row5['ca_id']; ?>"><?php echo get_text($mshop_ca_row5['ca_name']); ?></a>
</li>
<?php
}
if($n > 0)
echo '</ul>'.PHP_EOL;
?>
</li>
<?php
}
if($m > 0)
echo '</ul>'.PHP_EOL;
?>
</li>
<?php
$k++;
}
if($k > 0)
echo '</ul>'.PHP_EOL;
?>
</li>
<?php
$j++;
}
if($j > 0)
echo '</ul>'.PHP_EOL;
?>
</li>
<?php
$i++;
} // end for
if($i > 0)
echo '</ul>'.PHP_EOL;
else
echo '<p>등록된 분류가 없습니다.</p>'.PHP_EOL;
?>
</div>
<?php include(G5_MSHOP_SKIN_PATH.'/boxtodayview.skin.php'); // 오늘 본 상품 ?>
<ul id="cate_tnb">
<li><a href="<?php echo G5_SHOP_URL; ?>/couponzone.php"><i class="fa fa-ticket"></i> 쿠폰존</a></li>
<li><a href="<?php echo G5_SHOP_URL; ?>/itemuselist.php"><i class="fa fa-camera"></i> 사용후기</a></li>
<li><a href="<?php echo G5_BBS_URL; ?>/faq.php"><i class="fa fa-question"></i>FAQ</a></li>
<li><a href="<?php echo G5_BBS_URL; ?>/qalist.php"><i class="fa fa-comments"></i>1:1문의</a></li>
<li><a href="<?php echo G5_SHOP_URL; ?>/personalpay.php"><i class="fa fa-credit-card"></i>개인결제</a></li>
<li><a href="<?php echo G5_URL; ?>"><i class="fa fa-home"></i>커뮤니티</a></li>
</ul>
</div>
</div>
<script>
jQuery(function ($){
$("button.sub_ct_toggle").on("click", function() {
var $this = $(this);
$sub_ul = $(this).closest("li").children("ul.sub_cate");
if($sub_ul.length > 0) {
var txt = $this.text();
if($sub_ul.is(":visible")) {
txt = txt.replace(/닫기$/, "열기");
$this
.removeClass("ct_cl")
.text(txt);
} else {
txt = txt.replace(/열기$/, "닫기");
$this
.addClass("ct_cl")
.text(txt);
}
$sub_ul.toggle();
}
});
});
</script>
+81
View File
@@ -0,0 +1,81 @@
<?php
include_once('./_common.php');
// 테마에 coupon.php 있으면 include
if(defined('G5_THEME_MSHOP_PATH')) {
$theme_coupon_file = G5_THEME_MSHOP_PATH.'/coupon.php';
if(is_file($theme_coupon_file)) {
include_once($theme_coupon_file);
return;
unset($theme_coupon_file);
}
}
if ($is_guest)
alert_close('회원만 조회하실 수 있습니다.');
$g5['title'] = $member['mb_nick'].' 님의 쿠폰 내역';
include_once(G5_PATH.'/head.sub.php');
$sql = " select cp_id, cp_subject, cp_method, cp_target, cp_start, cp_end, cp_type, cp_price
from {$g5['g5_shop_coupon_table']}
where mb_id IN ( '{$member['mb_id']}', '전체회원' )
and cp_start <= '".G5_TIME_YMD."'
and cp_end >= '".G5_TIME_YMD."'
order by cp_no ";
$result = sql_query($sql);
?>
<!-- 쿠폰 내역 시작 { -->
<div id="scp_list" class="new_win">
<h1 id="win_title"><?php echo $g5['title'] ?></h1>
<ul>
<?php
$cp_count = 0;
for($i=0; $row=sql_fetch_array($result); $i++) {
if(is_used_coupon($member['mb_id'], $row['cp_id']))
continue;
if($row['cp_method'] == 1) {
$sql = " select ca_name from {$g5['g5_shop_category_table']} where ca_id = '{$row['cp_target']}' ";
$ca = sql_fetch($sql);
$cp_target = $ca['ca_name'].'의 상품할인';
} else if($row['cp_method'] == 2) {
$cp_target = '결제금액 할인';
} else if($row['cp_method'] == 3) {
$cp_target = '배송비 할인';
} else {
$it = get_shop_item($row['cp_target'], true);
$cp_target = $it['it_name'].' 상품할인';
}
if($row['cp_type'])
$cp_price = '<strong>'.$row['cp_price'].'</strong> %';
else
$cp_price = '<strong>'.number_format($row['cp_price']).'</strong> 원';
$cp_count++;
?>
<li>
<div class="cou_top">
<div class="cou_tit"><?php echo $row['cp_subject']; ?></div>
<span class="cou_pri"><?php echo $cp_price; ?></span>
</div>
<div>
<span class="cou_target"><?php echo $cp_target; ?> <i class="fa fa-angle-right" aria-hidden="true"></i></span>
<span class="cou_date"><i class="fa fa-clock-o" aria-hidden="true"></i> <?php echo substr($row['cp_start'], 2, 8); ?> ~ <i class="fa fa-clock-o" aria-hidden="true"></i> <?php echo substr($row['cp_end'], 2, 8); ?></span>
</div>
</li>
<?php
}
if(!$cp_count)
echo '<li class="empty_list">사용할 수 있는 쿠폰이 없습니다.</li>';
?>
</ul>
<div class="win_btn"><button type="button" onclick="window.close();" class="btn_close">창닫기</button></div>
</div>
<?php
include_once(G5_PATH.'/tail.sub.php');
+96
View File
@@ -0,0 +1,96 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once('./_common.php');
if (!defined('_SHOP_COMMON_')) exit; // 모바일 페이지로 직접 접근하는 것을 막음
$ev_id = isset($_GET['ev_id']) ? (int) $_GET['ev_id'] : 0;
$sql = " select * from {$g5['g5_shop_event_table']}
where ev_id = '$ev_id'
and ev_use = 1 ";
$ev = sql_fetch($sql);
if (! (isset($ev['ev_id']) && $ev['ev_id']))
alert('등록된 이벤트가 없습니다.');
$g5['title'] = $ev['ev_subject'];
include_once(G5_MSHOP_PATH.'/_head.php');
if ($is_admin)
echo '<div class="sev_admin"><a href="'.G5_ADMIN_URL.'/shop_admin/itemeventform.php?w=u&amp;ev_id='.$ev['ev_id'].'" class="btn_admin">이벤트 관리</a></div>';
?>
<div id="sev_list">
<!-- 이벤트 시작 { -->
<?php
// 상단 HTML
echo '<div id="sev_hhtml">'.conv_content($ev['ev_head_html'], 1).'</div>';
// 상품 출력순서가 있다면
if ($sort != "")
$order_by = $sort.' '.$sortodr.' , b.it_order, b.it_id desc';
else
$order_by = 'b.it_order, b.it_id desc';
if ($skin) {
$skin = preg_replace(array('#\.+(\/|\\\)#', '#[\'\"]#'), array('', ''), $skin);
$ev['ev_skin'] = $skin;
}
define('G5_SHOP_CSS_URL', G5_MSHOP_SKIN_URL);
// 리스트 유형별로 출력
$list_file = G5_SHOP_SKIN_PATH."/{$ev['ev_mobile_skin']}";
if (file_exists($list_file))
{
include G5_MSHOP_SKIN_PATH.'/list.sort.skin.php';
// 총몇개 = 한줄에 몇개 * 몇줄
$items = $ev['ev_mobile_list_mod'] * $ev['ev_mobile_list_row'];
// 페이지가 없으면 첫 페이지 (1 페이지)
if ($page < 1) $page = 1;
// 시작 레코드 구함
$from_record = ($page - 1) * $items;
$list = new item_list(G5_MSHOP_SKIN_PATH.'/'.$ev['ev_mobile_skin'], $ev['ev_mobile_list_mod'], $ev['ev_mobile_list_row'], $ev['ev_mobile_img_width'], $ev['ev_mobile_img_height']);
$list->set_event($ev['ev_id']);
$list->set_is_page(true);
$list->set_mobile(true);
$list->set_order_by($order_by);
$list->set_from_record($from_record);
$list->set_view('it_img', true);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', true);
$list->set_view('sns', true);
echo $list->run();
// where 된 전체 상품수
$total_count = $list->total_count;
// 전체 페이지 계산
$total_page = ceil($total_count / $items);
}
else
{
echo '<div align="center">'.$ev['ev_mobile_skin'].' 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</div>';
}
?>
<?php
$qstr .= 'skin='.$skin.'&amp;ev_id='.$ev_id.'&amp;sort='.$sort.'&amp;sortodr='.$sortodr;
echo get_paging($config['cf_mobile_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&amp;page=");
?>
<?php
// 하단 HTML
echo '<div id="sev_thtml">'.conv_content($ev['ev_tail_html'], 1).'</div>';
?>
<!-- } 이벤트 끝 -->
</div>
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+119
View File
@@ -0,0 +1,119 @@
<?php
include_once('./_common.php');
define("_INDEX_", TRUE);
include_once(G5_MSHOP_PATH.'/_head.php');
?>
<script src="<?php echo G5_JS_URL; ?>/swipe.js"></script>
<script src="<?php echo G5_JS_URL; ?>/shop.mobile.main.js"></script>
<?php echo display_banner('메인', 'mainbanner.10.skin.php'); ?>
<?php echo display_banner('왼쪽', 'boxbanner.skin.php'); ?>
<?php if($default['de_mobile_type1_list_use']) { ?>
<div class="sct_wrap">
<h2><a href="<?php echo G5_SHOP_URL; ?>/listtype.php?type=1">히트상품</a></h2>
<?php
$list = new item_list();
$list->set_mobile(true);
$list->set_type(1);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_cust_price', true);
$list->set_view('it_price', true);
$list->set_view('it_icon', true);
$list->set_view('sns', true);
echo $list->run();
?>
</div>
<?php } ?>
<?php if($default['de_mobile_type2_list_use']) { ?>
<div class="sct_wrap">
<h2><a href="<?php echo G5_SHOP_URL; ?>/listtype.php?type=2">추천상품</a></h2>
<?php
$list = new item_list();
$list->set_mobile(true);
$list->set_type(2);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_cust_price', true);
$list->set_view('it_price', true);
$list->set_view('it_icon', true);
$list->set_view('sns', true);
echo $list->run();
?>
</div>
<?php } ?>
<?php if($default['de_mobile_type3_list_use']) { ?>
<div class="sct_wrap">
<h2><a href="<?php echo G5_SHOP_URL; ?>/listtype.php?type=3">최신상품</a></h2>
<?php
$list = new item_list();
$list->set_mobile(true);
$list->set_type(3);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_cust_price', true);
$list->set_view('it_price', true);
$list->set_view('it_icon', true);
$list->set_view('sns', true);
echo $list->run();
?>
</div>
<?php } ?>
<?php if($default['de_mobile_type4_list_use']) { ?>
<div class="sct_wrap">
<h2><a href="<?php echo G5_SHOP_URL; ?>/listtype.php?type=4">인기상품</a></h2>
<?php
$list = new item_list();
$list->set_mobile(true);
$list->set_type(4);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', false);
$list->set_view('sns', false);
echo $list->run();
?>
</div>
<?php } ?>
<?php if($default['de_mobile_type5_list_use']) { ?>
<div class="sct_wrap">
<h2><a href="<?php echo G5_SHOP_URL; ?>/listtype.php?type=5">할인상품</a></h2>
<?php
$list = new item_list();
$list->set_mobile(true);
$list->set_type(5);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_cust_price', false);
$list->set_view('it_price', true);
$list->set_view('it_icon', false);
$list->set_view('sns', false);
echo $list->run();
?>
</div>
<?php } ?>
<?php include_once(G5_MSHOP_SKIN_PATH.'/main.event.skin.php'); // 이벤트 ?>
<!-- 커뮤니티 최신글 시작 { -->
<section id="sidx_lat">
<?php echo latest('shop_basic', 'notice', 3, 30); ?>
</section>
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
+6
View File
@@ -0,0 +1,6 @@
<?php
include_once('../../../common.php');
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP)
die('<p>쇼핑몰 설치 후 이용해 주십시오.</p>');
define('_SHOP_', true);
+59
View File
@@ -0,0 +1,59 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if(!function_exists('get_inicis_app_scheme')){
function get_inicis_app_scheme(){
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$iPod = stripos($user_agent,"iPod");
$iPhone = stripos($user_agent,"iPhone");
$iPad = stripos($user_agent,"iPad");
if( $iPod || $iPhone || $iPad ){ //IOS 의 앱브라우저에서 ISP결제시 리다이렉트 safari로 돌아가는 문제가 있음
if( preg_match('/NAVER\(inapp;/', $user_agent) ){ //네이버
return 'app_scheme=naversearchapp://&';
}
else if( preg_match('/CriOS/', $user_agent) ){ //크롬
return 'app_scheme=googlechromes://&';
}
else if( preg_match('/DaumDevice/', $user_agent) ){ //다음
return 'app_scheme=daumapps://&';
}
else if( preg_match('/KAKAOTALK/', $user_agent) ){ //카카오톡
return 'app_scheme=kakaotalk://&';
}
else if( preg_match('/(FBAN|FBAV)/', $user_agent) ){ //페이스북
return 'app_scheme=fb://&';
}
}
return '';
}
}
?>
<form name="sm_form" method="POST" action="" accept-charset="euc-kr">
<input type="hidden" name="P_OID" value="<?php echo $od_id; ?>">
<input type="hidden" name="P_GOODS" value="<?php echo $goods; ?>">
<input type="hidden" name="P_AMT" value="<?php echo $tot_price; ?>">
<input type="hidden" name="P_UNAME" value="">
<input type="hidden" name="P_MOBILE" value="">
<input type="hidden" name="P_EMAIL" value="">
<input type="hidden" name="P_MID" value="<?php echo $default['de_inicis_mid']; ?>">
<input type="hidden" name="P_NEXT_URL" value="<?php echo $next_url; ?>">
<input type="hidden" name="P_NOTI_URL" value="<?php echo $noti_url; ?>">
<input type="hidden" name="P_RETURN_URL" value="">
<input type="hidden" name="P_HPP_METHOD" value="2">
<input type="hidden" name="P_RESERVED" value="<?php echo get_inicis_app_scheme(); ?>bank_receipt=N&twotrs_isp=Y&block_isp=Y<?php echo $useescrow.$inicis_cardpoint; ?>">
<input type="hidden" name="DEF_RESERVED" value="<?php echo get_inicis_app_scheme(); ?>bank_receipt=N&twotrs_isp=Y&block_isp=Y<?php echo $useescrow.$inicis_cardpoint; ?>">
<input type="hidden" name="P_NOTI" value="<?php echo $od_id; ?>">
<input type="hidden" name="P_QUOTABASE" value="01:02:03:04:05:06:07:08:09:10:11:12"> <!-- 할부기간 설정 01은 일시불 -->
<input type="hidden" name="P_SKIP_TERMS" value="">
<input type="hidden" name="good_mny" value="<?php echo $tot_price; ?>" >
<?php if($default['de_tax_flag_use']) { ?>
<input type="hidden" name="P_TAX" value="">
<input type="hidden" name="P_TAXFREE" value="">
<?php } ?>
</form>
+30
View File
@@ -0,0 +1,30 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<input type="hidden" name="good_mny" value="<?php echo $tot_price ?>" >
<input type="hidden" name="res_cd" value=""> <!-- 결과 코드 -->
<input type="hidden" name="P_HASH" value="">
<input type="hidden" name="P_TYPE" value="">
<input type="hidden" name="P_UNAME" value="">
<input type="hidden" name="P_AUTH_DT" value="">
<input type="hidden" name="P_AUTH_NO" value="">
<input type="hidden" name="P_HPP_CORP" value="">
<input type="hidden" name="P_APPL_NUM" value="">
<input type="hidden" name="P_VACT_NUM" value="">
<input type="hidden" name="P_VACT_NAME" value="">
<input type="hidden" name="P_VACT_BANK" value="">
<input type="hidden" name="P_CARD_ISSUER" value="">
<?php if($default['de_tax_flag_use']) { ?>
<input type="hidden" name="comm_tax_mny" value="<?php echo $comm_tax_mny; ?>"> <!-- 과세금액 -->
<input type="hidden" name="comm_vat_mny" value="<?php echo $comm_vat_mny; ?>"> <!-- 부가세 -->
<input type="hidden" name="comm_free_mny" value="<?php echo $comm_free_mny; ?>"> <!-- 비과세 금액 -->
<?php } ?>
<div id="display_pay_button" class="btn_confirm">
<span id="show_req_btn"><input type="button" name="submitChecked" onClick="pay_approval();" value="결제등록" class="btn_submit"></span>
<span id="show_pay_btn" style="display:none;"><input type="button" onClick="forderform_check();" value="주문하기" class="btn_submit"></span>
<a href="<?php echo G5_SHOP_URL; ?>" class="btn_cancel">취소</a>
</div>
+2
View File
@@ -0,0 +1,2 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가;
+201
View File
@@ -0,0 +1,201 @@
<?php
include_once('./_common.php');
include_once(G5_MSHOP_PATH.'/settle_inicis.inc.php');
// 세션 초기화
set_session('P_TID', '');
set_session('P_AMT', '');
set_session('P_HASH', '');
$oid = isset($_REQUEST['P_NOTI']) ? trim($_REQUEST['P_NOTI']) : '';
$p_req_url = isset($_REQUEST['P_REQ_URL']) ? is_inicis_url_return(trim($_REQUEST['P_REQ_URL'])) : '';
$p_status = isset($_REQUEST['P_STATUS']) ? trim($_REQUEST['P_STATUS']) : '';
$p_tid = isset($_REQUEST['P_TID']) ? trim($_REQUEST['P_TID']) : '';
$p_rmesg1 = isset($_REQUEST['P_RMESG1']) ? trim($_REQUEST['P_RMESG1']) : '';
if( ! $p_req_url || !preg_match('/^https\:\/\//i', $p_req_url)){
alert("잘못된 요청 URL 입니다.");
}
$sql = " select * from {$g5['g5_shop_order_data_table']} where od_id = '$oid' ";
$row = sql_fetch($sql);
$data = isset($row['dt_data']) ? unserialize(base64_decode($row['dt_data'])) : array();
if(isset($data['pp_id']) && $data['pp_id']) {
$order_action_url = G5_HTTPS_MSHOP_URL.'/personalpayformupdate.php';
$page_return_url = G5_SHOP_URL.'/personalpayform.php?pp_id='.$data['pp_id'];
} else {
$order_action_url = G5_HTTPS_MSHOP_URL.'/orderformupdate.php';
$page_return_url = G5_SHOP_URL.'/orderform.php';
if(get_session('ss_direct'))
$page_return_url .= '?sw_direct=1';
// 장바구니가 비어있는가?
if (get_session('ss_direct'))
$tmp_cart_id = get_session('ss_cart_direct');
else
$tmp_cart_id = get_session('ss_cart_id');
if (get_cart_count($tmp_cart_id) == 0)// 장바구니에 담기
alert('세션을 잃거나 다른 브라우저에서 데이터가 변경된 경우입니다. 장바구니 상태를 확인후에 다시 시도해 주세요.', G5_SHOP_URL.'/cart.php');
$error = "";
// 장바구니 상품 재고 검사
$sql = " select it_id,
ct_qty,
it_name,
io_id,
io_type,
ct_option
from {$g5['g5_shop_cart_table']}
where od_id = '$tmp_cart_id'
and ct_select = '1' ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
// 상품에 대한 현재고수량
if($row['io_id']) {
$it_stock_qty = (int)get_option_stock_qty($row['it_id'], $row['io_id'], $row['io_type']);
} else {
$it_stock_qty = (int)get_it_stock_qty($row['it_id']);
}
// 장바구니 수량이 재고수량보다 많다면 오류
if ($row['ct_qty'] > $it_stock_qty)
$error .= "{$row['ct_option']} 의 재고수량이 부족합니다. 현재고수량 : $it_stock_qty\\n\\n";
}
if($i == 0)
alert('장바구니가 비어 있습니다.', G5_SHOP_URL.'/cart.php');
if ($error != "")
{
$error .= "결제진행이 중단 되었습니다.";
alert($error, G5_SHOP_URL.'/cart.php');
}
}
if($p_status !== '00') {
alert('오류 : '.iconv_utf8($p_rmesg1).' 코드 : '.$p_status, $page_return_url);
} else {
$post_data = array(
'P_MID' => $default['de_inicis_mid'],
'P_TID' => $p_tid
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_PORT, 443);
curl_setopt($ch, CURLOPT_URL, $p_req_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$return = curl_exec($ch);
if(!$return)
alert('KG이니시스와 통신 오류로 결제등록 요청을 완료하지 못했습니다.\\n결제등록 요청을 다시 시도해 주십시오.', $page_return_url);
// 결과를 배열로 변환
parse_str($return, $ret);
$PAY = array_map('trim', $ret);
$PAY = array_map('strip_tags', $PAY);
$PAY = array_map('get_search_string', $PAY);
if($PAY['P_STATUS'] != '00')
alert('오류 : '.iconv_utf8($PAY['P_RMESG1']).' 코드 : '.$PAY['P_STATUS'], $page_return_url);
// TID, AMT 를 세션으로 주문완료 페이지 전달
$hash = md5($PAY['P_TID'].$PAY['P_MID'].$PAY['P_AMT']);
set_session('P_TID', $PAY['P_TID']);
set_session('P_AMT', $PAY['P_AMT']);
set_session('P_HASH', $hash);
}
$params = array();
//개인결제
if(isset($data['pp_id']) && !empty($data['pp_id'])) {
// 개인결제 정보
$pp_check = false;
$sql = " select * from {$g5['g5_shop_personalpay_table']} where pp_id = '{$PAY['P_OID']}' and pp_tno = '{$PAY['P_TID']}' and pp_use = '1' ";
$pp = sql_fetch($sql);
if( !$pp['pp_tno'] && $data['pp_id'] == $oid ){
$res_cd = $PAY['P_STATUS'];
$pp_id = $oid;
$exclude = array('res_cd', 'P_HASH', 'P_TYPE', 'P_AUTH_DT', 'P_VACT_BANK', 'LGD_PAYKEY', 'pp_id', 'good_mny', 'pp_name', 'pp_email', 'pp_hp', 'pp_settle_case');
foreach($data as $key=>$v) {
if( !in_array($key, $exclude) ){
$_POST[$key] = $params[$key] = clean_xss_tags(strip_tags($v));
}
}
$good_mny = isset($PAY['P_AMT']) ? $PAY['P_AMT'] : 0;
$pp_name = clean_xss_tags($data['pp_name']);
$pp_email = clean_xss_tags($data['pp_email']);
$pp_hp = clean_xss_tags($data['pp_hp']);
$pp_settle_case = clean_xss_tags($data['pp_settle_case']);
$_POST['P_HASH'] = $hash;
$_POST['P_AUTH_NO'] = isset($PAY['P_AUTH_NO']) ? $PAY['P_AUTH_NO'] : '';
$_POST['pp_id'] = isset($PAY['P_OID']) ? $PAY['P_OID'] : '';
$_POST['good_mny'] = isset($PAY['P_AMT']) ? $PAY['P_AMT'] : 0;
$_POST['P_TYPE'] = isset($PAY['P_TYPE']) ? $PAY['P_TYPE'] : '';
$_POST['P_AUTH_DT'] = isset($PAY['P_AUTH_DT']) ? $PAY['P_AUTH_DT'] : '';
$_POST['P_HPP_CORP'] = isset($PAY['P_HPP_CORP']) ? $PAY['P_HPP_CORP'] : '';
$_POST['P_APPL_NUM'] = isset($PAY['P_APPL_NUM']) ? $PAY['P_APPL_NUM'] : '';
$_POST['P_VACT_NUM'] = isset($PAY['P_VACT_NUM']) ? $PAY['P_VACT_NUM'] : '';
$_POST['P_VACT_NAME'] = isset($PAY['P_VACT_NAME']) ? iconv_utf8($PAY['P_VACT_NAME']) : '';
$_POST['P_VACT_BANK'] = (isset($PAY['P_VACT_BANK_CODE']) && isset($BANK_CODE[$PAY['P_VACT_BANK_CODE']])) ? $BANK_CODE[$PAY['P_VACT_BANK_CODE']] : '';
$_POST['P_CARD_ISSUER'] = isset($CARD_CODE[$PAY['P_CARD_ISSUER_CODE']]) ? $CARD_CODE[$PAY['P_CARD_ISSUER_CODE']] : '';
$_POST['P_UNAME'] = isset($PAY['P_UNAME']) ? iconv_utf8($PAY['P_UNAME']) : '';
include_once( G5_MSHOP_PATH.'/personalpayformupdate.php' );
}
} else {
// 상점 결제
$exclude = array('res_cd', 'P_HASH', 'P_TYPE', 'P_AUTH_DT', 'P_VACT_BANK', 'P_AUTH_NO');
foreach($data as $key=>$value) {
if(!empty($exclude) && in_array($key, $exclude))
continue;
if(is_array($value)) {
foreach($value as $k=>$v) {
$_POST[$key][$k] = $params[$key][$k] = clean_xss_tags(strip_tags($v));
}
} else {
if(in_array($key, array('od_memo'))){
$_POST[$key] = $params[$key] = clean_xss_tags(strip_tags($value), 0, 0, 0, 0);
} else {
$_POST[$key] = $params[$key] = clean_xss_tags(strip_tags($value));
}
}
}
$res_cd = $_POST['res_cd'] = isset($PAY['P_STATUS']) ? $PAY['P_STATUS'] : '';
$P_HASH = $_POST['P_HASH'] = $hash;
$P_TYPE = $_POST['P_TYPE'] = isset($PAY['P_TYPE']) ? $PAY['P_TYPE'] : '';
$P_AUTH_DT = $_POST['P_AUTH_DT'] = isset($PAY['P_AUTH_DT']) ? $PAY['P_AUTH_DT'] : '';
$P_AUTH_NO = $_POST['P_AUTH_NO'] = isset($PAY['P_AUTH_NO']) ? $PAY['P_AUTH_NO'] : '';
$P_HPP_CORP = $_POST['P_HPP_CORP'] = isset($PAY['P_HPP_CORP']) ? $PAY['P_HPP_CORP'] : '';
$P_APPL_NUM = $_POST['P_APPL_NUM'] = isset($PAY['P_APPL_NUM']) ? $PAY['P_APPL_NUM'] : '';
$P_VACT_NUM = $_POST['P_VACT_NUM'] = isset($PAY['P_VACT_NUM']) ? $PAY['P_VACT_NUM'] : '';
$P_VACT_NAME = $_POST['P_VACT_NAME'] = isset($PAY['P_VACT_NAME']) ? iconv_utf8($PAY['P_VACT_NAME']) : '';
$P_VACT_BANK = $_POST['P_VACT_BANK'] = (isset($PAY['P_VACT_BANK_CODE']) && isset($BANK_CODE[$PAY['P_VACT_BANK_CODE']])) ? $BANK_CODE[$PAY['P_VACT_BANK_CODE']] : '';
// $P_CARD_ISSUER = $_POST['P_CARD_ISSUER'] = isset($CARD_CODE[$PAY['P_CARD_ISSUER_CODE']]) ? $CARD_CODE[$PAY['P_CARD_ISSUER_CODE']] : '';
$P_CARD_ISSUER = $_POST['P_CARD_ISSUER'] = isset($CARD_CODE[$PAY['P_FN_CD1']]) ? $CARD_CODE[$PAY['P_FN_CD1']] : '';
$P_UNAME = $_POST['P_UNAME'] = isset($PAY['P_UNAME']) ? iconv_utf8($PAY['P_UNAME']) : '';
$check_keys = array('od_name', 'od_tel', 'od_pwd', 'od_hp', 'od_zip', 'od_addr1', 'od_addr2', 'od_addr3', 'od_addr_jibeon', 'od_email', 'ad_default', 'ad_subject', 'od_hope_date', 'od_b_name', 'od_b_tel', 'od_b_hp', 'od_b_zip', 'od_b_addr1', 'od_b_addr2', 'od_b_addr3', 'od_b_addr_jibeon', 'od_memo', 'od_settle_case', 'max_temp_point', 'od_temp_point', 'od_send_cost', 'od_send_cost2', 'od_bank_account', 'od_deposit_name', 'od_test', 'od_ip');
foreach($check_keys as $key){
$$key = isset($params[$key]) ? $params[$key] : '';
}
include_once( G5_MSHOP_PATH.'/orderformupdate.php' );
}
exit;
+50
View File
@@ -0,0 +1,50 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once(G5_MSHOP_PATH.'/settle_inicis.inc.php');
$post_p_hash = isset($_POST['P_HASH']) ? $_POST['P_HASH'] : '';
// 세션비교
$hash = md5(get_session('P_TID').$default['de_inicis_mid'].get_session('P_AMT'));
if($hash !== $post_p_hash)
alert('결제 정보가 일치하지 않습니다. 올바른 방법으로 이용해 주십시오.');
//최종결제요청 결과 성공 DB처리
$tno = get_session('P_TID');
$amount = get_session('P_AMT');
$app_time = isset($_POST['P_AUTH_DT']) ? $_POST['P_AUTH_DT'] : '';
$pay_method = isset($_POST['P_TYPE']) ? $_POST['P_TYPE'] : '';
$pay_type = isset($PAY_METHOD[$pay_method]) ? $PAY_METHOD[$pay_method] : '';
$depositor = isset($_POST['P_UNAME']) ? $_POST['P_UNAME'] : '';
$commid = isset($_POST['P_HPP_CORP']) ? $_POST['P_HPP_CORP'] : '';
$mobile_no = isset($_POST['P_APPL_NUM']) ? $_POST['P_APPL_NUM'] : '';
$app_no = isset($_POST['P_AUTH_NO']) ? $_POST['P_AUTH_NO'] : '';
$card_name = isset($_POST['P_CARD_ISSUER']) ? $_POST['P_CARD_ISSUER'] : '';
if ($default['de_escrow_use'] == 1) {
$escw_yn = 'Y';
}
$post_p_vact_bank = isset($_POST['P_VACT_BANK']) ? $_POST['P_VACT_BANK'] : '';
$post_p_vact_num = isset($_POST['P_VACT_NUM']) ? $_POST['P_VACT_NUM'] : '';
$post_p_vact_name = isset($_POST['P_VACT_NAME']) ? $_POST['P_VACT_NAME'] : '';
switch($pay_type) {
case '계좌이체':
$bank_name = $post_p_vact_bank;
break;
case '가상계좌':
$bankname = $post_p_vact_bank;
$account = $post_p_vact_num.' '.$post_p_vact_name;
$app_no = $post_p_vact_num;
break;
default:
break;
}
// 세션 초기화
set_session('P_TID', '');
set_session('P_AMT', '');
set_session('P_HASH', '');
+95
View File
@@ -0,0 +1,95 @@
<?php
include_once('./_common.php');
include_once(G5_MSHOP_PATH.'/settle_inicis.inc.php');
// 세션 초기화
set_session('P_TID', '');
set_session('P_AMT', '');
set_session('P_HASH', '');
$oid = isset($_REQUEST['oid']) ? preg_replace('/[^0-9a-z_\-]/i', '', $_REQUEST['oid']) : '';
$sql = " select * from {$g5['g5_shop_order_data_table']} where od_id = '$oid' ";
$row = sql_fetch($sql);
if( empty($row) ){ //이미 결제가 완료 되었다면
if( $exist_order = get_shop_order_data($oid) ){ //상품주문
if($exist_order['od_tno']){
exists_inicis_shop_order($oid, array(), $exist_order['od_time'], $exist_order['od_ip']);
exit;
}
} else if( $pp = get_shop_order_data($oid, 'personal') ){ //개인결제
if($pp['pp_tno']){ //이미 결제가 완료되었다면
exists_inicis_shop_order($oid, $pp, $pp['pp_time'], $pp['pp_ip']);
exit;
}
}
}
$data = unserialize(base64_decode($row['dt_data']));
if(isset($data['pp_id']) && $data['pp_id']) {
$order_action_url = G5_HTTPS_MSHOP_URL.'/personalpayformupdate.php';
$page_return_url = G5_SHOP_URL.'/personalpayform.php?pp_id='.$data['pp_id'];
} else {
$order_action_url = G5_HTTPS_MSHOP_URL.'/orderformupdate.php';
$page_return_url = G5_SHOP_URL.'/orderform.php';
if($_SESSION['ss_direct'])
$page_return_url .= '?sw_direct=1';
}
$sql = " select * from {$g5['g5_shop_inicis_log_table']} where oid = '$oid' ";
$row = sql_fetch($sql);
if(! (isset($row['oid']) && $row['oid']))
alert('결제 정보가 존재하지 않습니다.\\n\\n올바른 방법으로 이용해 주십시오.', $page_return_url);
if($row['P_STATUS'] != '00')
alert('오류 : '.$row['P_RMESG1'].' 코드 : '.$row['P_STATUS'], $page_return_url);
$PAY = array_map('trim', $row);
// TID, AMT 를 세션으로 주문완료 페이지 전달
$hash = md5($PAY['P_TID'].$PAY['P_MID'].$PAY['P_AMT']);
set_session('P_TID', $PAY['P_TID']);
set_session('P_AMT', $PAY['P_AMT']);
set_session('P_HASH', $hash);
// 로그 삭제
@sql_query(" delete from {$g5['g5_shop_inicis_log_table']} where oid = '$oid' ");
$g5['title'] = 'KG 이니시스 결제';
$g5['body_script'] = ' onload="setPAYResult();"';
include_once(G5_PATH.'/head.sub.php');
$exclude = array('res_cd', 'P_HASH', 'P_TYPE', 'P_AUTH_DT', 'P_VACT_BANK', 'P_AUTH_NO');
echo '<form name="forderform" method="post" action="'.$order_action_url.'" autocomplete="off">'.PHP_EOL;
echo make_order_field($data, $exclude);
echo '<input type="hidden" name="res_cd" value="'.$PAY['P_STATUS'].'">'.PHP_EOL;
echo '<input type="hidden" name="P_HASH" value="'.$hash.'">'.PHP_EOL;
echo '<input type="hidden" name="P_TYPE" value="'.$PAY['P_TYPE'].'">'.PHP_EOL;
echo '<input type="hidden" name="P_AUTH_DT" value="'.$PAY['P_AUTH_DT'].'">'.PHP_EOL;
echo '<input type="hidden" name="P_VACT_BANK" value="'.$PAY['P_FN_NM'].'">'.PHP_EOL;
echo '<input type="hidden" name="P_AUTH_NO" value="'.$PAY['P_AUTH_NO'].'">'.PHP_EOL;
echo '</form>'.PHP_EOL;
?>
<div id="pay_working" style="display:none;">
<span style="display:block; text-align:center;margin-top:120px"><img src="<?php echo G5_MOBILE_URL; ?>/shop/img/loading.gif" alt=""></span>
<span style="display:block; text-align:center;margin-top:10px; font-size:14px">주문완료 중입니다. 잠시만 기다려 주십시오.</span>
</div>
<script type="text/javascript">
function setPAYResult() {
setTimeout( function() {
document.forderform.submit();
}, 300);
}
</script>
<?php
include_once(G5_PATH.'/tail.sub.php');
+391
View File
@@ -0,0 +1,391 @@
<?php
include_once('./_common.php');
//*******************************************************************************
// FILE NAME : mx_rnoti.php
// FILE DESCRIPTION :
// 이니시스 smart phone 결제 결과 수신 페이지 샘플
// 기술문의 : ts@inicis.com
// HISTORY
// 2010. 02. 25 최초작성
// 2010 06. 23 WEB 방식의 가상계좌 사용시 가상계좌 채번 결과 무시 처리 추가(APP 방식은 해당 없음!!)
// WEB 방식일 경우 이미 P_NEXT_URL 에서 채번 결과를 전달 하였으므로,
// 이니시스에서 전달하는 가상계좌 채번 결과 내용을 무시 하시기 바랍니다.
//*******************************************************************************
$PGIP = $_SERVER['REMOTE_ADDR'];
// 2019-01-28 노티 아이피 203.238.37.15 추가
if($PGIP == "211.219.96.165" || $PGIP == "118.129.210.25" || $PGIP == "183.109.71.153" || $PGIP == "203.238.37.15") //PG에서 보냈는지 IP로 체크
{
// 이니시스 NOTI 서버에서 받은 Value
$P_TID; // 거래번호
$P_MID; // 상점아이디
$P_AUTH_DT; // 승인일자
$P_STATUS; // 거래상태 (00:성공, 01:실패)
$P_TYPE; // 지불수단
$P_OID; // 상점주문번호
$P_FN_CD1; // 금융사코드1
$P_FN_CD2; // 금융사코드2
$P_FN_NM; // 금융사명 (은행명, 카드사명, 이통사명)
$P_AMT; // 거래금액
$P_UNAME; // 결제고객성명
$P_RMESG1; // 결과코드
$P_RMESG2; // 결과메시지
$P_NOTI; // 노티메시지(상점에서 올린 메시지)
$P_AUTH_NO; // 승인번호
$P_SRC_CODE; // 앱연동 결제구분
$P_TID = isset($_POST['P_TID']) ? $_POST['P_TID'] : '';
$P_MID = isset($_POST['P_MID']) ? $_POST['P_MID'] : '';
$P_AUTH_DT = isset($_POST['P_AUTH_DT']) ? $_POST['P_AUTH_DT'] : '';
$P_STATUS = isset($_POST['P_STATUS']) ? $_POST['P_STATUS'] : '';
$P_TYPE = isset($_POST['P_TYPE']) ? $_POST['P_TYPE'] : '';
$P_OID = isset($_POST['P_OID']) ? preg_replace("/[ #\&\+%@=\/\\\:;,\.'\"\^`~|\!\?\*$#<>()\[\]\{\}]/i", "", $_POST['P_OID']) : '';
$P_FN_CD1 = isset($_POST['P_FN_CD1']) ? $_POST['P_FN_CD1'] : '';
$P_FN_CD2 = isset($_POST['P_FN_CD2']) ? $_POST['P_FN_CD2'] : '';
$P_FN_NM = isset($_POST['P_FN_NM']) ? $_POST['P_FN_NM'] : '';
$P_AMT = isset($_POST['P_AMT']) ? $_POST['P_AMT'] : '';
$P_UNAME = isset($_POST['P_UNAME']) ? $_POST['P_UNAME'] : '';
$P_RMESG1 = isset($_POST['P_RMESG1']) ? $_POST['P_RMESG1'] : '';
$P_RMESG2 = isset($_POST['P_RMESG2']) ? $_POST['P_RMESG2'] : '';
$P_NOTI = isset($_POST['P_NOTI']) ? $_POST['P_NOTI'] : '';
$P_AUTH_NO = isset($_POST['P_AUTH_NO']) ? $_POST['P_AUTH_NO'] : '';
$P_SRC_CODE = isset($_POST['P_SRC_CODE']) ? $_POST['P_SRC_CODE'] : '';
include_once(G5_MSHOP_PATH.'/settle_inicis.inc.php');
if(! ($default['de_pg_service'] === 'inicis' && $default['de_inicis_mid'] === $P_MID)){
echo "FAIL";
return;
}
// 결과 incis log 테이블 기록
if($P_TYPE == 'BANK' || $P_SRC_CODE == 'A') {
if(!sql_query(" select post_data from {$g5['g5_shop_inicis_log_table']} limit 1 ", false)) {
sql_query(" ALTER TABLE `{$g5['g5_shop_inicis_log_table']}`
ADD `post_data` text NOT NULL AFTER `P_RMESG1`,
ADD `is_mail_send` tinyint(4) NOT NULL DEFAULT '1' AFTER `post_data` ", false);
}
$sql = " insert into {$g5['g5_shop_inicis_log_table']}
set oid = '$P_OID',
P_TID = '$P_TID',
P_MID = '$P_MID',
P_AUTH_DT = '$P_AUTH_DT',
P_STATUS = '$P_STATUS',
P_TYPE = '$P_TYPE',
P_OID = '$P_OID',
P_FN_NM = '".iconv_utf8($P_FN_NM)."',
P_AUTH_NO = '$P_AUTH_NO',
P_AMT = '$P_AMT',
P_RMESG1 = '".iconv_utf8($P_RMESG1)."',
post_data = '".base64_encode(serialize($_POST))."',
is_mail_send = 0 ";
sql_query($sql, false);
}
if( $P_STATUS == "00" && $P_TID && $P_MID && $P_TYPE != "VBANK" ){
// 주문이 있는지 체크
$sql = "select count(od_id) as cnt from {$g5['g5_shop_order_table']} where od_id = '$P_OID' and od_tno = '$P_TID' ";
$exist_order = sql_fetch($sql);
if( !$exist_order['cnt'] ){
//주문정보를 insert 합니다.
$sql = " select * from {$g5['g5_shop_order_data_table']} where od_id = '$P_OID' ";
$od = sql_fetch($sql);
$data = unserialize(base64_decode($od['dt_data']));
//개인결제
if(isset($data['pp_id']) && !empty($data['pp_id'])) {
// 개인결제 정보
$pp_check = false;
$sql = " select * from {$g5['g5_shop_personalpay_table']} where pp_id = '$P_OID' and pp_tno = '$P_TID' and pp_use = '1' ";
$pp = sql_fetch($sql);
if( !$pp['pp_tno'] && $data['pp_id'] == $P_OID ){
$res_cd = $P_STATUS;
$pp_id = $P_OID;
$exclude = array('res_cd', 'P_HASH', 'P_TYPE', 'P_AUTH_DT', 'P_VACT_BANK', 'LGD_PAYKEY', 'pp_id', 'good_mny', 'pp_name', 'pp_email', 'pp_hp', 'pp_settle_case');
$params = array();
foreach($data as $key=>$v) {
if( !in_array($key, $exclude) ){
$_POST[$key] = $params[$key] = clean_xss_tags(strip_tags($v));
}
}
$good_mny = $P_AMT;
$pp_name = clean_xss_tags($data['pp_name']);
$pp_email = clean_xss_tags($data['pp_email']);
$pp_hp = clean_xss_tags($data['pp_hp']);
$pp_settle_case = clean_xss_tags($data['pp_settle_case']);
set_session('P_TID', $P_TID);
set_session('P_AMT', $P_AMT);
$_POST['P_HASH'] = md5(get_session('P_TID').$default['de_inicis_mid'].$P_AMT);
$_POST['P_AUTH_NO'] = $P_AUTH_NO;
$_POST['pp_id'] = $P_OID;
$_POST['good_mny'] = $P_AMT;
$is_noti_pay = true;
$sql = " select pp_time from {$g5['g5_shop_personalpay_table']} where pp_id = '$P_OID' and pp_use = '1' ";
$pp_time = sql_fetch($sql);
set_session('ss_personalpay_id', $P_OID);
set_session('ss_personalpay_hash', md5($P_OID.$P_AMT.$pp_time['pp_time']));
include_once( G5_MSHOP_PATH.'/personalpayformupdate.php' );
if( !$order_id ){
echo "FAIL";
} else {
$sql = " delete from {$g5['g5_shop_inicis_log_table']} where (oid = '$P_OID' and P_TID = '$P_TID') OR substr(P_AUTH_DT, 1, 8) < '".date('Ymd', strtotime('-1 month', G5_SERVER_TIME))."' ";
sql_query( $sql , false);
}
}
//상품주문
} else {
if($od && isset($data['it_id']) && !empty($data['it_id'])) {
$PAY = array(
'oid' => $P_OID,
'P_TID' => $P_TID,
'P_MID' => $P_MID,
'P_AUTH_DT' => $P_AUTH_DT,
'P_STATUS' => $P_STATUS,
'P_TYPE' => $P_TYPE,
'P_OID' => $P_OID,
'P_FN_NM' => iconv_utf8($P_FN_NM),
'P_AUTH_NO' => $P_AUTH_NO,
'P_AMT' => $P_AMT,
'P_RMESG1' => iconv_utf8($P_RMESG1)
);
// TID, AMT 를 세션으로 주문완료 페이지 전달
$hash = md5($PAY['P_TID'].$PAY['P_MID'].$PAY['P_AMT']);
set_session('P_TID', $PAY['P_TID']);
set_session('P_AMT', $PAY['P_AMT']);
set_session('P_HASH', $hash);
set_session('ss_order_id', $P_OID);
$params = array();
$exclude = array('res_cd', 'P_HASH', 'P_TYPE', 'P_AUTH_DT', 'P_VACT_BANK', 'P_AUTH_NO');
foreach($data as $key=>$value) {
if(!empty($exclude) && in_array($key, $exclude))
continue;
if(is_array($value)) {
foreach($value as $k=>$v) {
$_POST[$key][$k] = $params[$key][$k] = clean_xss_tags(strip_tags($v));
}
} else {
$_POST[$key] = $params[$key] = clean_xss_tags(strip_tags($value));
}
}
if( !empty($params['sw_direct']) && !empty($params['post_cart_id']) ){
set_session('ss_direct', $params['sw_direct']);
set_session('ss_cart_direct', $params['post_cart_id']);
} else if ( $params['post_cart_id'] ){
set_session('ss_cart_id', $params['post_cart_id']);
}
try {
unset($params['sw_direct']);
unset($params['post_cart_id']);
} catch (Exception $e) {
}
$_POST['res_cd'] = $params['res_cd'] = $PAY['P_STATUS'];
$_POST['P_HASH'] = $params['P_HASH'] = $hash;
$_POST['P_TYPE'] = $params['P_TYPE'] = $PAY['P_TYPE'];
$_POST['P_AUTH_DT'] = $params['P_AUTH_DT'] = $PAY['P_AUTH_DT'];
$_POST['P_VACT_BANK'] = $params['P_VACT_BANK'] = $PAY['P_FN_NM'];
$_POST['P_AUTH_NO'] = $params['P_AUTH_NO'] = $PAY['P_AUTH_NO'];
$check_keys = array('od_name', 'od_tel', 'od_pwd', 'od_hp', 'od_zip', 'od_addr1', 'od_addr2', 'od_addr3', 'od_addr_jibeon', 'od_email', 'ad_default', 'ad_subject', 'od_hope_date', 'od_b_name', 'od_b_tel', 'od_b_hp', 'od_b_zip', 'od_b_addr1', 'od_b_addr2', 'od_b_addr3', 'od_b_addr_jibeon', 'od_memo', 'od_settle_case', 'max_temp_point', 'od_temp_point', 'od_send_cost', 'od_send_cost2', 'od_bank_account', 'od_deposit_name', 'od_test', 'od_ip');
foreach($check_keys as $key){
$$key = isset($params[$key]) ? $params[$key] : '';
}
$od_send_cost = (int) $od_send_cost;
$od_send_cost2 = (int) $od_send_cost2;
$ad_default = (int) $ad_default;
if( $od['mb_id'] ){
$is_member = true;
$member = get_member($od['mb_id']);
}
$is_noti_pay = true;
include_once( G5_MSHOP_PATH.'/orderformupdate.php' );
if( !$order_id ){
echo "FAIL";
} else {
$sql = " delete from {$g5['g5_shop_inicis_log_table']} where (oid = '$P_OID' and P_TID = '$P_TID') OR substr(P_AUTH_DT, 1, 8) < '".date('Ymd', strtotime('-1 month', G5_SERVER_TIME))."' ";
sql_query( $sql , false);
}
}
}
}
}
//WEB 방식의 경우 가상계좌 채번 결과 무시 처리
//(APP 방식의 경우 해당 내용을 삭제 또는 주석 처리 하시기 바랍니다.)
if($P_TYPE == "VBANK") //결제수단이 가상계좌이며
{
if($P_STATUS != "02") //입금통보 "02" 가 아니면(가상계좌 채번 : 00 또는 01 경우)
{
echo "OK";
return;
}
// 입금결과 처리
$sql = " select pp_id, od_id from {$g5['g5_shop_personalpay_table']} where pp_id = '$P_OID' and pp_tno = '$P_TID' ";
$row = sql_fetch($sql);
$result = false;
$receipt_time = $P_AUTH_DT;
if($row['pp_id']) {
// 개인결제 UPDATE
$sql = " update {$g5['g5_shop_personalpay_table']}
set pp_receipt_price = '$P_AMT',
pp_receipt_time = '$receipt_time'
where pp_id = '$P_OID'
and pp_tno = '$P_TID' ";
sql_query($sql, false);
if($row['od_id']) {
// 주문서 UPDATE
$receipt_time = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3 \\4:\\5:\\6", $receipt_time);
$sql = " update {$g5['g5_shop_order_table']}
set od_receipt_price = od_receipt_price + '$P_AMT',
od_receipt_time = '$receipt_time',
od_shop_memo = concat(od_shop_memo, \"\\n개인결제 ".$row['pp_id']." 로 결제완료 - ".$receipt_time."\")
where od_id = '{$row['od_id']}' ";
$result = sql_query($sql, FALSE);
}
} else {
// 주문서 UPDATE
$sql = " update {$g5['g5_shop_order_table']}
set od_receipt_price = '$P_AMT',
od_receipt_time = '$receipt_time'
where od_id = '$P_OID'
and od_tno = '$P_TID' ";
$result = sql_query($sql, FALSE);
}
if($result) {
if($row['od_id'])
$od_id = $row['od_id'];
else
$od_id = $P_OID;
// 주문정보 체크
$sql = " select count(od_id) as cnt
from {$g5['g5_shop_order_table']}
where od_id = '$od_id'
and od_status = '주문' ";
$row = sql_fetch($sql);
if($row['cnt'] == 1) {
// 미수금 정보 업데이트
$info = get_order_info($od_id);
$sql = " update {$g5['g5_shop_order_table']}
set od_misu = '{$info['od_misu']}' ";
if($info['od_misu'] == 0)
$sql .= " , od_status = '입금' ";
$sql .= " where od_id = '$od_id' ";
sql_query($sql, FALSE);
// 장바구니 상태변경
if($info['od_misu'] == 0) {
$sql = " update {$g5['g5_shop_cart_table']}
set ct_status = '입금'
where od_id = '$od_id' ";
sql_query($sql, FALSE);
}
}
}
if($result) {
echo "OK";
return;
} else {
echo "FAIL";
return;
}
}
$PageCall_time = date("H:i:s");
$value = array(
"PageCall time" => $PageCall_time,
"P_TID" => $P_TID,
"P_MID" => $P_MID,
"P_AUTH_DT" => $P_AUTH_DT,
"P_STATUS" => $P_STATUS,
"P_TYPE" => $P_TYPE,
"P_OID" => $P_OID,
"P_FN_CD1" => $P_FN_CD1,
"P_FN_CD2" => $P_FN_CD2,
"P_FN_NM" => $P_FN_NM,
"P_AMT" => $P_AMT,
"P_UNAME" => $P_UNAME,
"P_RMESG1" => $P_RMESG1,
"P_RMESG2" => $P_RMESG2,
"P_NOTI" => $P_NOTI,
"P_AUTH_NO" => $P_AUTH_NO,
"P_SRC_CODE" => $P_SRC_CODE
);
// 결제처리에 관한 로그 기록
//writeLog($value);
/***********************************************************************************
' 위에서 상점 데이터베이스에 등록 성공유무에 따라서 성공시에는 "OK"를 이니시스로 실패시는 "FAIL" 을
' 리턴하셔야합니다. 아래 조건에 데이터베이스 성공시 받는 FLAG 변수를 넣으세요
' (주의) OK를 리턴하지 않으시면 이니시스 지불 서버는 "OK"를 수신할때까지 계속 재전송을 시도합니다
' 기타 다른 형태의 echo "" 는 하지 않으시기 바랍니다
'***********************************************************************************/
echo 'OK';
}
function writeLog($msg)
{
$file = G5_SHOP_PATH."/inicis/log/noti_input_".date("Ymd").".log";
if(!($fp = fopen($path.$file, "a+"))) return 0;
ob_start();
print_r($msg);
$ob_msg = ob_get_contents();
ob_clean();
if(fwrite($fp, " ".$ob_msg."\n") === FALSE)
{
fclose($fp);
return 0;
}
fclose($fp);
return 1;
}
+229
View File
@@ -0,0 +1,229 @@
<?php
include_once('./_common.php');
include_once(G5_LIB_PATH.'/iteminfo.lib.php');
$it_id = isset($_GET['it_id']) ? get_search_string(trim($_GET['it_id'])) : '';
$it_seo_title = isset($it_seo_title) ? $it_seo_title : '';
$it = get_shop_item_with_category($it_id, $it_seo_title);
$it_id = $_REQUEST['it_id'] = $it['it_id'];
if (! (isset($it['it_id']) && $it['it_id'])) {
alert('자료가 없습니다.');
}
if( isset($row['it_seo_title']) && ! $row['it_seo_title'] ){
shop_seo_title_update($row['it_id']);
}
if (function_exists('check_case_exist_title')) check_case_exist_title($it, G5_SHOP_DIR, true);
if (!($it['ca_use'] && $it['it_use'])) {
if (!$is_admin)
alert('판매가능한 상품이 아닙니다.');
}
// 분류 테이블에서 분류 상단, 하단 코드를 얻음
$sql = " select ca_mobile_skin_dir, ca_include_head, ca_include_tail, ca_cert_use, ca_adult_use
from {$g5['g5_shop_category_table']}
where ca_id = '{$it['ca_id']}' ";
$ca = sql_fetch($sql);
// 본인인증, 성인인증체크
if(!$is_admin) {
$msg = shop_member_cert_check($it_id, 'item');
if($msg)
alert($msg, G5_SHOP_URL);
}
// 오늘 본 상품 저장 시작
// tv 는 today view 약자
$saved = false;
$tv_idx = (int)get_session("ss_tv_idx");
if ($tv_idx > 0) {
for ($i=1; $i<=$tv_idx; $i++) {
if (get_session("ss_tv[$i]") == $it_id) {
$saved = true;
break;
}
}
}
if (!$saved) {
$tv_idx++;
set_session("ss_tv_idx", $tv_idx);
set_session("ss_tv[$tv_idx]", $it_id);
}
// 오늘 본 상품 저장 끝
// 조회수 증가
if (get_cookie('ck_it_id') != $it_id) {
sql_query(" update {$g5['g5_shop_item_table']} set it_hit = it_hit + 1 where it_id = '$it_id' "); // 1증가
set_cookie("ck_it_id", $it_id, 3600); // 1시간동안 저장
}
// 이전 상품보기
$sql = " select it_id, it_name from {$g5['g5_shop_item_table']}
where it_id > '$it_id'
and SUBSTRING(ca_id,1,4) = '".substr($it['ca_id'],0,4)."'
and it_use = '1'
order by it_id asc
limit 1 ";
$row = sql_fetch($sql);
if (isset($row['it_id']) && $row['it_id']) {
$prev_title = '이전상품 <span>'.$row['it_name'].'</span>';
$prev_href = '<a href="'.shop_item_url($row['it_id']).'" id="siblings_prev">';
$prev_href2 = '</a>';
} else {
$prev_title = '';
$prev_href = '';
$prev_href2 = '';
}
// 다음 상품보기
$sql = " select it_id, it_name from {$g5['g5_shop_item_table']}
where it_id < '$it_id'
and SUBSTRING(ca_id,1,4) = '".substr($it['ca_id'],0,4)."'
and it_use = '1'
order by it_id desc
limit 1 ";
$row = sql_fetch($sql);
if (isset($row['it_id']) && $row['it_id']) {
$next_title = '다음상품 <span>'.$row['it_name'].'</span>';
$next_href = '<a href="'.shop_item_url($row['it_id']).'" id="siblings_next">';
$next_href2 = '</a>';
} else {
$next_title = '';
$next_href = '';
$next_href2 = '';
}
// 관리자가 확인한 사용후기의 개수를 얻음
$sql = " select count(*) as cnt from `{$g5['g5_shop_item_use_table']}` where it_id = '{$it_id}' and is_confirm = '1' ";
$row = sql_fetch($sql);
$item_use_count = $row['cnt'];
// 상품문의의 개수를 얻음
$sql = " select count(*) as cnt from `{$g5['g5_shop_item_qa_table']}` where it_id = '{$it_id}' ";
$row = sql_fetch($sql);
$item_qa_count = $row['cnt'];
if ($default['de_mobile_rel_list_use']) {
// 관련상품의 개수를 얻음
$sql = " select count(*) as cnt
from {$g5['g5_shop_item_relation_table']} a
left join {$g5['g5_shop_item_table']} b on (a.it_id2=b.it_id)
where a.it_id = '{$it['it_id']}' and b.it_use='1' ";
$row = sql_fetch($sql);
$item_relation_count = $row['cnt'];
}
// 상품품절체크
if(G5_SOLDOUT_CHECK)
$is_soldout = is_soldout($it['it_id'], true);
// 주문가능체크
$is_orderable = true;
if(!$it['it_use'] || $it['it_tel_inq'] || $is_soldout)
$is_orderable = false;
if($is_orderable) {
if(defined('G5_THEME_USE_OPTIONS_TRTD') && G5_THEME_USE_OPTIONS_TRTD){
$option_item = get_item_options($it['it_id'], $it['it_option_subject'], '');
$supply_item = get_item_supply($it['it_id'], $it['it_supply_subject'], '');
} else {
// 선택 옵션 ( 기존의 tr td 태그로 가져오려면 'div' 를 '' 로 바꾸거나 또는 지워주세요 )
$option_item = get_item_options($it['it_id'], $it['it_option_subject'], 'div');
// 추가 옵션 ( 기존의 tr td 태그로 가져오려면 'div' 를 '' 로 바꾸거나 또는 지워주세요 )
$supply_item = get_item_supply($it['it_id'], $it['it_supply_subject'], 'div');
}
// 상품 선택옵션 수
$option_count = 0;
if($it['it_option_subject']) {
$temp = explode(',', $it['it_option_subject']);
$option_count = count($temp);
}
// 상품 추가옵션 수
$supply_count = 0;
if($it['it_supply_subject']) {
$temp = explode(',', $it['it_supply_subject']);
$supply_count = count($temp);
}
}
// 스킨경로
$skin_dir = G5_MSHOP_SKIN_PATH;
$ca_dir_check = true;
if($it['it_mobile_skin']) {
if(preg_match('#^theme/(.+)$#', $it['it_mobile_skin'], $match))
$skin_dir = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
else
$skin_dir = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$it['it_mobile_skin'];
if(is_dir($skin_dir)) {
$form_skin_file = $skin_dir.'/item.form.skin.php';
if(is_file($form_skin_file))
$ca_dir_check = false;
}
}
if($ca_dir_check) {
if($ca['ca_mobile_skin_dir']) {
if(preg_match('#^theme/(.+)$#', $ca['ca_mobile_skin_dir'], $match))
$skin_dir = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
else
$skin_dir = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$ca['ca_mobile_skin_dir'];
if(is_dir($skin_dir)) {
$form_skin_file = $skin_dir.'/item.form.skin.php';
if(!is_file($form_skin_file))
$skin_dir = G5_MSHOP_SKIN_PATH;
} else {
$skin_dir = G5_MSHOP_SKIN_PATH;
}
}
}
define('G5_SHOP_CSS_URL', str_replace(G5_PATH, G5_URL, $skin_dir));
$g5['title'] = $it['it_name'].' &gt; '.$it['ca_name'];
$naverpay_button_js = '';
include_once(G5_MSHOP_PATH.'/_head.php');
include_once(G5_SHOP_PATH.'/settle_naverpay.inc.php');
// 상단 HTML
echo run_replace('shop_it_mobile_head_html', '<div id="sit_hhtml">'.conv_content($it['it_mobile_head_html'], 1).'</div>', $it);
?>
<?php if($is_orderable) { ?>
<script src="<?php echo G5_JS_URL; ?>/shop.js?ver=<?php echo G5_JS_VER; ?>"></script>
<?php } ?>
<?php
if (G5_HTTPS_DOMAIN)
$action_url = G5_HTTPS_DOMAIN.'/'.G5_SHOP_DIR.'/cartupdate.php';
else
$action_url = G5_SHOP_URL.'/cartupdate.php';
?>
<div id="sit">
<?php
// 상품 구입폼
include_once($skin_dir.'/item.form.skin.php');
?>
</div>
<?php
// 하단 HTML
echo run_replace('shop_it_mobile_tail_html', conv_content($it['it_mobile_tail_html'], 1), $it);
include_once(G5_MSHOP_PATH.'/_tail.php');
+86
View File
@@ -0,0 +1,86 @@
<?php
include_once('./_common.php');
$it_id = isset($_GET['it_id']) ? get_search_string(trim($_GET['it_id'])) : '';
$info = isset($_GET['info']) ? preg_replace('/[^0-9a-z]/i', '', $_GET['info']) : '';
// 분류사용, 상품사용하는 상품의 정보를 얻음
$sql = " select a.*,
b.ca_name,
b.ca_use
from {$g5['g5_shop_item_table']} a,
{$g5['g5_shop_category_table']} b
where a.it_id = '$it_id'
and a.ca_id = b.ca_id ";
$it = sql_fetch($sql);
if (!$it['it_id'])
alert('자료가 없습니다.');
if (!($it['ca_use'] && $it['it_use'])) {
if (!$is_admin)
alert('판매가능한 상품이 아닙니다.');
}
// 분류 테이블에서 분류 상단, 하단 코드를 얻음
$sql = " select ca_mobile_skin_dir, ca_include_head, ca_include_tail, ca_cert_use, ca_adult_use
from {$g5['g5_shop_category_table']}
where ca_id = '{$it['ca_id']}' ";
$ca = sql_fetch($sql);
$g5['title'] = $it['it_name'].' &gt; '.$it['ca_name'];
include_once(G5_PATH.'/head.sub.php');
// 관리자가 확인한 사용후기의 개수를 얻음
$sql = " select count(*) as cnt from `{$g5['g5_shop_item_use_table']}` where it_id = '{$it_id}' and is_confirm = '1' ";
$row = sql_fetch($sql);
$item_use_count = $row['cnt'];
// 상품문의의 개수를 얻음
$sql = " select count(*) as cnt from `{$g5['g5_shop_item_qa_table']}` where it_id = '{$it_id}' ";
$row = sql_fetch($sql);
$item_qa_count = $row['cnt'];
function pg_anchor($info) {
global $default;
global $it_id, $item_use_count, $item_qa_count, $item_relation_count;
$href = G5_SHOP_URL.'/iteminfo.php?it_id='.$it_id;
?>
<ul class="sanchor">
<li><a href="<?php echo $href; ?>" <?php if ($info == '') echo 'class="sanchor_on"'; ?>>DETAIL</a></li>
<?php if ($default['de_baesong_content']) { ?><li><a href="<?php echo $href; ?>&amp;info=dvr" <?php if ($info == 'dvr') echo 'class="sanchor_on"'; ?>>INFO</a></li><?php } ?>
<li><a href="<?php echo $href; ?>&amp;info=use" <?php if ($info == 'use') echo 'class="sanchor_on"'; ?>>REVIEW<span class="item_use_count"><?php echo $item_use_count; ?></span></a></li>
<li><a href="<?php echo $href; ?>&amp;info=qa" <?php if ($info == 'qa') echo 'class="sanchor_on"'; ?>>Q&amp;A<span class="item_qa_count"><?php echo $item_qa_count; ?></span></a></li>
</ul>
<?php
}
?>
<div id="menu_list">
<?php echo pg_anchor($info); ?>
</div>
<div id="info_content" class="new_win">
<?php
switch($info) {
case 'use':
include_once(G5_MSHOP_SKIN_PATH.'/iteminfo.itemuse.skin.php');
break;
case 'qa':
include_once(G5_MSHOP_SKIN_PATH.'/iteminfo.itemqa.skin.php');
break;
case 'dvr':
include_once(G5_MSHOP_SKIN_PATH.'/iteminfo.delivery.skin.php');
break;
case 'ex':
include_once(G5_MSHOP_SKIN_PATH.'/iteminfo.change.skin.php');
break;
default:
include_once(G5_MSHOP_SKIN_PATH.'/iteminfo.info.skin.php');
break;
}
?>
</div>
<div class="close_btn"><button type="button" id="iteminfo_close" onclick="self.close();">창닫기</button></div>
<?php
include_once(G5_PATH.'/tail.sub.php');
+32
View File
@@ -0,0 +1,32 @@
<?php
include_once('./_common.php');
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
$it_id = isset($_REQUEST['it_id']) ? safe_replace_regex($_REQUEST['it_id'], 'it_id') : '';
$itemqa_list = G5_SHOP_URL."/itemqalist.php";
$itemqa_form = G5_SHOP_URL."/itemqaform.php?it_id=".$it_id;
$itemqa_formupdate = G5_SHOP_URL."/itemqaformupdate.php?it_id=".$it_id;
$sql_common = " from `{$g5['g5_shop_item_qa_table']}` where it_id = '{$it_id}' ";
// 테이블의 전체 레코드수만 얻음
$sql = " select COUNT(*) as cnt " . $sql_common;
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$rows = 5;
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1) $page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 레코드 구함
$sql = "select * $sql_common order by iq_id desc limit $from_record, $rows ";
$result = sql_query($sql);
$itemqa_skin = G5_MSHOP_SKIN_PATH.'/itemqa.skin.php';
if(!file_exists($itemqa_skin)) {
echo str_replace(G5_PATH.'/', '', $itemqa_skin).' 스킨 파일이 존재하지 않습니다.';
} else {
include_once($itemqa_skin);
}
+62
View File
@@ -0,0 +1,62 @@
<?php
include_once('./_common.php');
include_once(G5_EDITOR_LIB);
if (!$is_member) {
alert_close("상품문의는 회원만 작성 가능합니다.");
}
$w = isset($_REQUEST['w']) ? preg_replace('/[^0-9a-z]/i', '', trim($_REQUEST['w'])) : '';
$it_id = isset($_REQUEST['it_id']) ? get_search_string(trim($_REQUEST['it_id'])) : '';
$iq_id = isset($_REQUEST['iq_id']) ? preg_replace('/[^0-9]/', '', trim($_REQUEST['iq_id'])) : 0;
// 상품정보체크
$row = get_shop_item($it_id, true);
if(! (isset($row['it_id']) && $row['it_id']))
alert_close('상품정보가 존재하지 않습니다.');
$chk_secret = '';
if($w == '') {
$qa['iq_email'] = $member['mb_email'];
$qa['iq_hp'] = $member['mb_hp'];
}
if ($w == "u")
{
$qa = sql_fetch(" select * from {$g5['g5_shop_item_qa_table']} where iq_id = '$iq_id' ");
if (!$qa) {
alert_close("상품문의 정보가 없습니다.");
}
$it_id = $qa['it_id'];
if (!$is_admin && $qa['mb_id'] != $member['mb_id']) {
alert_close("자신의 상품문의만 수정이 가능합니다.");
}
if($qa['iq_secret'])
$chk_secret = 'checked="checked"';
}
include_once(G5_PATH.'/head.sub.php');
$is_dhtml_editor = false;
// 모바일에서는 DHTML 에디터 사용불가
if ($config['cf_editor'] && (!is_mobile() || defined('G5_IS_MOBILE_DHTML_USE') && G5_IS_MOBILE_DHTML_USE)) {
$is_dhtml_editor = true;
}
$editor_html = editor_html('iq_question', get_text(html_purifier($qa['iq_question']), 0), $is_dhtml_editor);
$editor_js = '';
$editor_js .= get_editor_js('iq_question', $is_dhtml_editor);
$editor_js .= chk_editor_js('iq_question', $is_dhtml_editor);
$itemqaform_skin = G5_MSHOP_SKIN_PATH.'/itemqaform.skin.php';
if(!file_exists($itemqaform_skin)) {
echo str_replace(G5_PATH.'/', '', $itemqaform_skin).' 스킨 파일이 존재하지 않습니다.';
} else {
include_once($itemqaform_skin);
}
include_once(G5_PATH.'/tail.sub.php');
+63
View File
@@ -0,0 +1,63 @@
<?php
include_once('./_common.php');
$g5['title'] = '상품문의';
include_once(G5_MSHOP_PATH.'/_head.php');
$sql_common = " from `{$g5['g5_shop_item_qa_table']}` a join `{$g5['g5_shop_item_table']}` b on (a.it_id=b.it_id) ";
$sql_search = " where (1) ";
if(!$sfl)
$sfl = 'b.it_name';
if ($stx) {
$sql_search .= " and ( ";
switch ($sfl) {
case "a.it_id" :
$sql_search .= " ($sfl like '$stx%') ";
break;
case "a.iq_name" :
case "a.mb_id" :
$sql_search .= " ($sfl = '$stx') ";
break;
default :
$sql_search .= " ($sfl like '%$stx%') ";
break;
}
$sql_search .= " ) ";
}
if (!$sst) {
$sst = "a.iq_id";
$sod = "desc";
}
$sql_order = " order by $sst $sod ";
$sql = " select count(*) as cnt
$sql_common
$sql_search
$sql_order ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$rows = $config['cf_mobile_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
$sql = " select a.*, b.it_name
$sql_common
$sql_search
$sql_order
limit $from_record, $rows ";
$result = sql_query($sql);
$itemqalist_skin = G5_MSHOP_SKIN_PATH.'/itemqalist.skin.php';
if(!file_exists($itemqalist_skin)) {
echo str_replace(G5_PATH.'/', '', $itemqalist_skin).' 스킨 파일이 존재하지 않습니다.';
} else {
include_once($itemqalist_skin);
}
include_once(G5_MSHOP_PATH.'/_tail.php');
+62
View File
@@ -0,0 +1,62 @@
<?php
include_once('./_common.php');
$it_id = isset($_REQUEST['it_id']) ? safe_replace_regex($_REQUEST['it_id'], 'it_id') : '';
if (!$is_member)
alert_close('회원만 메일을 발송할 수 있습니다.');
// 스팸을 발송할 수 없도록 세션에 아무값이나 저장하여 hidden 으로 넘겨서 다음 페이지에서 비교함
$token = md5(uniqid(rand(), true));
set_session("ss_token", $token);
$it = get_shop_item($it_id, true);
if (! (isset($it['it_name']) && $it['it_name']))
alert_close("등록된 상품이 아닙니다.");
$g5['title'] = $it['it_name'].' - 추천하기';
include_once(G5_PATH.'/head.sub.php');
?>
<div id="sit_rec_new" class="new_win">
<h1 id="win_title"><?php echo $g5['title']; ?></h1>
<form name="fitemrecommend" method="post" action="./itemrecommendmail.php" autocomplete="off" onsubmit="return fitemrecommend_check(this);">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<input type="hidden" name="it_id" value="<?php echo $it_id; ?>">
<div class="new_win_con form_01">
<ul>
<li>
<label for="to_email" class="sound_only">추천받는 분 E-mail</label>
<input type="email" name="to_email" id="to_email" required class="frm_input full_input" placeholder="추천받는 분 E-mail">
</li>
<li>
<label for="subject" class="sound_only">제목</label>
<input type="text" name="subject" id="subject" required class="frm_input full_input" placeholder="제목">
</li>
<li>
<label for="content" class="sound_only">내용</label>
<textarea name="content" id="content" required placeholder="내용"></textarea>
</li>
</ul>
</div>
<div class="win_btn">
<input type="submit" id="btn_submit" value="보내기" class="btn_submit">
<a href="javascript:window.close();" class="btn_close">창닫기</a>
</div>
</form>
</div>
<script>
function fitemrecommend_check(f)
{
return true;
}
</script>
<?php
include_once(G5_PATH.'/tail.sub.php');
+32
View File
@@ -0,0 +1,32 @@
<?php
include_once('./_common.php');
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
$it_id = isset($_REQUEST['it_id']) ? safe_replace_regex($_REQUEST['it_id'], 'it_id') : '';
$itemuse_list = G5_SHOP_URL."/itemuselist.php";
$itemuse_form = G5_SHOP_URL."/itemuseform.php?it_id=".$it_id;
$itemuse_formupdate = G5_SHOP_URL."/itemuseformupdate.php?it_id=".$it_id;
$sql_common = " from `{$g5['g5_shop_item_use_table']}` where it_id = '{$it_id}' and is_confirm = '1' ";
// 테이블의 전체 레코드수만 얻음
$sql = " select COUNT(*) as cnt " . $sql_common;
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$rows = 5;
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1) $page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 레코드 구함
$sql = "select * $sql_common order by is_id desc limit $from_record, $rows ";
$result = sql_query($sql);
$itemuse_skin = G5_MSHOP_SKIN_PATH.'/itemuse.skin.php';
if(!file_exists($itemuse_skin)) {
echo str_replace(G5_PATH.'/', '', $itemuse_skin).' 스킨 파일이 존재하지 않습니다.';
} else {
include_once($itemuse_skin);
}
+57
View File
@@ -0,0 +1,57 @@
<?php
include_once('./_common.php');
include_once(G5_EDITOR_LIB);
if (!$is_member) {
alert_close("사용후기는 회원만 작성 가능합니다.");
}
$w = isset($_REQUEST['w']) ? preg_replace('/[^0-9a-z]/i', '', trim($_REQUEST['w'])) : '';
$it_id = isset($_REQUEST['it_id']) ? get_search_string(trim($_REQUEST['it_id'])) : '';
$is_id = $_REQUEST['is_id'] ? preg_replace('/[^0-9]/', '', trim($_REQUEST['is_id'])) : 0;
// 상품정보체크
$row = get_shop_item($it_id, true);
if(! (isset($row['it_id']) && $row['it_id']))
alert_close('상품정보가 존재하지 않습니다.');
if ($w == "") {
$is_score = 5;
// 사용후기 작성 설정에 따른 체크
check_itemuse_write($it_id, $member['mb_id']);
} else if ($w == "u") {
$use = sql_fetch(" select * from {$g5['g5_shop_item_use_table']} where is_id = '$is_id' ");
if (!$use) {
alert_close("사용후기 정보가 없습니다.");
}
$it_id = $use['it_id'];
$is_score = $use['is_score'];
if (!$is_admin && $use['mb_id'] != $member['mb_id']) {
alert_close("자신의 사용후기만 수정이 가능합니다.");
}
}
include_once(G5_PATH.'/head.sub.php');
$is_dhtml_editor = false;
// 모바일에서는 DHTML 에디터 사용불가
if ($config['cf_editor'] && (!is_mobile() || defined('G5_IS_MOBILE_DHTML_USE') && G5_IS_MOBILE_DHTML_USE)) {
$is_dhtml_editor = true;
}
$editor_html = editor_html('is_content', get_text(html_purifier($use['is_content']), 0), $is_dhtml_editor);
$editor_js = '';
$editor_js .= get_editor_js('is_content', $is_dhtml_editor);
$editor_js .= chk_editor_js('is_content', $is_dhtml_editor);
$itemuseform_skin = G5_MSHOP_SKIN_PATH.'/itemuseform.skin.php';
if(!file_exists($itemuseform_skin)) {
echo str_replace(G5_PATH.'/', '', $itemuseform_skin).' 스킨 파일이 존재하지 않습니다.';
} else {
include_once($itemuseform_skin);
}
include_once(G5_PATH.'/tail.sub.php');
+63
View File
@@ -0,0 +1,63 @@
<?php
include_once('./_common.php');
$g5['title'] = '상품후기';
include_once(G5_MSHOP_PATH.'/_head.php');
$sql_common = " from `{$g5['g5_shop_item_use_table']}` a join `{$g5['g5_shop_item_table']}` b on (a.it_id=b.it_id) ";
$sql_search = " where a.is_confirm = '1' ";
if(!$sfl)
$sfl = 'b.it_name';
if ($stx) {
$sql_search .= " and ( ";
switch ($sfl) {
case "a.it_id" :
$sql_search .= " ($sfl like '$stx%') ";
break;
case "a.is_name" :
case "a.mb_id" :
$sql_search .= " ($sfl = '$stx') ";
break;
default :
$sql_search .= " ($sfl like '%$stx%') ";
break;
}
$sql_search .= " ) ";
}
if (!$sst) {
$sst = "a.is_id";
$sod = "desc";
}
$sql_order = " order by $sst $sod ";
$sql = " select count(*) as cnt
$sql_common
$sql_search
$sql_order ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$rows = $config['cf_mobile_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
$sql = " select *
$sql_common
$sql_search
$sql_order
limit $from_record, $rows ";
$result = sql_query($sql);
$itemuselist_skin = G5_MSHOP_SKIN_PATH.'/itemuselist.skin.php';
if(!file_exists($itemuselist_skin)) {
echo str_replace(G5_PATH.'/', '', $itemuselist_skin).' 스킨 파일이 존재하지 않습니다.';
} else {
include_once($itemuselist_skin);
}
include_once(G5_MSHOP_PATH.'/_tail.php');
+192
View File
@@ -0,0 +1,192 @@
<?php
/* ============================================================================== */
/* = PAGE : 라이브버리 PAGE = */
/* = -------------------------------------------------------------------------- = */
/* = Copyright (c) 2010.02 KCP Co., Ltd. All Rights Reserved. = */
/* = -------------------------------------------------------------------------- = */
/* + 이 모듈에 대한 수정을 금합니다. + */
/* ============================================================================== */
/* ============================================================================== */
/* + SOAP 연동 CALSS + */
/* ============================================================================== */
class ApproveReq
{
public $accessCredentialType; // AccessCredentialType
public $baseRequestType; // BaseRequestType
public $escrow; // boolean
public $orderID; // string
public $paymentAmount; // string
public $paymentMethod; // string
public $productName; // string
public $returnUrl; // string
public $siteCode; // string
}
class ApproveRes
{
public $approvalKey; // string
public $baseResponseType; // BaseResponseType
public $payUrl; // string
}
class approve
{
public $req; // ApproveReq
}
class approveResponse
{
public $return; // ApproveRes
}
class AccessCredentialType
{
public $accessLicense; // string
public $signature; // string
public $timestamp; // string
}
class BaseRequestType
{
public $detailLevel; // string
public $requestApp; // string
public $requestID; // string
public $userAgent; // string
public $version; // string
}
class BaseResponseType
{
public $detailLevel; // string
public $error; // ErrorType
public $messageID; // string
public $release; // string
public $requestID; // string
public $responseType; // string
public $timestamp; // string
public $version; // string
public $warningList; // ErrorType
}
class ErrorType
{
public $code; // string
public $detail; // string
public $message; // string
}
class PayService extends SoapClient
{
private static $classmap = array(
'ApproveReq' => 'ApproveReq',
'ApproveRes' => 'ApproveRes',
'approve' => 'approve',
'approveResponse' => 'approveResponse',
'AccessCredentialType' => 'AccessCredentialType',
'BaseRequestType' => 'BaseRequestType',
'BaseResponseType' => 'BaseResponseType',
'ErrorType' => 'ErrorType',
);
var $chatsetType;
var $accessCredentialType;
var $baseRequestType;
var $approveReq;
var $approveResponse;
var $resCD;
var $resMsg;
public function __construct( $wsdl = "", $options = array() )
{
foreach( self::$classmap as $key => $value )
{
if ( !isset( $options[ 'classmap' ][ $key ] ) )
{
$options[ 'classmap' ][ $key ] = $value;
}
}
parent::__construct( $wsdl, $options );
$accessCredentialType = null;
$baseRequestType = null;
$approveReq = null;
$resCD = "95XX";
$resMsg = "연동 오류";
}
public function setCharSet( $charsetType )
{
$this->chatsetType = $charsetType;
}
public function setAccessCredentialType( $accessLicense,
$signature,
$timestamp )
{
$this->accessCredentialType = new AccessCredentialType();
$this->accessCredentialType->accessLicense = $accessLicense;
$this->accessCredentialType->signature = $signature;
$this->accessCredentialType->timestamp = $timestamp;
}
public function setBaseRequestType( $detailLevel,
$requestApp,
$requestID,
$userAgent,
$version )
{
$this->baseRequestType = new BaseRequestType();
$this->baseRequestType->detailLevel = $detailLevel;
$this->baseRequestType->requestApp = $requestApp;
$this->baseRequestType->requestID = $requestID;
$this->baseRequestType->userAgent = $userAgent;
$this->baseRequestType->version = $version;
}
public function setApproveReq( $escrow,
$orderID,
$paymentAmount,
$paymentMethod,
$productName,
$returnUrl,
$siteCode )
{
$this->approveReq = new ApproveReq();
$productName_utf8 = ( $this->chatsetType == "euc-kr" ) ? iconv( "EUC-KR", "UTF-8", $productName ) : $productName;
$this->approveReq->accessCredentialType = $this->accessCredentialType;
$this->approveReq->baseRequestType = $this->baseRequestType;
$this->approveReq->escrow = $escrow;
$this->approveReq->orderID = $orderID;
$this->approveReq->paymentAmount = $paymentAmount;
$this->approveReq->paymentMethod = $paymentMethod;
$this->approveReq->productName = $productName_utf8;
$this->approveReq->returnUrl = $returnUrl;
$this->approveReq->siteCode = $siteCode;
}
public function approve()
{
$approve = new approve();
$approve->req = $this->approveReq;
$this->approveResponse = $this->__soapCall( "approve", array( $approve ),
array( 'uri' => 'http://webservice.act.webpay.service.kcp.kr',
'soapaction' => ''
)
);
$this->resCD = $this->approveResponse->return->baseResponseType->error->code;
$this->resMsg = $this->approveResponse->return->baseResponseType->error->message;
return $this->approveResponse->return;
}
}
+142
View File
@@ -0,0 +1,142 @@
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ax21="http://payment.domain.webpay.service.kcp.kr/xsd" xmlns:ns="http://webservice.act.webpay.service.kcp.kr" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ax22="http://domain.webpay.service.kcp.kr/xsd" targetNamespace="http://webservice.act.webpay.service.kcp.kr">
<wsdl:types>
<xs:schema xmlns:ax23="http://domain.webpay.service.kcp.kr/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://payment.domain.webpay.service.kcp.kr/xsd">
<xs:import namespace="http://domain.webpay.service.kcp.kr/xsd"/>
<xs:complexType name="ApproveReq">
<xs:sequence>
<xs:element minOccurs="0" name="accessCredentialType" nillable="true" type="ax22:AccessCredentialType"/>
<xs:element minOccurs="0" name="baseRequestType" nillable="true" type="ax22:BaseRequestType"/>
<xs:element minOccurs="0" name="escrow" type="xs:boolean"/>
<xs:element minOccurs="0" name="orderID" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="paymentAmount" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="paymentMethod" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="productName" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="returnUrl" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="siteCode" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ApproveRes">
<xs:sequence>
<xs:element minOccurs="0" name="approvalKey" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="baseResponseType" nillable="true" type="ax22:BaseResponseType"/>
<xs:element minOccurs="0" name="payUrl" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
<xs:schema xmlns:ax24="http://payment.domain.webpay.service.kcp.kr/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://webservice.act.webpay.service.kcp.kr">
<xs:import namespace="http://payment.domain.webpay.service.kcp.kr/xsd"/>
<xs:element name="approve">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="req" nillable="true" type="ax24:ApproveReq"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="approveResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true" type="ax24:ApproveRes"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://domain.webpay.service.kcp.kr/xsd">
<xs:complexType name="AccessCredentialType">
<xs:sequence>
<xs:element minOccurs="0" name="accessLicense" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="signature" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="timestamp" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="BaseRequestType">
<xs:sequence>
<xs:element minOccurs="0" name="detailLevel" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="requestApp" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="requestID" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="userAgent" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="version" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="BaseResponseType">
<xs:sequence>
<xs:element minOccurs="0" name="detailLevel" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="error" nillable="true" type="ax22:ErrorType"/>
<xs:element minOccurs="0" name="messageID" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="release" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="requestID" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="responseType" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="timestamp" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="version" nillable="true" type="xs:string"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="warningList" nillable="true" type="ax22:ErrorType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ErrorType">
<xs:sequence>
<xs:element minOccurs="0" name="code" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="detail" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="approveRequest">
<wsdl:part name="parameters" element="ns:approve"/>
</wsdl:message>
<wsdl:message name="approveResponse">
<wsdl:part name="parameters" element="ns:approveResponse"/>
</wsdl:message>
<wsdl:portType name="PayServicePortType">
<wsdl:operation name="approve">
<wsdl:input message="ns:approveRequest" wsaw:Action="urn:approve"/>
<wsdl:output message="ns:approveResponse" wsaw:Action="urn:approveResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="PayServiceSoap11Binding" type="ns:PayServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="approve">
<soap:operation soapAction="urn:approve" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="PayServiceSoap12Binding" type="ns:PayServicePortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="approve">
<soap12:operation soapAction="urn:approve" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="PayServiceHttpBinding" type="ns:PayServicePortType">
<http:binding verb="POST"/>
<wsdl:operation name="approve">
<http:operation location="PayService/approve"/>
<wsdl:input>
<mime:content type="text/xml" part="approve"/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="approve"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="PayService">
<wsdl:port name="PayServiceHttpSoap11Endpoint" binding="ns:PayServiceSoap11Binding">
<soap:address location="https://testsmpay.kcp.co.kr/services/KCPPaymentService"/>
</wsdl:port>
<wsdl:port name="PayServiceHttpSoap12Endpoint" binding="ns:PayServiceSoap12Binding">
<soap12:address location="https://testsmpay.kcp.co.kr/services/KCPPaymentService"/>
</wsdl:port>
<wsdl:port name="PayServiceHttpEndpoint" binding="ns:PayServiceHttpBinding">
<http:address location="https://testsmpay.kcp.co.kr/services/KCPPaymentService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
+6
View File
@@ -0,0 +1,6 @@
<?php
include_once('../../../common.php');
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP)
die('<p>쇼핑몰 설치 후 이용해 주십시오.</p>');
define('_SHOP_', true);
+112
View File
@@ -0,0 +1,112 @@
var isIE = false;
var req01_AJAX;
var READY_STATE_UNINITIALIZED = 0;
var READY_STATE_LOADING = 1;
var READY_STATE_LOADED = 2;
var READY_STATE_INTERACTIVE = 3;
var READY_STATE_COMPLETE = 4;
var PayUrl ="";
function displayElement( targetObj, targetText, targetColor )
{
if ( targetObj.childNodes.length > 0 )
{
targetObj.replaceChild( document.createTextNode( targetText ), targetObj.childNodes[ 0 ] );
} else
{
targetObj.appendChild( document.createTextNode( targetText ) );
}
targetObj.style.color = targetColor;
}
function clearElement( targetObj )
{
for ( i = ( targetObj.childNodes.length - 1 ); i >= 0; i-- )
{
targetObj.removeChild( targetObj.childNodes[ i ] );
}
}
function initRequest()
{
if ( window.XMLHttpRequest )
{
return new XMLHttpRequest();
} else if ( window.ActiveXObject )
{
isIE = true;
return new ActiveXObject( "Microsoft.XMLHTTP" );
}
}
function sendRequest( url )
{
req01_AJAX = null;
req01_AJAX = initRequest();
if ( req01_AJAX )
{
req01_AJAX.onreadystatechange = process_AJAX;
req01_AJAX.open( "POST", url, true );
req01_AJAX.send( null );
}
}
function kcp_AJAX()
{
var url = "./order_approval.php";
var form = document.sm_form;
var params = "?site_cd=" + form.site_cd.value
+ "&ordr_idxx=" + form.ordr_idxx.value
+ "&good_mny=" + form.good_mny.value
+ "&pay_method=" + form.pay_method.value
+ "&escw_used=" + form.escw_used.value
+ "&good_name=" + form.good_name.value
+ "&Ret_URL=" + form.Ret_URL.value;
sendRequest( url + params );
}
function process_AJAX()
{
if ( req01_AJAX.readyState == READY_STATE_COMPLETE )
{
if ( req01_AJAX.status == 200 )
{
var result = null;
if ( req01_AJAX.responseText != null )
{
var txt = req01_AJAX.responseText.split(",");
if( txt[0].replace(/^\s*/,'').replace(/\s*$/,'') == '0000' )
{
document.getElementById("approval").value = txt[1].replace(/^\s*/,'').replace(/\s*$/,'');
PayUrl = txt[2].replace(/^\s*/,'').replace(/\s*$/,'');
//alert("성공적으로 거래가 등록 되었습니다.");
call_pay_form();
}
else
{
alert("실패 되었습니다.[" + txt[3].replace(/^\s*/,'').replace(/\s*$/,'') + "]");
}
}
}
else
{
alert( req01_AJAX.responseText );
}
}
else if ( req01_AJAX.readyState == READY_STATE_UNINITIALIZED )
{
}
else if ( req01_AJAX.readyState == READY_STATE_LOADING )
{
}
else if ( req01_AJAX.readyState == READY_STATE_LOADED )
{
}
else if ( req01_AJAX.readyState == READY_STATE_INTERACTIVE )
{
}
}
+108
View File
@@ -0,0 +1,108 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 타 PG 사용시 NHN KCP 네이버페이 사용이 설정되어 있는지 체크, 그렇지 않다면 return;
if( !(function_exists('is_use_easypay') && is_use_easypay('global_nhnkcp')) ){
return;
}
$param_opt_1 = isset($_REQUEST['param_opt_1']) ? clean_xss_tags($_REQUEST['param_opt_1'], 1, 1) : '';
$param_opt_2 = isset($_REQUEST['param_opt_2']) ? clean_xss_tags($_REQUEST['param_opt_2'], 1, 1) : '';
$param_opt_3 = isset($_REQUEST['param_opt_3']) ? clean_xss_tags($_REQUEST['param_opt_3'], 1, 1) : '';
?>
<!-- 거래등록 하는 kcp 서버와 통신을 위한 스크립트-->
<script src="<?php echo G5_MSHOP_URL; ?>/kcp/approval_key.js"></script>
<form name="nhnkcp_pay_form" method="POST" action="<?php echo G5_MSHOP_URL; ?>/kcp/order_approval_form.php">
<input type="hidden" name="good_name" value="<?php echo $goods; ?>">
<input type="hidden" name="good_mny" value="<?php echo $tot_price ?>" >
<input type="hidden" name="buyr_name" value="">
<input type="hidden" name="buyr_tel1" value="">
<input type="hidden" name="buyr_tel2" value="">
<input type="hidden" name="buyr_mail" value="">
<input type="hidden" name="settle_method" value="">
<input type="hidden" name="nhnkcp_pay_case" value="">
<input type="hidden" name="payco_direct" value=""> <!-- PAYCO 결제창 호출 -->
<input type="hidden" name="naverpay_direct" value="A" > <!-- NAVERPAY 결제창 호출 -->
<?php if(isset($default['de_easy_pay_services']) && in_array('used_nhnkcp_naverpay_point', explode(',', $default['de_easy_pay_services'])) ){ // 네이버페이 포인트 결제 옵션 ?>
<input type="hidden" name="naverpay_point_direct" value="Y"> <!-- 네이버페이 포인트 결제를 하려면 naverpay_point_direct 를 Y -->
<?php } ?>
<input type="hidden" name="kakaopay_direct" value="A" > <!-- KAKAOPAY 결제창 호출 -->
<input type="hidden" name="applepay_direct" value="A" > <!-- APPLEPAY 결제창 호출 -->
<!-- 주문번호 -->
<input type="hidden" name="ordr_idxx" value="<?php echo $od_id; ?>">
<!-- 인증수단(영문 소문자) * 반드시 대소문자 구분 -->
<input type="hidden" name="ActionResult" value="CARD">
<!-- 결제등록 키 -->
<input type="hidden" name="approval_key" id="approval">
<!-- 수취인이름 -->
<input type="hidden" name="rcvr_name" value="">
<!-- 수취인 연락처 -->
<input type="hidden" name="rcvr_tel1" value="">
<!-- 수취인 휴대폰 번호 -->
<input type="hidden" name="rcvr_tel2" value="">
<!-- 수취인 E-MAIL -->
<input type="hidden" name="rcvr_add1" value="">
<!-- 수취인 우편번호 -->
<input type="hidden" name="rcvr_add2" value="">
<!-- 수취인 주소 -->
<input type="hidden" name="rcvr_mail" value="">
<!-- 수취인 상세 주소 -->
<input type="hidden" name="rcvr_zipx" value="">
<!-- 장바구니 상품 개수 -->
<input type="hidden" name="bask_cntx" value="<?php echo (int)$goods_count + 1; ?>">
<!-- 장바구니 정보(상단 스크립트 참조) -->
<input type="hidden" name="good_info" value="<?php echo $good_info; ?>">
<!-- 배송소요기간 -->
<input type="hidden" name="deli_term" value="03">
<!-- 기타 파라메터 추가 부분 - Start - -->
<input type="hidden" name="param_opt_1" value="<?php echo get_text($param_opt_1); ?>"/>
<input type="hidden" name="param_opt_2" value="<?php echo get_text($param_opt_2); ?>"/>
<input type="hidden" name="param_opt_3" value="<?php echo get_text($param_opt_3); ?>"/>
<input type="hidden" name="disp_tax_yn" value="N">
<!-- 기타 파라메터 추가 부분 - End - -->
<!-- 화면 크기조정 부분 - Start - -->
<input type="hidden" name="tablet_size" value="<?php echo $tablet_size; ?>"/>
<!-- 화면 크기조정 부분 - End - -->
<!--
사용 카드 설정
<input type="hidden" name='used_card' value="CClg:ccDI">
/* 무이자 옵션
※ 설정할부 (가맹점 관리자 페이지에 설정 된 무이자 설정을 따른다) - "" 로 설정
※ 일반할부 (KCP 이벤트 이외에 설정 된 모든 무이자 설정을 무시한다) - "N" 로 설정
※ 무이자 할부 (가맹점 관리자 페이지에 설정 된 무이자 이벤트 중 원하는 무이자 설정을 세팅한다) - "Y" 로 설정
<input type="hidden" name="kcp_noint" value=""/> */
/* 무이자 설정
※ 주의 1 : 할부는 결제금액이 50,000 원 이상일 경우에만 가능
※ 주의 2 : 무이자 설정값은 무이자 옵션이 Y일 경우에만 결제 창에 적용
예) 전 카드 2,3,6개월 무이자(국민,비씨,엘지,삼성,신한,현대,롯데,외환) : ALL-02:03:04
BC 2,3,6개월, 국민 3,6개월, 삼성 6,9개월 무이자 : CCBC-02:03:06,CCKM-03:06,CCSS-03:06:04
<input type="hidden" name="kcp_noint_quota" value="CCBC-02:03:06,CCKM-03:06,CCSS-03:06:09"/> */
-->
<input type="hidden" name="kcp_noint" value="<?php echo ($default['de_card_noint_use'] ? '' : 'N'); ?>">
<?php
if($default['de_tax_flag_use']) {
/* KCP는 과세상품과 비과세상품을 동시에 판매하는 업체들의 결제관리에 대한 편의성을 제공해드리고자,
복합과세 전용 사이트코드를 지원해 드리며 총 금액에 대해 복합과세 처리가 가능하도록 제공하고 있습니다
복합과세 전용 사이트 코드로 계약하신 가맹점에만 해당이 됩니다
상품별이 아니라 금액으로 구분하여 요청하셔야 합니다
총결제 금액은 과세금액 + 부과세 + 비과세금액의 합과 같아야 합니다.
(good_mny = comm_tax_mny + comm_vat_mny + comm_free_mny)
복합과세는 order_approval_form.php 파일의 의해 적용됨
아래 필드는 order_approval_form.php 파일로 전송하는 것
*/
?>
<input type="hidden" name="tax_flag" value="TG03"> <!-- 변경불가 -->
<input type="hidden" name="comm_tax_mny" value="<?php echo $comm_tax_mny; ?>"> <!-- 과세금액 -->
<input type="hidden" name="comm_vat_mny" value="<?php echo $comm_vat_mny; ?>"> <!-- 부가세 -->
<input type="hidden" name="comm_free_mny" value="<?php echo $comm_free_mny; ?>"> <!-- 비과세 금액 -->
<?php
}
?>
</form>
+35
View File
@@ -0,0 +1,35 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<input type="hidden" name="req_tx" value=""> <!-- 요청 구분 -->
<input type="hidden" name="res_cd" value=""> <!-- 결과 코드 -->
<input type="hidden" name="tran_cd" value=""> <!-- 트랜잭션 코드 -->
<input type="hidden" name="ordr_idxx" value=""> <!-- 주문번호 -->
<input type="hidden" name="good_mny" value=""> <!-- 결제금액 -->
<input type="hidden" name="good_name" value=""> <!-- 상품명 -->
<input type="hidden" name="buyr_name" value=""> <!-- 주문자명 -->
<input type="hidden" name="buyr_tel1" value=""> <!-- 주문자 전화번호 -->
<input type="hidden" name="buyr_tel2" value=""> <!-- 주문자 휴대폰번호 -->
<input type="hidden" name="buyr_mail" value=""> <!-- 주문자 E-mail -->
<input type="hidden" name="enc_info" value=""> <!-- 암호화 정보 -->
<input type="hidden" name="enc_data" value=""> <!-- 암호화 데이터 -->
<input type="hidden" name="use_pay_method" value=""> <!-- 요청된 결제 수단 -->
<input type="hidden" name="rcvr_name" value=""> <!-- 수취인 이름 -->
<input type="hidden" name="rcvr_tel1" value=""> <!-- 수취인 전화번호 -->
<input type="hidden" name="rcvr_tel2" value=""> <!-- 수취인 휴대폰번호 -->
<input type="hidden" name="rcvr_mail" value=""> <!-- 수취인 E-Mail -->
<input type="hidden" name="rcvr_zipx" value=""> <!-- 수취인 우편번호 -->
<input type="hidden" name="rcvr_add1" value=""> <!-- 수취인 주소 -->
<input type="hidden" name="rcvr_add2" value=""> <!-- 수취인 상세 주소 -->
<input type="hidden" name="param_opt_1" value="">
<input type="hidden" name="param_opt_2" value="">
<input type="hidden" name="param_opt_3" value="">
<input type="hidden" name="disp_tax_yn" value="N">
<input type="hidden" name="nhnkcp_pay_case" value="">
<?php if($default['de_tax_flag_use']) { ?>
<input type="hidden" name="tax_flag" value="TG03"> <!-- 변경불가 -->
<input type="hidden" name="comm_tax_mny" value="<?php echo $comm_tax_mny; ?>"> <!-- 과세금액 -->
<input type="hidden" name="comm_vat_mny" value="<?php echo $comm_vat_mny; ?>"> <!-- 부가세 -->
<input type="hidden" name="comm_free_mny" value="<?php echo $comm_free_mny; ?>"> <!-- 비과세 금액 -->
<?php }
+9
View File
@@ -0,0 +1,9 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// 타 PG 사용시 NHN KCP 네이버페이 사용이 설정되어 있는지 체크, 그렇지 않다면 return;
if( !(function_exists('is_use_easypay') && is_use_easypay('global_nhnkcp')) ){
return;
}
include_once(G5_MSHOP_PATH.'/settle_kcp.inc.php');
+83
View File
@@ -0,0 +1,83 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 타 PG 사용시 NHN KCP 네이버페이 사용이 설정되어 있는지 체크, 그렇지 않다면 return;
if( !(function_exists('is_use_easypay') && is_use_easypay('global_nhnkcp')) ){
return;
}
?>
<script>
jQuery(function($){
$( document ).ready(function() {
var pf = document.forderform;
// NHN_KCP를 통한 네이버페이가 실행됨
$(pf).on("form_sumbit_order_nhnkcp_naverpay", nhnkcp_naverpay_form_submit);
function nhnkcp_naverpay_form_submit(){
var $form = $(this),
pf = $form[0],
nhnkcp_pay_form = document.nhnkcp_pay_form,
nhnkcp_settle_case = jQuery("input[name='od_settle_case']:checked").attr("data-pay"),
od_settle_case = jQuery("input[name='od_settle_case']:checked").val();
if( nhnkcp_settle_case == "naverpay" ){
if(typeof nhnkcp_pay_form.naverpay_direct !== "undefined") nhnkcp_pay_form.naverpay_direct.value = "Y";
}
if( ! jQuery("form[name='sm_form']").length ){
alert("해당 폼이 존재 하지 않는 결제오류입니다.");
return false;
}
if (document.sm_form.good_mny.value < 1000) {
<?php // 간편결제수단은 신용카드처럼 취급하며 금액은 1000원 이상이므로, 1000원 이상이 아니면 PG사에서 승인하지 않는다. ?>
alert("간편결제는 1000원 이상 결제가 가능합니다.");
return false;
}
nhnkcp_pay_form.good_mny.value = document.sm_form.good_mny.value;
nhnkcp_pay_form.good_info.value = "<?php echo $good_info; ?>";
nhnkcp_pay_form.settle_method.value = od_settle_case;
nhnkcp_pay_form.nhnkcp_pay_case.value = nhnkcp_settle_case;
if(typeof pf.nhnkcp_pay_case !== "undefined") pf.nhnkcp_pay_case.value = nhnkcp_settle_case;
nhnkcp_pay_form.buyr_name.value = pf.od_name.value;
nhnkcp_pay_form.buyr_mail.value = pf.od_email.value;
nhnkcp_pay_form.buyr_tel1.value = pf.od_tel.value;
nhnkcp_pay_form.buyr_tel2.value = pf.od_hp.value;
nhnkcp_pay_form.rcvr_name.value = pf.od_b_name.value;
nhnkcp_pay_form.rcvr_tel1.value = pf.od_b_tel.value;
nhnkcp_pay_form.rcvr_tel2.value = pf.od_b_hp.value;
nhnkcp_pay_form.rcvr_mail.value = pf.od_email.value;
nhnkcp_pay_form.rcvr_zipx.value = pf.od_b_zip.value;
nhnkcp_pay_form.rcvr_add1.value = pf.od_b_addr1.value;
nhnkcp_pay_form.rcvr_add2.value = pf.od_b_addr2.value;
// 주문 정보 임시저장
var order_data = $(pf).serialize();
var save_result = "";
$.ajax({
type: "POST",
data: order_data,
url: g5_url+"/shop/ajax.orderdatasave.php",
cache: false,
async: false,
success: function(data) {
save_result = data;
}
});
if(save_result) {
alert(save_result);
return false;
}
nhnkcp_pay_form.submit();
return false;
}
});
});
</script>
+53
View File
@@ -0,0 +1,53 @@
<?php
include_once('./_common.php');
include_once(G5_MSHOP_PATH.'/settle_kcp.inc.php');
require_once(G5_MSHOP_PATH.'/kcp/KCPComLibrary.php'); // library [수정불가]
?>
<?php
// 쇼핑몰 페이지에 맞는 문자셋을 지정해 주세요.
$charSetType = 'utf-8'; // UTF-8인 경우 "utf-8"로 설정
$siteCode = $_GET[ 'site_cd' ];
$orderID = $_GET[ 'ordr_idxx' ];
$paymentMethod = $_GET[ 'pay_method' ];
$escrow = ( $_GET[ 'escw_used' ] == 'Y' ) ? true : false;
$productName = $_GET[ 'good_name' ];
// 아래 두값은 POST된 값을 사용하지 않고 서버에 SESSION에 저장된 값을 사용하여야 함.
$paymentAmount = $_GET[ 'good_mny' ]; // 결제 금액
$returnUrl = $_GET[ 'Ret_URL' ];
// Access Credential 설정
$accessLicense = '';
$signature = '';
$timestamp = '';
// Base Request Type 설정
$detailLevel = '0';
$requestApp = 'WEB';
$requestID = $orderID;
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$version = '0.1';
try
{
$payService = new PayService( $g_wsdl );
$payService->setCharSet( $charSetType );
$payService->setAccessCredentialType( $accessLicense, $signature, $timestamp );
$payService->setBaseRequestType( $detailLevel, $requestApp, $requestID, $userAgent, $version );
$payService->setApproveReq( $escrow, $orderID, $paymentAmount, $paymentMethod, $productName, $returnUrl, $siteCode );
$approveRes = $payService->approve();
printf( "%s,%s,%s,%s", $payService->resCD, $approveRes->approvalKey,
$approveRes->payUrl, $payService->resMsg );
}
catch (SoapFault $ex )
{
printf( "%s,%s,%s,%s", "95XX", "", "", "연동 오류 (PHP SOAP 모듈 설치 필요)" );
}
+413
View File
@@ -0,0 +1,413 @@
<?php
include_once('./_common.php');
@header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1.
@header('Pragma: no-cache'); // HTTP 1.0.
@header('Expires: 0'); // Proxies.
/* ============================================================================== */
/* = PAGE : 결제 요청 PAGE = */
/* = -------------------------------------------------------------------------- = */
/* = 이 페이지는 주문 페이지를 통해서 결제자가 결제 요청을 하는 페이지 = */
/* = 입니다. 아래의 ※ 필수, ※ 옵션 부분과 매뉴얼을 참조하셔서 연동을 = */
/* = 진행하여 주시기 바랍니다. = */
/* = -------------------------------------------------------------------------- = */
/* = 연동시 오류가 발생하는 경우 아래의 주소로 접속하셔서 확인하시기 바랍니다.= */
/* = 접속 주소 : http://testpay.kcp.co.kr/pgsample/FAQ/search_error.jsp = */
/* = -------------------------------------------------------------------------- = */
/* = Copyright (c) 2010.05 KCP Inc. All Rights Reserved. = */
/* ============================================================================== */
/* ============================================================================== */
/* = 환경 설정 파일 Include = */
/* = -------------------------------------------------------------------------- = */
/* = ※ 필수 = */
/* = 테스트 및 실결제 연동시 site_conf_inc.php파일을 수정하시기 바랍니다. = */
/* = -------------------------------------------------------------------------- = */
include_once(G5_MSHOP_PATH.'/settle_kcp.inc.php'); // 환경설정 파일 include
/* = -------------------------------------------------------------------------- = */
/* = 환경 설정 파일 Include END = */
/* ============================================================================== */
/* kcp와 통신후 kcp 서버에서 전송되는 결제 요청 정보*/
$req_tx = isset($_POST["req_tx"]) ? $_POST["req_tx"] : ''; // 요청 종류
$res_cd = isset($_POST["res_cd"]) ? $_POST["res_cd"] : ''; // 응답 코드
$tran_cd = isset($_POST["tran_cd"]) ? $_POST["tran_cd"] : ''; // 트랜잭션 코드
$ordr_idxx = isset($_POST["ordr_idxx"]) ? $_POST["ordr_idxx"] : ''; // 쇼핑몰 주문번호
$good_name = isset($_POST["good_name"]) ? $_POST["good_name"] : ''; // 상품명
$good_mny = isset($_POST["good_mny"]) ? $_POST["good_mny"] : ''; // 결제 총금액
$buyr_name = isset($_POST["buyr_name"]) ? $_POST["buyr_name"] : ''; // 주문자명
$buyr_tel1 = isset($_POST["buyr_tel1"]) ? $_POST["buyr_tel1"] : ''; // 주문자 전화번호
$buyr_tel2 = isset($_POST["buyr_tel2"]) ? $_POST["buyr_tel2"] : ''; // 주문자 핸드폰 번호
$buyr_mail = isset($_POST["buyr_mail"]) ? $_POST["buyr_mail"] : ''; // 주문자 E-mail 주소
$use_pay_method = isset($_POST["use_pay_method"]) ? $_POST["use_pay_method"] : ''; // 결제 방법
$enc_info = isset($_POST["enc_info"]) ? $_POST["enc_info"] : ''; // 암호화 정보
$enc_data = isset($_POST["enc_data"]) ? $_POST["enc_data"] : ''; // 암호화 데이터
$rcvr_name = isset($_POST["rcvr_name"]) ? $_POST["rcvr_name"] : ''; // 수취인 이름
$rcvr_tel1 = isset($_POST["rcvr_tel1"]) ? $_POST["rcvr_tel1"] : ''; // 수취인 전화번호
$rcvr_tel2 = isset($_POST["rcvr_tel2"]) ? $_POST["rcvr_tel2"] : ''; // 수취인 휴대폰번호
$rcvr_mail = isset($_POST["rcvr_mail"]) ? $_POST["rcvr_mail"] : ''; // 수취인 E-Mail
$rcvr_zipx = isset($_POST["rcvr_zipx"]) ? $_POST["rcvr_zipx"] : ''; // 수취인 우편번호
$rcvr_add1 = isset($_POST["rcvr_add1"]) ? $_POST["rcvr_add1"] : ''; // 수취인 주소
$rcvr_add2 = isset($_POST["rcvr_add2"]) ? $_POST["rcvr_add2"] : ''; // 수취인 상세주소
/* 주문폼에서 전송되는 정보 */
$ipgm_date = isset($_POST['ipgm_date']) ? $_POST['ipgm_date'] : ''; // 입금마감일
$settle_method = isset($_POST["settle_method"]) ? $_POST["settle_method"] : ''; // 결제방법
$good_info = isset($_POST["good_info"]) ? $_POST["good_info"] : ''; // 에스크로 상품정보
$bask_cntx = isset($_POST["bask_cntx"]) ? $_POST["bask_cntx"] : ''; // 장바구니 상품수
$tablet_size = isset($_POST["tablet_size"]) ? $_POST["tablet_size"] : ''; // 모바일기기 화면비율
$comm_tax_mny = isset($_POST["comm_tax_mny"]) ? $_POST["comm_tax_mny"] : ''; // 과세금액
$comm_vat_mny = isset($_POST["comm_vat_mny"]) ? $_POST["comm_vat_mny"] : ''; // 부가세
$comm_free_mny = isset($_POST["comm_free_mny"]) ? $_POST["comm_free_mny"] : ''; // 비과세금액
$payco_direct = isset($_POST["payco_direct"]) ? $_POST["payco_direct"] : ''; // PAYCO 결제창 호출
$naverpay_direct = isset($_POST["naverpay_direct"]) ? $_POST["naverpay_direct"] : ''; // NAVERPAY 결제창 호출
$kakaopay_direct = isset($_POST["kakaopay_direct"]) ? $_POST["kakaopay_direct"] : ''; // KAKAOPAY 결제창 호출
$applepay_direct = isset($_POST["applepay_direct"]) ? $_POST["applepay_direct"] : ''; // APPLEPAY 결제창 호출
/*
* 기타 파라메터 추가 부분 - Start -
*/
$param_opt_1 = isset($_POST["param_opt_1"]) ? $_POST["param_opt_1"] : ''; // 기타 파라메터 추가 부분
$param_opt_2 = isset($_POST["param_opt_2"]) ? $_POST["param_opt_2"] : ''; // 기타 파라메터 추가 부분
$param_opt_3 = isset($_POST["param_opt_3"]) ? $_POST["param_opt_3"] : ''; // 기타 파라메터 추가 부분
/*
* 기타 파라메터 추가 부분 - End -
*/
/* kcp 데이터 캐릭터셋 변환 */
if($res_cd != '') {
$good_name = iconv('euc-kr', 'utf-8', $good_name);
$buyr_name = iconv('euc-kr', 'utf-8', $buyr_name);
$rcvr_name = iconv('euc-kr', 'utf-8', $rcvr_name);
$rcvr_add1 = iconv('euc-kr', 'utf-8', $rcvr_add1);
$rcvr_add2 = iconv('euc-kr', 'utf-8', $rcvr_add2);
}
// 에스크로 변수 ( 간편결제의 경우 N 으로 변경 )
$escw_used = 'Y';
switch($settle_method)
{
case '신용카드':
$pay_method = 'CARD';
$ActionResult = 'card';
break;
case '계좌이체':
$pay_method = 'BANK';
$ActionResult = 'acnt';
break;
case '휴대폰':
$pay_method = 'MOBX';
$ActionResult = 'mobx';
break;
case '가상계좌':
$pay_method = 'VCNT';
$ActionResult = 'vcnt';
break;
case '간편결제':
$pay_method = 'CARD';
$ActionResult = 'card';
$escw_used = 'N';
break;
default:
$pay_method = '';
$ActionResult = '';
break;
}
if(get_session('ss_personalpay_id') && get_session('ss_personalpay_hash')) {
$js_return_url = G5_SHOP_URL.'/personalpayform.php?pp_id='.get_session('ss_personalpay_id');
} else {
$js_return_url = G5_SHOP_URL.'/orderform.php';
if(get_session('ss_direct'))
$js_return_url .= '?sw_direct=1';
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ko" xml:lang="ko">
<head>
<title>스마트폰 웹 결제창</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Cache-Control" content="No-Cache">
<meta http-equiv="Pragma" content="No-Cache">
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=0,maximum-scale=10">
<meta name="HandheldFriendly" content="true">
<meta name="format-detection" content="telephone=no">
<style type="text/css">
.LINE { background-color:#afc3ff }
.HEAD { font-family:"굴림","굴림체"; font-size:9pt; color:#065491; background-color:#eff5ff; text-align:left; padding:3px; }
.TEXT { font-family:"굴림","굴림체"; font-size:9pt; color:#000000; background-color:#FFFFFF; text-align:left; padding:3px; }
B { font-family:"굴림","굴림체"; font-size:13pt; color:#065491;}
INPUT { font-family:"굴림","굴림체"; font-size:9pt; }
SELECT{font-size:9pt;}
.COMMENT { font-family:"굴림","굴림체"; font-size:9pt; line-height:160% }
</style>
<!-- 거래등록 하는 kcp 서버와 통신을 위한 스크립트-->
<script src="<?php echo G5_MSHOP_URL; ?>/kcp/approval_key.js"></script>
<script language="javascript">
/* kcp web 결제창 호출 (변경불가)*/
function call_pay_form()
{
var v_frm = document.sm_form;
layer_cont_obj = document.getElementById("content");
layer_receipt_obj = document.getElementById("layer_receipt");
layer_cont_obj.style.display = "none";
layer_receipt_obj.style.display = "block";
v_frm.target = "frm_receipt";
// IOS 환경의 경우 iframe에서 네이버페이와 애플페이의 cors 문제가 일어나므로 iframe으로 열지 않는다.
var isIOS = /iPad|iPhone|iPod/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
if (isIOS) {
v_frm.target = "";
}
// 네이버페이 또는 애플페이의 경우 반드시 페이지전환 방식이어야 하며, 그 외에는 iframe 방식으로 한다.
if((typeof v_frm.naverpay_direct !== "undefined" && v_frm.naverpay_direct.value == "Y") || (typeof v_frm.applepay_direct !== "undefined" && v_frm.applepay_direct.value == "Y")) {
v_frm.target = "";
}
v_frm.action = PayUrl;
if(v_frm.Ret_URL.value == "")
{
/* Ret_URL값은 현 페이지의 URL 입니다. */
alert("연동시 Ret_URL을 반드시 설정하셔야 됩니다.");
document.location.href = "<?php echo $js_return_url; ?>";
return false;
}
v_frm.submit();
}
/* kcp 통신을 통해 받은 암호화 정보 체크 후 결제 요청*/
function chk_pay()
{
/*kcp 결제서버에서 가맹점 주문페이지로 폼값을 보내기위한 설정(변경불가)*/
self.name = "tar_opener";
var sm_form = document.sm_form;
if (sm_form.res_cd.value == "3001" )
{
alert("사용자가 취소하였습니다.");
document.location.href = "<?php echo $js_return_url; ?>";
return false;
}
else if (sm_form.res_cd.value == "3000" )
{
alert("30만원 이상 결제 할수 없습니다.");
document.location.href = "<?php echo $js_return_url; ?>";
return false;
}
if (sm_form.enc_data.value != "" && sm_form.enc_info.value != "" && sm_form.tran_cd.value !="" )
{
document.getElementById("pay_fail").style.display = "none";
document.getElementById("show_progress").style.display = "block";
setTimeout( function() {
document.forderform.submit();
}, 300);
} else {
kcp_AJAX();
}
}
</script>
</head>
<body onload="chk_pay();">
<div id="content">
<?php
if($enc_data != '' && $enc_info != '' && $tran_cd != '') {
// 제외할 필드
$exclude = array('req_tx', 'res_cd', 'tran_cd', 'ordr_idxx', 'good_mny', 'good_name', 'buyr_name', 'buyr_tel1', 'buyr_tel2', 'buyr_mail', 'enc_info', 'enc_data', 'use_pay_method', 'rcvr_name', 'rcvr_tel1', 'rcvr_tel2', 'rcvr_mail', 'rcvr_zipx', 'rcvr_add1', 'rcvr_add2', 'param_opt_1', 'param_opt_2', 'param_opt_3');
$sql = " select * from {$g5['g5_shop_order_data_table']} where od_id = '$ordr_idxx' ";
$row = sql_fetch($sql);
$data = isset($row['dt_data']) ? unserialize(base64_decode($row['dt_data'])) : array();
if(isset($data['pp_id']) && $data['pp_id']) {
$order_action_url = G5_HTTPS_MSHOP_URL.'/personalpayformupdate.php';
} else {
$order_action_url = G5_HTTPS_MSHOP_URL.'/orderformupdate.php';
}
echo '<form name="forderform" method="post" action="'.$order_action_url.'" autocomplete="off">'.PHP_EOL;
echo make_order_field($data, $exclude);
foreach($_POST as $key=>$value) {
echo '<input type="hidden" name="'.$key.'" value="'.$value.'">'.PHP_EOL;
}
echo '</form>'.PHP_EOL;
}
?>
<form name="sm_form" method="POST" accept-charset="euc-kr">
<input type="hidden" name="good_name" value="<?php echo $good_name; ?>">
<input type="hidden" name="good_mny" value="<?php echo $good_mny; ?>" >
<input type="hidden" name='buyr_name' value="<?php echo $buyr_name; ?>">
<input type="hidden" name="buyr_tel1" value="<?php echo $buyr_tel1; ?>">
<input type="hidden" name="buyr_tel2" value="<?php echo $buyr_tel2; ?>">
<input type="hidden" name="buyr_mail" value="<?php echo $buyr_mail; ?>">
<?php
// 가상계좌 입금 마감일을 설정하려면 아래 주석을 풀어서 사용해 주세요.
//$ipgm_date = date("Ymd", (G5_SERVER_TIME + 86400 * 5));
//echo '<input type="hidden" name="ipgm_date" value="'.$ipgm_date.'">';
?>
<?php if($payco_direct){ ?>
<input type="hidden" name="payco_direct" value="<?php echo get_text($payco_direct); ?>"> <!-- PAYCO 결제창 호출 -->
<?php } ?>
<?php if($naverpay_direct){ ?>
<input type="hidden" name="naverpay_direct" value="<?php echo get_text($naverpay_direct); ?>"> <!-- 네이버페이 결제창 호출 -->
<?php if(isset($default['de_easy_pay_services']) && in_array('used_nhnkcp_naverpay_point', explode(',', $default['de_easy_pay_services'])) ){ // 네이버페이 포인트 결제 옵션 ?>
<input type="hidden" name="naverpay_point_direct" value="Y"> <!-- 네이버페이 포인트 결제를 하려면 naverpay_point_direct 를 Y -->
<?php } ?>
<?php } ?>
<?php if($applepay_direct === "Y"){ ?>
<input type="hidden" name="applepay_direct" value="<?php echo get_text($applepay_direct); ?>"> <!-- 애플페이 결제창 호출 -->
<?php } ?>
<?php if($kakaopay_direct){ ?>
<input type="hidden" name="kakaopay_direct" value="<?php echo get_text($kakaopay_direct); ?>"> <!-- 카카오페이 결제창 호출 -->
<?php } ?>
<!-- 필수 사항 -->
<!-- 요청 구분 -->
<input type="hidden" name="req_tx" value="pay">
<!-- 사이트 코드 -->
<input type="hidden" name="site_cd" value="<?php echo $g_conf_site_cd; ?>">
<!-- 사이트 이름 -->
<input type="hidden" name="shop_name" value="<?php echo $g_conf_site_name; ?>">
<!-- 결제수단-->
<input type="hidden" name="pay_method" value="<?php echo $pay_method; ?>">
<!-- 주문번호 -->
<input type="hidden" name="ordr_idxx" value="<?php echo $ordr_idxx; ?>">
<!-- 최대 할부개월수 -->
<input type="hidden" name="quotaopt" value="12">
<!-- 통화 코드 -->
<input type="hidden" name="currency" value="410">
<!-- 결제등록 키 -->
<input type="hidden" name="approval_key" id="approval">
<!-- 리턴 URL (kcp와 통신후 결제를 요청할 수 있는 암호화 데이터를 전송 받을 가맹점의 주문페이지 URL) -->
<!-- 반드시 가맹점 주문페이지의 URL을 입력 해주시기 바랍니다. -->
<input type="hidden" name="Ret_URL" value="<?php echo G5_MSHOP_URL; ?>/kcp/order_approval_form.php">
<!-- 인증시 필요한 파라미터(변경불가)-->
<input type="hidden" name="ActionResult" value="<?php echo $ActionResult; ?>">
<!-- 에스크로 사용유무 에스크로 사용 업체(가상계좌만 해당)는 Y로 세팅 해주시기 바랍니다.-->
<input type="hidden" name="escw_used" value="<?php echo $escw_used; ?>">
<!-- 에스크로 결제처리모드 -->
<input type="hidden" name="pay_mod" value="<?php echo ($default['de_escrow_use']?'O':'N'); ?>">
<!-- 수취인이름 -->
<input type="hidden" name="rcvr_name" value="<?php echo $rcvr_name; ?>">
<!-- 수취인 연락처 -->
<input type="hidden" name="rcvr_tel1" value="<?php echo $rcvr_tel1; ?>">
<!-- 수취인 휴대폰 번호 -->
<input type="hidden" name="rcvr_tel2" value="<?php echo $rcvr_tel2; ?>">
<!-- 수취인 E-MAIL -->
<input type="hidden" name="rcvr_add1" value="<?php echo $rcvr_add1; ?>">
<!-- 수취인 우편번호 -->
<input type="hidden" name="rcvr_add2" value="<?php echo $rcvr_add2; ?>">
<!-- 수취인 주소 -->
<input type="hidden" name="rcvr_mail" value="<?php echo $rcvr_mail; ?>">
<!-- 수취인 상세 주소 -->
<input type="hidden" name="rcvr_zipx" value="<?php echo $rcvr_zipx; ?>">
<!-- 장바구니 상품 개수 -->
<input type="hidden" name="bask_cntx" value="<?php echo $bask_cntx; ?>">
<!-- 장바구니 정보(상단 스크립트 참조) -->
<input type="hidden" name="good_info" value="<?php echo $good_info; ?>">
<!-- 배송소요기간 -->
<input type="hidden" name="deli_term" value="03">
<!-- 기타 파라메터 추가 부분 - Start - -->
<input type="hidden" name="param_opt_1" value="<?php echo get_text($param_opt_1); ?>"/>
<input type="hidden" name="param_opt_2" value="<?php echo get_text($param_opt_2); ?>"/>
<input type="hidden" name="param_opt_3" value="<?php echo get_text($param_opt_3); ?>"/>
<input type="hidden" name="disp_tax_yn" value="N">
<!-- 기타 파라메터 추가 부분 - End - -->
<!-- 화면 크기조정 부분 - Start - -->
<input type="hidden" name="tablet_size" value="<?php echo $tablet_size; ?>"/>
<!-- 화면 크기조정 부분 - End - -->
<!--
사용 카드 설정
<input type="hidden" name="used_card" value="CClg:ccDI">
/* 무이자 옵션
※ 설정할부 (가맹점 관리자 페이지에 설정 된 무이자 설정을 따른다) - "" 로 설정
※ 일반할부 (KCP 이벤트 이외에 설정 된 모든 무이자 설정을 무시한다) - "N" 로 설정
※ 무이자 할부 (가맹점 관리자 페이지에 설정 된 무이자 이벤트 중 원하는 무이자 설정을 세팅한다) - "Y" 로 설정
<input type="hidden" name="kcp_noint" value=""/> */
/* 무이자 설정
※ 주의 1 : 할부는 결제금액이 50,000 원 이상일 경우에만 가능
※ 주의 2 : 무이자 설정값은 무이자 옵션이 Y일 경우에만 결제 창에 적용
예) 전 카드 2,3,6개월 무이자(국민,비씨,엘지,삼성,신한,현대,롯데,외환) : ALL-02:03:04
BC 2,3,6개월, 국민 3,6개월, 삼성 6,9개월 무이자 : CCBC-02:03:06,CCKM-03:06,CCSS-03:06:04
<input type="hidden" name="kcp_noint_quota" value="CCBC-02:03:06,CCKM-03:06,CCSS-03:06:09"/> */
-->
<input type="hidden" name="kcp_noint" value="<?php echo ($default['de_card_noint_use'] ? '' : 'N'); ?>">
<?php
if($default['de_tax_flag_use']) {
/* KCP는 과세상품과 비과세상품을 동시에 판매하는 업체들의 결제관리에 대한 편의성을 제공해드리고자,
복합과세 전용 사이트코드를 지원해 드리며 총 금액에 대해 복합과세 처리가 가능하도록 제공하고 있습니다
복합과세 전용 사이트 코드로 계약하신 가맹점에만 해당이 됩니다
상품별이 아니라 금액으로 구분하여 요청하셔야 합니다
총결제 금액은 과세금액 + 부과세 + 비과세금액의 합과 같아야 합니다.
(good_mny = comm_tax_mny + comm_vat_mny + comm_free_mny) */
?>
<input type="hidden" name="tax_flag" value="TG03"> <!-- 변경불가 -->
<input type="hidden" name="comm_tax_mny" value="<?php echo $comm_tax_mny; ?>"> <!-- 과세금액 -->
<input type="hidden" name="comm_vat_mny" value="<?php echo $comm_vat_mny; ?>"> <!-- 부가세 -->
<input type="hidden" name="comm_free_mny" value="<?php echo $comm_free_mny; ?>"> <!-- 비과세 금액 -->
<?php
}
?>
<input type="hidden" name="res_cd" value="<?php echo $res_cd; ?>"> <!-- 결과 코드 -->
<input type="hidden" name="tran_cd" value="<?php echo $tran_cd; ?>"> <!-- 트랜잭션 코드 -->
<input type="hidden" name="enc_info" value="<?php echo $enc_info; ?>"> <!-- 암호화 정보 -->
<input type="hidden" name="enc_data" value="<?php echo $enc_data; ?>"> <!-- 암호화 데이터 -->
</form>
<div id="pay_fail">
<p>결제가 실패한 경우 아래 돌아가기 버튼을 클릭해주세요.</p>
<a href="<?php echo $js_return_url; ?>">돌아가기</a>
</div>
<div id="show_progress" style="display:none;">
<span style="display:block; text-align:center;margin-top:120px"><img src="<?php echo G5_MOBILE_URL; ?>/shop/img/loading.gif" alt="" ></span>
<span style="display:block; text-align:center;margin-top:10px; font-size:14px">주문완료 중입니다. 잠시만 기다려 주십시오.</span>
</div>
</div>
<!-- 스마트폰에서 KCP 결제창을 레이어 형태로 구현-->
<div id="layer_receipt" style="position:absolute; left:1px; top:1px; width:100%;height:100%; z-index:1; display:none;">
<table width="100%" height="100%" border="-" cellspacing="0" cellpadding="0" style="text-align:center">
<tr height="100%" width="100%">
<td>
<iframe name="frm_receipt" frameborder="0" border="0" width="100%" height="100%" scrolling="auto"></iframe>
</td>
</tr>
</table>
</div>
</body>
</html>
+103
View File
@@ -0,0 +1,103 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 무통장 입금만 사용할 때는 아래 코드 실행되지 않음 ( 카카오페이 또는 삼성페이도 사용 안하면 )
if(!($default['de_iche_use'] || $default['de_vbank_use'] || $default['de_hp_use'] || $default['de_card_use'] || $default['de_samsung_pay_use'] || $is_kakaopay_use ))
return;
$param_opt_1 = isset($_REQUEST['param_opt_1']) ? clean_xss_tags($_REQUEST['param_opt_1'], 1, 1) : '';
$param_opt_2 = isset($_REQUEST['param_opt_2']) ? clean_xss_tags($_REQUEST['param_opt_2'], 1, 1) : '';
$param_opt_3 = isset($_REQUEST['param_opt_3']) ? clean_xss_tags($_REQUEST['param_opt_3'], 1, 1) : '';
?>
<!-- 거래등록 하는 kcp 서버와 통신을 위한 스크립트-->
<script src="<?php echo G5_MSHOP_URL; ?>/kcp/approval_key.js"></script>
<form name="sm_form" method="POST" action="<?php echo G5_MSHOP_URL; ?>/kcp/order_approval_form.php">
<input type="hidden" name="good_name" value="<?php echo $goods; ?>">
<input type="hidden" name="good_mny" value="<?php echo $tot_price ?>" >
<input type="hidden" name="buyr_name" value="">
<input type="hidden" name="buyr_tel1" value="">
<input type="hidden" name="buyr_tel2" value="">
<input type="hidden" name="buyr_mail" value="">
<input type="hidden" name="settle_method" value="">
<input type="hidden" name="payco_direct" value=""> <!-- PAYCO 결제창 호출 -->
<input type="hidden" name="naverpay_direct" value="A" > <!-- NAVERPAY 결제창 호출 -->
<input type="hidden" name="kakaopay_direct" value="A" > <!-- KAKAOPAY 결제창 호출 -->
<input type="hidden" name="applepay_direct" value="A" > <!-- APPLEPAY 결제창 호출 -->
<!-- 주문번호 -->
<input type="hidden" name="ordr_idxx" value="<?php echo $od_id; ?>">
<!-- 인증수단(영문 소문자) * 반드시 대소문자 구분 -->
<input type="hidden" name="ActionResult" value="">
<!-- 결제등록 키 -->
<input type="hidden" name="approval_key" id="approval">
<!-- 수취인이름 -->
<input type="hidden" name="rcvr_name" value="">
<!-- 수취인 연락처 -->
<input type="hidden" name="rcvr_tel1" value="">
<!-- 수취인 휴대폰 번호 -->
<input type="hidden" name="rcvr_tel2" value="">
<!-- 수취인 E-MAIL -->
<input type="hidden" name="rcvr_add1" value="">
<!-- 수취인 우편번호 -->
<input type="hidden" name="rcvr_add2" value="">
<!-- 수취인 주소 -->
<input type="hidden" name="rcvr_mail" value="">
<!-- 수취인 상세 주소 -->
<input type="hidden" name="rcvr_zipx" value="">
<!-- 장바구니 상품 개수 -->
<input type="hidden" name="bask_cntx" value="<?php echo (int)$goods_count + 1; ?>">
<!-- 장바구니 정보(상단 스크립트 참조) -->
<input type="hidden" name="good_info" value="<?php echo $good_info; ?>">
<!-- 배송소요기간 -->
<input type="hidden" name="deli_term" value="03">
<!-- 기타 파라메터 추가 부분 - Start - -->
<input type="hidden" name="param_opt_1" value="<?php echo get_text($param_opt_1); ?>"/>
<input type="hidden" name="param_opt_2" value="<?php echo get_text($param_opt_2); ?>"/>
<input type="hidden" name="param_opt_3" value="<?php echo get_text($param_opt_3); ?>"/>
<input type="hidden" name="disp_tax_yn" value="N">
<!-- 기타 파라메터 추가 부분 - End - -->
<!-- 화면 크기조정 부분 - Start - -->
<input type="hidden" name="tablet_size" value="<?php echo $tablet_size; ?>"/>
<!-- 화면 크기조정 부분 - End - -->
<!--
사용 카드 설정
<input type="hidden" name='used_card' value="CClg:ccDI">
/* 무이자 옵션
※ 설정할부 (가맹점 관리자 페이지에 설정 된 무이자 설정을 따른다) - "" 로 설정
※ 일반할부 (KCP 이벤트 이외에 설정 된 모든 무이자 설정을 무시한다) - "N" 로 설정
※ 무이자 할부 (가맹점 관리자 페이지에 설정 된 무이자 이벤트 중 원하는 무이자 설정을 세팅한다) - "Y" 로 설정
<input type="hidden" name="kcp_noint" value=""/> */
/* 무이자 설정
※ 주의 1 : 할부는 결제금액이 50,000 원 이상일 경우에만 가능
※ 주의 2 : 무이자 설정값은 무이자 옵션이 Y일 경우에만 결제 창에 적용
예) 전 카드 2,3,6개월 무이자(국민,비씨,엘지,삼성,신한,현대,롯데,외환) : ALL-02:03:04
BC 2,3,6개월, 국민 3,6개월, 삼성 6,9개월 무이자 : CCBC-02:03:06,CCKM-03:06,CCSS-03:06:04
<input type="hidden" name="kcp_noint_quota" value="CCBC-02:03:06,CCKM-03:06,CCSS-03:06:09"/> */
-->
<input type="hidden" name="kcp_noint" value="<?php echo ($default['de_card_noint_use'] ? '' : 'N'); ?>">
<?php
if($default['de_tax_flag_use']) {
/* KCP는 과세상품과 비과세상품을 동시에 판매하는 업체들의 결제관리에 대한 편의성을 제공해드리고자,
복합과세 전용 사이트코드를 지원해 드리며 총 금액에 대해 복합과세 처리가 가능하도록 제공하고 있습니다
복합과세 전용 사이트 코드로 계약하신 가맹점에만 해당이 됩니다
상품별이 아니라 금액으로 구분하여 요청하셔야 합니다
총결제 금액은 과세금액 + 부과세 + 비과세금액의 합과 같아야 합니다.
(good_mny = comm_tax_mny + comm_vat_mny + comm_free_mny)
복합과세는 order_approval_form.php 파일의 의해 적용됨
아래 필드는 order_approval_form.php 파일로 전송하는 것
*/
?>
<input type="hidden" name="tax_flag" value="TG03"> <!-- 변경불가 -->
<input type="hidden" name="comm_tax_mny" value="<?php echo $comm_tax_mny; ?>"> <!-- 과세금액 -->
<input type="hidden" name="comm_vat_mny" value="<?php echo $comm_vat_mny; ?>"> <!-- 부가세 -->
<input type="hidden" name="comm_free_mny" value="<?php echo $comm_free_mny; ?>"> <!-- 비과세 금액 -->
<?php
}
?>
</form>
+50
View File
@@ -0,0 +1,50 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<input type="hidden" name="req_tx" value=""> <!-- 요청 구분 -->
<input type="hidden" name="res_cd" value=""> <!-- 결과 코드 -->
<input type="hidden" name="tran_cd" value=""> <!-- 트랜잭션 코드 -->
<input type="hidden" name="ordr_idxx" value=""> <!-- 주문번호 -->
<input type="hidden" name="good_mny" value=""> <!-- 결제금액 -->
<input type="hidden" name="good_name" value=""> <!-- 상품명 -->
<input type="hidden" name="buyr_name" value=""> <!-- 주문자명 -->
<input type="hidden" name="buyr_tel1" value=""> <!-- 주문자 전화번호 -->
<input type="hidden" name="buyr_tel2" value=""> <!-- 주문자 휴대폰번호 -->
<input type="hidden" name="buyr_mail" value=""> <!-- 주문자 E-mail -->
<input type="hidden" name="enc_info" value=""> <!-- 암호화 정보 -->
<input type="hidden" name="enc_data" value=""> <!-- 암호화 데이터 -->
<input type="hidden" name="use_pay_method" value=""> <!-- 요청된 결제 수단 -->
<input type="hidden" name="rcvr_name" value=""> <!-- 수취인 이름 -->
<input type="hidden" name="rcvr_tel1" value=""> <!-- 수취인 전화번호 -->
<input type="hidden" name="rcvr_tel2" value=""> <!-- 수취인 휴대폰번호 -->
<input type="hidden" name="rcvr_mail" value=""> <!-- 수취인 E-Mail -->
<input type="hidden" name="rcvr_zipx" value=""> <!-- 수취인 우편번호 -->
<input type="hidden" name="rcvr_add1" value=""> <!-- 수취인 주소 -->
<input type="hidden" name="rcvr_add2" value=""> <!-- 수취인 상세 주소 -->
<input type="hidden" name="param_opt_1" value="">
<input type="hidden" name="param_opt_2" value="">
<input type="hidden" name="param_opt_3" value="">
<input type="hidden" name="disp_tax_yn" value="N">
<?php if($default['de_tax_flag_use']) { ?>
<input type="hidden" name="tax_flag" value="TG03"> <!-- 변경불가 -->
<input type="hidden" name="comm_tax_mny" value="<?php echo $comm_tax_mny; ?>"> <!-- 과세금액 -->
<input type="hidden" name="comm_vat_mny" value="<?php echo $comm_vat_mny; ?>"> <!-- 부가세 -->
<input type="hidden" name="comm_free_mny" value="<?php echo $comm_free_mny; ?>"> <!-- 비과세 금액 -->
<?php } ?>
<div id="display_pay_button" class="btn_confirm">
<span id="show_req_btn"><input type="button" name="submitChecked" onClick="pay_approval();" value="결제등록요청" class="btn_submit"></span>
<span id="show_pay_btn" style="display:none;"><input type="button" onClick="forderform_check();" value="주문하기" class="btn_submit"></span>
<a href="<?php echo G5_SHOP_URL; ?>" class="btn_cancel">취소</a>
</div>
<?php
// 무통장 입금만 사용할 때는 주문하기 버튼 보이게
if(!($default['de_iche_use'] || $default['de_vbank_use'] || $default['de_hp_use'] || $default['de_card_use'])) {
?>
<script>
document.getElementById("show_req_btn").style.display = "none";
document.getElementById("show_pay_btn").style.display = "";
</script>
<?php }
+48
View File
@@ -0,0 +1,48 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<section id="sod_frm_escrow">
<h2>에스크로 안내</h2>
<form name="escrow_foot" method="post" action="http://admin.kcp.co.kr/Modules/escrow/kcp_pop.jsp">
<input type="hidden" name="site_cd" value="<?php echo $default['de_kcp_mid']; ?>">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td align='center'><img src="<?php echo G5_SHOP_URL; ?>/img/marks_escrow/escrow_foot.gif" width="290" height="92" border="0" usemap="#Map"></td>
</tr>
<tr>
<td style='line-height:150%;'>
<br>
<strong>에스크로(escrow) 제도란?</strong>
<br>상거래 시에, 판매자와 구매자의 사이에 신뢰할 수 있는 중립적인 제삼자(여기서는 <a href='http://kcp.co.kr' target='_blank'>KCP</a>)가 중개하여
금전 또는 물품을 거래를 하도록 하는 것, 또는 그러한 서비스를 말한다. 거래의 안전성을 확보하기 위해 이용된다.
(2006.4.1 전자상거래 소비자보호법에 따른 의무 시행)
<br><br>
현금 거래에만 해당(에스크로 결제를 선택했을 경우에만 해당)되며,
신용카드로 구매하는 거래, 배송이 필요하지 않은 재화 등을 구매하는 거래(컨텐츠 등)에는 해당되지 않는다.
<br>
<br>
</td>
</tr>
</table>
<map name="Map" id="Map">
<area shape="rect" coords="5,62,74,83" href="javascript:escrow_foot_check()" alt="가입사실확인">
</map>
</form>
</section>
<script>
function escrow_foot_check()
{
var status = "width=500 height=450 menubar=no,scrollbars=no,resizable=no,status=no";
var obj = window.open('', 'escrow_foot_pop', status);
document.escrow_foot.method = "post";
document.escrow_foot.target = "escrow_foot_pop";
document.escrow_foot.action = "http://admin.kcp.co.kr/Modules/escrow/kcp_pop.jsp";
document.escrow_foot.submit();
}
</script>
<!-- <?php if ($default['de_card_use'] || $default['de_iche_use']) { echo "결제대행사 : KCP"; } ?> -->
+303
View File
@@ -0,0 +1,303 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
/* ============================================================================== */
/* = PAGE : 지불 요청 및 결과 처리 PAGE = */
/* = -------------------------------------------------------------------------- = */
/* = 연동시 오류가 발생하는 경우 아래의 주소로 접속하셔서 확인하시기 바랍니다.= */
/* = 접속 주소 : http://testpay.kcp.co.kr/pgsample/FAQ/search_error.jsp = */
/* = -------------------------------------------------------------------------- = */
/* = Copyright (c) 2010.05 KCP Inc. All Rights Reserved. = */
/* ============================================================================== */
/* ============================================================================== */
/* = 환경 설정 파일 Include = */
/* = -------------------------------------------------------------------------- = */
/* = ※ 필수 = */
/* = 테스트 및 실결제 연동시 site_conf_inc.php파일을 수정하시기 바랍니다. = */
/* = -------------------------------------------------------------------------- = */
include_once(G5_MSHOP_PATH.'/settle_kcp.inc.php'); // 환경설정 파일 include
require "pp_ax_hub_lib.php"; // library [수정불가]
/* = -------------------------------------------------------------------------- = */
/* = 환경 설정 파일 Include END = */
/* ============================================================================== */
/* ============================================================================== */
/* = 01. 지불 요청 정보 설정 = */
/* = -------------------------------------------------------------------------- = */
$req_tx = isset($_POST["req_tx"]) ? $_POST["req_tx"] : ''; // 요청 종류
$tran_cd = isset($_POST["tran_cd"]) ? preg_replace('/[^0-9A-Za-z_\-\.]/i', '', $_POST["tran_cd"]) : ''; // 처리 종류
/* = -------------------------------------------------------------------------- = */
$cust_ip = getenv( "REMOTE_ADDR" ); // 요청 IP
$ordr_idxx = isset($_POST["ordr_idxx"]) ? preg_replace('/[^0-9A-Za-z_\-\.]/i', '', $_POST["ordr_idxx"]) : ''; // 쇼핑몰 주문번호
$good_name = isset($_POST["good_name"]) ? addslashes($_POST["good_name"]) : ''; // 상품명
$good_mny = isset($_POST["good_mny"]) ? $_POST["good_mny"] : ''; // 결제 총금액
/* = -------------------------------------------------------------------------- = */
$res_cd = ""; // 응답코드
$res_msg = ""; // 응답메시지
$tno = isset($_POST["tno"]) ? $_POST["tno"] : ''; // KCP 거래 고유 번호
/* = -------------------------------------------------------------------------- = */
$buyr_name = isset($_POST["buyr_name"]) ? addslashes($_POST["buyr_name"]) : ''; // 주문자명
$buyr_tel1 = isset($_POST["buyr_tel1"]) ? $_POST["buyr_tel1"] : ''; // 주문자 전화번호
$buyr_tel2 = isset($_POST["buyr_tel2"]) ? $_POST["buyr_tel2"] : ''; // 주문자 핸드폰 번호
$buyr_mail = isset($_POST["buyr_mail"]) ? $_POST["buyr_mail"] : ''; // 주문자 E-mail 주소
/* = -------------------------------------------------------------------------- = */
$mod_type = isset($_POST["mod_type"]) ? $_POST["mod_type"] : ''; // 변경TYPE VALUE 승인취소시 필요
$mod_desc = isset($_POST["mod_desc"]) ? $_POST["mod_desc"] : ''; // 변경사유
/* = -------------------------------------------------------------------------- = */
$use_pay_method = isset($_POST["use_pay_method"]) ? $_POST["use_pay_method"] : ''; // 결제 방법
$bSucc = ""; // 업체 DB 처리 성공 여부
/* = -------------------------------------------------------------------------- = */
$app_time = ""; // 승인시간 (모든 결제 수단 공통)
$amount = ""; // KCP 실제 거래 금액
$total_amount = 0; // 복합결제시 총 거래금액
/* = -------------------------------------------------------------------------- = */
$card_cd = ""; // 신용카드 코드
$card_name = ""; // 신용카드 명
$app_no = ""; // 신용카드 승인번호
$noinf = ""; // 신용카드 무이자 여부
$quota = ""; // 신용카드 할부개월
/* = -------------------------------------------------------------------------- = */
$bank_name = ""; // 은행명
$bank_code = ""; // 은행코드
/* = -------------------------------------------------------------------------- = */
$bankname = ""; // 입금할 은행명
$depositor = ""; // 입금할 계좌 예금주 성명
$account = ""; // 입금할 계좌 번호
/* = -------------------------------------------------------------------------- = */
$pnt_issue = ""; // 결제 포인트사 코드
$pt_idno = ""; // 결제 및 인증 아이디
$pnt_amount = ""; // 적립금액 or 사용금액
$pnt_app_time = ""; // 승인시간
$pnt_app_no = ""; // 승인번호
$add_pnt = ""; // 발생 포인트
$use_pnt = ""; // 사용가능 포인트
$rsv_pnt = ""; // 적립 포인트
/* = -------------------------------------------------------------------------- = */
$commid = ""; // 통신사 코드
$mobile_no = ""; // 휴대폰 번호
/* = -------------------------------------------------------------------------- = */
$tk_van_code = ""; // 발급사 코드
$tk_app_no = ""; // 상품권 승인 번호
/* = -------------------------------------------------------------------------- = */
$cash_yn = isset($_POST["cash_yn"]) ? $_POST["cash_yn"] : ''; // 현금영수증 등록 여부
$cash_authno = ""; // 현금 영수증 승인 번호
$cash_tr_code = isset($_POST["cash_tr_code"]) ? $_POST["cash_tr_code"] : ''; // 현금 영수증 발행 구분
$cash_id_info = isset($_POST["cash_id_info"]) ? $_POST["cash_id_info"] : ''; // 현금 영수증 등록 번호
/* ============================================================================== */
/* ============================================================================== */
/* = 02. 인스턴스 생성 및 초기화 = */
/* = -------------------------------------------------------------------------- = */
/* = 결제에 필요한 인스턴스를 생성하고 초기화 합니다. = */
/* = -------------------------------------------------------------------------- = */
$c_PayPlus = new C_PP_CLI_T;
$c_PayPlus->mf_clear();
/* ------------------------------------------------------------------------------ */
/* = 02. 인스턴스 생성 및 초기화 END = */
/* ============================================================================== */
/* ============================================================================== */
/* = 03. 처리 요청 정보 설정 = */
/* = -------------------------------------------------------------------------- = */
/* = -------------------------------------------------------------------------- = */
/* = 03-1. 승인 요청 = */
/* = -------------------------------------------------------------------------- = */
if ( $req_tx == "pay" )
{
/* 1004원은 실제로 업체에서 결제하셔야 될 원 금액을 넣어주셔야 합니다. 결제금액 유효성 검증 */
$c_PayPlus->mf_set_ordr_data( "ordr_mony", $good_mny );
$kcp_pay_type = ''; // 결제수단 검증 파라미터 pay_type (신용카드 : PACA, 계좌이체 : PABK, 가상계좌 : PAVC, 휴대폰 : PAMC)
if ($use_pay_method == "100000000000" && (in_array($od_settle_case, array('신용카드', '간편결제')))) { // 신용카드
$kcp_pay_type = 'PACA';
} else if ($use_pay_method == "010000000000" && $od_settle_case === '계좌이체') { // 계좌이체
$kcp_pay_type = 'PABK';
} else if ($use_pay_method == "001000000000" && $od_settle_case === '가상계좌') { // 가상계좌
$kcp_pay_type = 'PAVC';
} else if ($use_pay_method == "000010000000" && $od_settle_case === '휴대폰') { // 휴대폰
$kcp_pay_type = 'PAMC';
}
$c_PayPlus->mf_set_ordr_data( "pay_type", $kcp_pay_type );
$c_PayPlus->mf_set_ordr_data( "ordr_no", $ordr_idxx );
$post_enc_data = isset($_POST["enc_data"]) ? $_POST["enc_data"] : '';
$post_enc_info = isset($_POST["enc_info"]) ? $_POST["enc_info"] : '';
$c_PayPlus->mf_set_encx_data( $post_enc_data, $post_enc_info );
}
/* = -------------------------------------------------------------------------- = */
/* = 03-2. 취소/매입 요청 = */
/* = -------------------------------------------------------------------------- = */
else if ( $req_tx == "mod" )
{
$tran_cd = "00200000";
$c_PayPlus->mf_set_modx_data( "tno", $tno ); // KCP 원거래 거래번호
$c_PayPlus->mf_set_modx_data( "mod_type", $mod_type ); // 원거래 변경 요청 종류
$c_PayPlus->mf_set_modx_data( "mod_ip", $cust_ip ); // 변경 요청자 IP
$c_PayPlus->mf_set_modx_data( "mod_desc", $mod_desc ); // 변경 사유
}
/* ------------------------------------------------------------------------------ */
/* = 03. 처리 요청 정보 설정 END = */
/* ============================================================================== */
/* ============================================================================== */
/* = 04. 실행 = */
/* = -------------------------------------------------------------------------- = */
if ( $tran_cd != "" )
{
$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, $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; // 결과 메시지
}
else
{
$c_PayPlus->m_res_cd = "9562";
$c_PayPlus->m_res_msg = "연동 오류|tran_cd값이 설정되지 않았습니다.";
}
if ($res_cd != '0000')
{
$res_msg = iconv("euc-kr", "utf-8", $res_msg);
/*
echo "<script>
var openwin = window.open( './kcp/proc_win.php', 'proc_win', '' );
openwin.close();
</script>";
*/
if(isset($_POST['pp_id']) && $_POST['pp_id']) {
$page_return_url = G5_SHOP_URL.'/personalpayform.php?pp_id='.get_session('ss_personalpay_id');
} else {
$page_return_url = G5_SHOP_URL.'/orderform.php';
if(get_session('ss_direct'))
$page_return_url .= '?sw_direct=1';
}
alert("$res_cd : $res_msg", $page_return_url);
exit;
}
/* = -------------------------------------------------------------------------- = */
/* = 04. 실행 END = */
/* ============================================================================== */
/* ============================================================================== */
/* = 05. 승인 결과 값 추출 = */
/* = -------------------------------------------------------------------------- = */
if ( $req_tx == "pay" )
{
if( $res_cd == "0000" )
{
$tno = $c_PayPlus->mf_get_res_data( "tno" ); // KCP 거래 고유 번호
$amount = $c_PayPlus->mf_get_res_data( "amount" ); // KCP 실제 거래 금액
$pnt_issue = $c_PayPlus->mf_get_res_data( "pnt_issue" ); // 결제 포인트사 코드
/* = -------------------------------------------------------------------------- = */
/* = 05-1. 신용카드 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "100000000000" )
{
$card_cd = $c_PayPlus->mf_get_res_data( "card_cd" ); // 카드사 코드
$card_name = $c_PayPlus->mf_get_res_data( "card_name" ); // 카드 종류
$app_time = $c_PayPlus->mf_get_res_data( "app_time" ); // 승인 시간
$app_no = $c_PayPlus->mf_get_res_data( "app_no" ); // 승인 번호
$noinf = $c_PayPlus->mf_get_res_data( "noinf" ); // 무이자 여부 ( 'Y' : 무이자 )
$quota = $c_PayPlus->mf_get_res_data( "quota" ); // 할부 개월 수
$od_other_pay_type = $c_PayPlus->mf_get_res_data( "card_other_pay_type" ); // 간편결제유형
$kcp_pay_method = $c_PayPlus->mf_get_res_data( "pay_method" ); // 카카오페이 결제수단
// 카드 코드는 PACA, 카카오머니 코드는 PAKM
if( $kcp_pay_method == "PAKM" ){ // 카카오머니
$card_mny = $kakaomny_mny = $c_PayPlus->mf_get_res_data( "kakaomny_mny" );
$app_time = $app_kakaomny_time = $c_PayPlus->mf_get_res_data( "app_kakaomny_time" );
$od_other_pay_type = 'NHNKCP_KAKAOMONEY';
}
}
/* = -------------------------------------------------------------------------- = */
/* = 05-2. 계좌이체 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "010000000000" )
{
$app_time = $c_PayPlus->mf_get_res_data( "app_time" ); // 승인시간
$bank_name = $c_PayPlus->mf_get_res_data( "bank_name" ); // 은행명
$bank_code = $c_PayPlus->mf_get_res_data( "bank_code" ); // 은행코드
}
/* = -------------------------------------------------------------------------- = */
/* = 05-3. 가상계좌 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "001000000000" )
{
$bankname = $c_PayPlus->mf_get_res_data( "bankname" ); // 입금할 은행 이름
$depositor = $c_PayPlus->mf_get_res_data( "depositor" ); // 입금할 계좌 예금주
$account = $c_PayPlus->mf_get_res_data( "account" ); // 입금할 계좌 번호
}
/* = -------------------------------------------------------------------------- = */
/* = 05-4. 포인트 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "000100000000" )
{
$pt_idno = $c_PayPlus->mf_get_res_data( "pt_idno" ); // 결제 및 인증 아이디
$pnt_amount = $c_PayPlus->mf_get_res_data( "pnt_amount" ); // 적립금액 or 사용금액
$pnt_app_time = $c_PayPlus->mf_get_res_data( "pnt_app_time" ); // 승인시간
$pnt_app_no = $c_PayPlus->mf_get_res_data( "pnt_app_no" ); // 승인번호
$add_pnt = $c_PayPlus->mf_get_res_data( "add_pnt" ); // 발생 포인트
$use_pnt = $c_PayPlus->mf_get_res_data( "use_pnt" ); // 사용가능 포인트
$rsv_pnt = $c_PayPlus->mf_get_res_data( "rsv_pnt" ); // 적립 포인트
}
/* = -------------------------------------------------------------------------- = */
/* = 05-5. 휴대폰 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "000010000000" )
{
$app_time = $c_PayPlus->mf_get_res_data( "hp_app_time" ); // 승인 시간
$commid = $c_PayPlus->mf_get_res_data( "commid" ); // 통신사 코드
$mobile_no = $c_PayPlus->mf_get_res_data( "mobile_no" ); // 휴대폰 번호
}
/* = -------------------------------------------------------------------------- = */
/* = 05-6. 상품권 승인 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
if ( $use_pay_method == "000000001000" )
{
$app_time = $c_PayPlus->mf_get_res_data( "tk_app_time" ); // 승인 시간
$tk_van_code = $c_PayPlus->mf_get_res_data( "tk_van_code" ); // 발급사 코드
$tk_app_no = $c_PayPlus->mf_get_res_data( "tk_app_no" ); // 승인 번호
}
/* = -------------------------------------------------------------------------- = */
/* = 05-7. 현금영수증 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
$cash_authno = $c_PayPlus->mf_get_res_data( "cash_authno" ); // 현금 영수증 승인 번호
$cash_authno = $c_PayPlus->mf_get_res_data( "cash_authno" ); // 현금 영수증 승인 번호
$cash_tr_code = $c_PayPlus->mf_get_res_data( "cash_tr_code" ); // 현금영수증 등록구분
/* = -------------------------------------------------------------------------- = */
/* = 05-8. 에스크로 여부 결과 처리 = */
/* = -------------------------------------------------------------------------- = */
$escw_yn = $c_PayPlus->mf_get_res_data( "escw_yn" ); // 에스크로 여부
}
}
/* = -------------------------------------------------------------------------- = */
/* = 05. 승인 결과 처리 END = */
/* ============================================================================== */;
+53
View File
@@ -0,0 +1,53 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// locale ko_KR.euc-kr 로 설정
setlocale(LC_CTYPE, 'ko_KR.euc-kr');
/* ============================================================================== */
/* = 07. 승인 결과 DB처리 실패시 : 자동취소 = */
/* = -------------------------------------------------------------------------- = */
/* = 승인 결과를 DB 작업 하는 과정에서 정상적으로 승인된 건에 대해 = */
/* = DB 작업을 실패하여 DB update 가 완료되지 않은 경우, 자동으로 = */
/* = 승인 취소 요청을 하는 프로세스가 구성되어 있습니다. = */
/* = = */
/* = DB 작업이 실패 한 경우, bSucc 라는 변수(String)의 값을 "false" = */
/* = 로 설정해 주시기 바랍니다. (DB 작업 성공의 경우에는 "false" 이외의 = */
/* = 값을 설정하시면 됩니다.) = */
/* = -------------------------------------------------------------------------- = */
$bSucc = "false"; // DB 작업 실패 또는 금액 불일치의 경우 "false" 로 세팅
/* = -------------------------------------------------------------------------- = */
/* = 07-1. DB 작업 실패일 경우 자동 승인 취소 = */
/* = -------------------------------------------------------------------------- = */
if ( $req_tx == "pay" )
{
if( $res_cd == "0000" )
{
if ( $bSucc == "false" )
{
$c_PayPlus->mf_clear();
$tran_cd = "00200000";
$c_PayPlus->mf_set_modx_data( "tno", $tno ); // KCP 원거래 거래번호
$c_PayPlus->mf_set_modx_data( "mod_type", "STSC" ); // 원거래 변경 요청 종류
$c_PayPlus->mf_set_modx_data( "mod_ip", $cust_ip ); // 변경 요청자 IP
$c_PayPlus->mf_set_modx_data( "mod_desc", $cancel_msg ); // 변경 사유
$c_PayPlus->mf_do_tx( "", $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, $g_conf_log_level,
0, 0 );
$res_cd = $c_PayPlus->m_res_cd;
$res_msg = $c_PayPlus->m_res_msg;
}
}
} // End of [res_cd = "0000"]
/* ============================================================================== */
// locale 설정 초기화
setlocale(LC_CTYPE, '');
+296
View File
@@ -0,0 +1,296 @@
<?php
/* ============================================================================== */
/* = PAGE : 라이브버리 PAGE = */
/* = -------------------------------------------------------------------------- = */
/* = Copyright (c) 2010.02 KCP Inc. All Rights Reserverd. = */
/* ============================================================================== */
/* ============================================================================== */
/* = 지불 연동 CLASS = */
/* ============================================================================== */
class C_PP_CLI_T
{
var $m_payx_common;
var $m_payx_card;
var $m_ordr_data;
var $m_rcvr_data;
var $m_escw_data;
var $m_modx_data;
var $m_encx_data;
var $m_encx_info;
/* -------------------------------------------------------------------- */
/* - 처리 결과 값 - */
/* -------------------------------------------------------------------- */
var $m_res_data;
var $m_res_cd;
var $m_res_msg;
/* -------------------------------------------------------------------- */
/* - 생성자 - */
/* -------------------------------------------------------------------- */
function C_PP_CLI()
{
$this->m_payx_common = "";
$this->m_payx_card = "";
$this->m_ordr_data = "";
$this->m_rcvr_data = "";
$this->m_escw_data = "";
$this->m_modx_data = "";
$this->m_encx_data = "";
$this->m_encx_info = "";
}
function mf_init( $mode )
{
if ( $mode == "1" )
{
if ( !extension_loaded( 'pp_cli_dl_php' ) )
{
dl( "pp_cli_dl_php.so" );
}
}
}
function mf_clear()
{
$this->m_payx_common = "";
$this->m_payx_card = "";
$this->m_ordr_data = "";
$this->m_rcvr_data = "";
$this->m_escw_data = "";
$this->m_modx_data = "";
$this->m_encx_data = "";
$this->m_encx_info = "";
}
function mf_gen_trace_no( $site_cd, $ip, $mode )
{
if ( $mode == "1" )
{
$trace_no = lfPP_CLI_DL__gen_trace_no( $site_cd, $ip );
}
else
{
$trace_no = "";
}
return $trace_no;
}
/* -------------------------------------------------------------------- */
/* - FUNC : ENC DATA 정보 설정 함수 - */
/* -------------------------------------------------------------------- */
function mf_set_payx_common_data( $name, $val )
{
if ( $val != "" )
{
$this->m_payx_common .= ( $name . '=' . $val . chr( 31 ) );
}
}
function mf_set_payx_card_data( $name, $val )
{
if ( $val != "" )
{
$this->m_payx_card .= ( $name . '=' . $val . chr( 31 ) );
}
}
function mf_set_ordr_data( $name, $val )
{
if ( $val != "" )
{
$this->m_ordr_data .= ( $name . '=' . $val . chr( 31 ) );
}
}
function mf_set_rcvr_data( $name, $val )
{
if ( $val != "" )
{
$this->m_rcvr_data .= ( $name . '=' . $val . chr( 31 ) );
}
}
function mf_set_escw_data( $name, $val )
{
if ( $val != "" )
{
$this->m_escw_data .= ( $name . '=' . $val . chr( 29 ) );
}
}
function mf_set_modx_data( $name, $val )
{
if ( $val != "" )
{
$this->m_modx_data .= ( $name . '=' . $val . chr( 31 ) );
}
}
function mf_set_encx_data( $encx_data, $encx_info )
{
$this->m_encx_data = $encx_data;
$this->m_encx_info = $encx_info;
}
/* -------------------------------------------------------------------- */
/* - FUNC : 지불 처리 함수 - */
/* -------------------------------------------------------------------- */
function mf_do_tx( $trace_no, $home_dir, $site_cd,
$site_key, $tx_cd, $pub_key_str,
$pa_url, $pa_port, $user_agent,
$ordr_idxx, $cust_ip,
$log_level, $opt, $mode,
$key_dir, $log_dir)
{
$payx_data = $this->mf_get_payx_data();
$ordr_data = $this->mf_get_data( "ordr_data", $this->m_ordr_data );
$rcvr_data = $this->mf_get_data( "rcvr_data", $this->m_rcvr_data );
$escw_data = $this->mf_get_data( "escw_data", $this->m_escw_data );
$modx_data = $this->mf_get_data( "mod_data", $this->m_modx_data );
if ( $mode == "1" )
{
$res_data = lfPP_CLI_DL__do_tx_2( $trace_no, $home_dir, $site_cd,
$site_key, $tx_cd, $pub_key_str,
$pa_url, $pa_port, $user_agent,
$ordr_idxx,
$payx_data, $ordr_data,
$rcvr_data, $escw_data,
$modx_data,
$this->m_encx_data, $this->m_encx_info,
$log_level, $opt );
}
else
{
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
{
$bin_exe = $home_dir.'/bin/pp_cli_exe ';
$res_data = $this->mf_exec($bin_exe . "\"".
"site_cd=" . $site_cd . "," .
"site_key=" . $site_key . "," .
"tx_cd=" . $tx_cd . "," .
"pa_url=" . $pa_url . "," .
"pa_port=" . $pa_port . "," .
"ordr_idxx=" . $ordr_idxx . "," .
"enc_data=" . $this->m_encx_data . "," .
"enc_info=" . $this->m_encx_info . "," .
"trace_no=" . $trace_no . "," .
"cust_ip=" . $cust_ip . "," .
"key_path=" . $key_dir . "," .
"log_path=" . $log_dir . "," .
"log_level=" . $log_level . "," .
"plan_data=" . $payx_data .
$ordr_data .
$rcvr_data .
$escw_data .
$modx_data .
"\"") ;
}
else
{
if(PHP_INT_MAX == 2147483647) // 32-bit
$bin_exe = $home_dir.'/bin/pp_cli';
else
$bin_exe = $home_dir.'/bin/pp_cli_x64';
$res_data = $this->mf_exec( $bin_exe,
"-h",
"home=" . $home_dir . "," .
"site_cd=" . $site_cd . "," .
"site_key=" . $site_key . "," .
"tx_cd=" . $tx_cd . "," .
"pa_url=" . $pa_url . "," .
"pa_port=" . $pa_port . "," .
"ordr_idxx=" . $ordr_idxx . "," .
"payx_data=" . $payx_data . "," .
"ordr_data=" . $ordr_data . "," .
"rcvr_data=" . $rcvr_data . "," .
"escw_data=" . $escw_data . "," .
"modx_data=" . $modx_data . "," .
"enc_data=" . $this->m_encx_data . "," .
"enc_info=" . $this->m_encx_info . "," .
"trace_no=" . $trace_no . "," .
"cust_ip=" . $cust_ip . "," .
"log_path=" . $log_dir . "," .
"log_level=" . $log_level . "," .
"opt=" . $opt . "" );
}
if ( $res_data == "" )
{
$res_data = "res_cd=9502" . chr( 31 ) . "res_msg=연동 모듈 호출 오류";
}
}
parse_str( str_replace( chr( 31 ), "&", $res_data ), $this->m_res_data );
$this->m_res_cd = $this->m_res_data[ "res_cd" ];
$this->m_res_msg = $this->m_res_data[ "res_msg" ];
}
/* -------------------------------------------------------------------- */
/* - FUNC : 처리 결과 값을 리턴하는 함수 - */
/* -------------------------------------------------------------------- */
function mf_get_res_data( $name )
{
return isset($this->m_res_data[$name]) ? $this->m_res_data[$name] : '';
}
function mf_get_payx_data()
{
$my_data = '';
if ( $this->m_payx_common != "" || $this->m_payx_card != "" )
{
$my_data = "payx_data=";
}
if ( $this->m_payx_common != "" )
{
$my_data .= "common=" . $this->m_payx_common . chr( 30 );
}
if ( $this->m_payx_card != "" )
{
$my_data .= ( "card=" . $this->m_payx_card . chr( 30 ) );
}
return $my_data;
}
function mf_get_data( $data_name, $data )
{
if ( $data != "" )
{
$my_data = $data_name . "=" . $data;
}
else
{
$my_data = "";
}
return $my_data;
}
function mf_exec()
{
$arg = func_get_args();
if ( is_array( $arg[0] ) ) $arg = $arg[0];
$exec_cmd = array_shift( $arg );
foreach($arg as $i)
{
$exec_cmd .= " " . escapeshellarg( $i );
}
$rt = exec( $exec_cmd );
return $rt;
}
}
+145
View File
@@ -0,0 +1,145 @@
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ax21="http://payment.domain.webpay.service.kcp.kr/xsd" xmlns:ns="http://webservice.act.webpay.service.kcp.kr" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ax22="http://domain.webpay.service.kcp.kr/xsd" targetNamespace="http://webservice.act.webpay.service.kcp.kr">
<wsdl:documentation>
KCP Payment Service
</wsdl:documentation>
<wsdl:types>
<xs:schema xmlns:ax23="http://domain.webpay.service.kcp.kr/xsd" targetNamespace="http://payment.domain.webpay.service.kcp.kr/xsd" attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:import namespace="http://domain.webpay.service.kcp.kr/xsd"/>
<xs:complexType name="ApproveReq">
<xs:sequence>
<xs:element name="accessCredentialType" minOccurs="0" type="ax22:AccessCredentialType" nillable="true"/>
<xs:element name="baseRequestType" minOccurs="0" type="ax22:BaseRequestType" nillable="true"/>
<xs:element name="escrow" minOccurs="0" type="xs:boolean"/>
<xs:element name="orderID" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="paymentAmount" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="paymentMethod" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="productName" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="returnUrl" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="siteCode" minOccurs="0" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ApproveRes">
<xs:sequence>
<xs:element name="approvalKey" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="baseResponseType" minOccurs="0" type="ax22:BaseResponseType" nillable="true"/>
<xs:element name="payUrl" minOccurs="0" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
<xs:schema xmlns:ax24="http://payment.domain.webpay.service.kcp.kr/xsd" targetNamespace="http://webservice.act.webpay.service.kcp.kr" attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:import namespace="http://payment.domain.webpay.service.kcp.kr/xsd"/>
<xs:element name="approve">
<xs:complexType>
<xs:sequence>
<xs:element name="req" minOccurs="0" type="ax24:ApproveReq" nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="approveResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="return" minOccurs="0" type="ax24:ApproveRes" nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
<xs:schema targetNamespace="http://domain.webpay.service.kcp.kr/xsd" attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:complexType name="AccessCredentialType">
<xs:sequence>
<xs:element name="accessLicense" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="signature" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="timestamp" minOccurs="0" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="BaseRequestType">
<xs:sequence>
<xs:element name="detailLevel" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="requestApp" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="requestID" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="userAgent" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="version" minOccurs="0" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="BaseResponseType">
<xs:sequence>
<xs:element name="detailLevel" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="error" minOccurs="0" type="ax22:ErrorType" nillable="true"/>
<xs:element name="messageID" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="release" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="requestID" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="responseType" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="timestamp" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="version" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="warningList" maxOccurs="unbounded" minOccurs="0" type="ax22:ErrorType" nillable="true"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ErrorType">
<xs:sequence>
<xs:element name="code" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="detail" minOccurs="0" type="xs:string" nillable="true"/>
<xs:element name="message" minOccurs="0" type="xs:string" nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="approveRequest">
<wsdl:part name="parameters" element="ns:approve"/>
</wsdl:message>
<wsdl:message name="approveResponse">
<wsdl:part name="parameters" element="ns:approveResponse"/>
</wsdl:message>
<wsdl:portType name="KCPPaymentServicePortType">
<wsdl:operation name="approve">
<wsdl:input message="ns:approveRequest" wsaw:Action="urn:approve"/>
<wsdl:output message="ns:approveResponse" wsaw:Action="urn:approveResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="KCPPaymentServiceSoap11Binding" type="ns:KCPPaymentServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="approve">
<soap:operation soapAction="urn:approve" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="KCPPaymentServiceSoap12Binding" type="ns:KCPPaymentServicePortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="approve">
<soap12:operation soapAction="urn:approve" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="KCPPaymentServiceHttpBinding" type="ns:KCPPaymentServicePortType">
<http:binding verb="POST"/>
<wsdl:operation name="approve">
<http:operation location="KCPPaymentService/approve"/>
<wsdl:input>
<mime:content type="text/xml" part="approve"/>
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" part="approve"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="KCPPaymentService">
<wsdl:port name="KCPPaymentServiceHttpSoap11Endpoint" binding="ns:KCPPaymentServiceSoap11Binding">
<soap:address location="https://smpay.kcp.co.kr/services/KCPPaymentService.KCPPaymentServiceHttpSoap11Endpoint/"/>
</wsdl:port>
<wsdl:port name="KCPPaymentServiceHttpSoap12Endpoint" binding="ns:KCPPaymentServiceSoap12Binding">
<soap12:address location="https://smpay.kcp.co.kr/services/KCPPaymentService.KCPPaymentServiceHttpSoap12Endpoint/"/>
</wsdl:port>
<wsdl:port name="KCPPaymentServiceHttpEndpoint" binding="ns:KCPPaymentServiceHttpBinding">
<http:address location="https://smpay.kcp.co.kr/services/KCPPaymentService.KCPPaymentServiceHttpEndpoint/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
+26
View File
@@ -0,0 +1,26 @@
<?php
include_once('./_common.php');
$it_id = isset($_GET['it_id']) ? get_search_string(trim($_GET['it_id'])) : '';
$no = isset($_GET['no']) ? preg_replace('/[^0-9a-z]/i', '', $_GET['no']) : '';
$row = get_shop_item($it_id, true);
if(! (isset($row['it_id']) && $row['it_id']))
alert_close('상품정보가 존재하지 않습니다.');
$imagefile = G5_DATA_PATH.'/item/'.$row['it_img'.$no];
$imagefileurl = run_replace('get_item_image_url', G5_DATA_URL.'/item/'.$row['it_img'.$no], $row, $no);
$size = file_exists($imagefile) ? @getimagesize($imagefile) : array();
$g5['title'] = "{$row['it_name']} ($it_id)";
include_once(G5_PATH.'/head.sub.php');
$skin = G5_MSHOP_SKIN_PATH.'/largeimage.skin.php';
if(is_file($skin))
include_once($skin);
else
echo '<p>'.str_replace(G5_PATH.'/', '', $skin).'파일이 존재하지 않습니다.</p>';
include_once(G5_PATH.'/tail.sub.php');
+6
View File
@@ -0,0 +1,6 @@
<?php
include_once('../../../common.php');
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP)
die('<p>쇼핑몰 설치 후 이용해 주십시오.</p>');
define('_SHOP_', true);
+3
View File
@@ -0,0 +1,3 @@
<!-- 해당 페이지는 사용자가 ISP{국민/BC) 카드 결제를 중단하였을 , 사용자에게 보여지는 페이지입니다. -->
사용자가 ISP(국민/BC) 카드결제을 중단하였습니다.
+19
View File
@@ -0,0 +1,19 @@
<?php
// 해당 페이지는 사용자가 ISP{국민/BC) 카드 결제를 성공하였을 때, 사용자에게 보여지는 페이지입니다.
include_once('./_common.php');
$LGD_OID = clean_xss_tags($_GET['LGD_OID'], 1, 1);
echo "LGD_OID = ".$LGD_OID;
// 결제성공시에만, 고객사에서 생성한 주문번호 (LGD_OID)를 해당페이지로 전송합니다.
// LGD_KVPMISPNOTEURL 에서 수신한 결제결과값과 연동하여 사용자에게 보여줄 결제완료화면을 구성하시기 바라며,
// 결제결과는 LGD_KVPMISPNOTEURL 로 먼저 전송되므로 해당건의 DB연동된 결과를 이용하여 결제완료여부를 보이도록 합니다.
////////////////////////////////////////////////////////////////////////////////////////////////////////
// 만약, 고객사에서 'App To App' 방식으로 국민, BC카드사에서 받은 결제 승인을 받고 고객사의 앱을 실행하고자 할때
// 고객사 앱은 initilize function에 응답받는 Custom URL을 호출하면 됩니다.
// ex) window.location.href = smartxpay://TID=1234567890&OID=0987654321
//
// window.location.href = "고객사 앱명://" 로 호출하시면 됩니다.
////////////////////////////////////////////////////////////////////////////////////////////////////////;
+152
View File
@@ -0,0 +1,152 @@
<?php
include_once('./_common.php');
/*
* 공통결제결과 정보
*/
$LGD_RESPCODE = ""; // 응답코드: 0000(성공) 그외 실패
$LGD_RESPMSG = ""; // 응답메세지
$LGD_MID = ""; // 상점아이디
$LGD_OID = ""; // 주문번호
$LGD_AMOUNT = ""; // 거래금액
$LGD_TID = ""; // LG유플러스에서 부여한 거래번호
$LGD_PAYTYPE = ""; // 결제수단코드
$LGD_PAYDATE = ""; // 거래일시(승인일시/이체일시)
$LGD_HASHDATA = ""; // 해쉬값
$LGD_FINANCECODE = ""; // 결제기관코드(카드종류/은행코드/이통사코드)
$LGD_FINANCENAME = ""; // 결제기관이름(카드이름/은행이름/이통사이름)
$LGD_ESCROWYN = ""; // 에스크로 적용여부
$LGD_TIMESTAMP = ""; // 타임스탬프
$LGD_FINANCEAUTHNUM = ""; // 결제기관 승인번호(신용카드, 계좌이체, 상품권)
/*
* 신용카드 결제결과 정보
*/
$LGD_CARDNUM = ""; // 카드번호(신용카드)
$LGD_CARDINSTALLMONTH = ""; // 할부개월수(신용카드)
$LGD_CARDNOINTYN = ""; // 무이자할부여부(신용카드) - '1'이면 무이자할부 '0'이면 일반할부
$LGD_TRANSAMOUNT = ""; // 환율적용금액(신용카드)
$LGD_EXCHANGERATE = ""; // 환율(신용카드)
/*
* 휴대폰
*/
$LGD_PAYTELNUM = ""; // 결제에 이용된전화번호
/*
* 계좌이체, 무통장
*/
$LGD_ACCOUNTNUM = ""; // 계좌번호(계좌이체, 무통장입금)
$LGD_CASTAMOUNT = ""; // 입금총액(무통장입금)
$LGD_CASCAMOUNT = ""; // 현입금액(무통장입금)
$LGD_CASFLAG = ""; // 무통장입금 플래그(무통장입금) - 'R':계좌할당, 'I':입금, 'C':입금취소
$LGD_CASSEQNO = ""; // 입금순서(무통장입금)
$LGD_CASHRECEIPTNUM = ""; // 현금영수증 승인번호
$LGD_CASHRECEIPTSELFYN = ""; // 현금영수증자진발급제유무 Y: 자진발급제 적용, 그외 : 미적용
$LGD_CASHRECEIPTKIND = ""; // 현금영수증 종류 0: 소득공제용 , 1: 지출증빙용
/*
* OK캐쉬백
*/
$LGD_OCBSAVEPOINT = ""; // OK캐쉬백 적립포인트
$LGD_OCBTOTALPOINT = ""; // OK캐쉬백 누적포인트
$LGD_OCBUSABLEPOINT = ""; // OK캐쉬백 사용가능 포인트
/*
* 구매정보
*/
$LGD_BUYER = ""; // 구매자
$LGD_PRODUCTINFO = ""; // 상품명
$LGD_BUYERID = ""; // 구매자 ID
$LGD_BUYERADDRESS = ""; // 구매자 주소
$LGD_BUYERPHONE = ""; // 구매자 전화번호
$LGD_BUYEREMAIL = ""; // 구매자 이메일
$LGD_BUYERSSN = ""; // 구매자 주민번호
$LGD_PRODUCTCODE = ""; // 상품코드
$LGD_RECEIVER = ""; // 수취인
$LGD_RECEIVERPHONE = ""; // 수취인 전화번호
$LGD_DELIVERYINFO = ""; // 배송지
$LGD_RESPCODE = $_POST["LGD_RESPCODE"];
$LGD_RESPMSG = $_POST["LGD_RESPMSG"];
$LGD_MID = $_POST["LGD_MID"];
$LGD_OID = $_POST["LGD_OID"];
$LGD_AMOUNT = $_POST["LGD_AMOUNT"];
$LGD_TID = $_POST["LGD_TID"];
$LGD_PAYTYPE = $_POST["LGD_PAYTYPE"];
$LGD_PAYDATE = $_POST["LGD_PAYDATE"];
$LGD_HASHDATA = $_POST["LGD_HASHDATA"];
$LGD_FINANCECODE = $_POST["LGD_FINANCECODE"];
$LGD_FINANCENAME = $_POST["LGD_FINANCENAME"];
$LGD_ESCROWYN = $_POST["LGD_ESCROWYN"];
$LGD_TRANSAMOUNT = $_POST["LGD_TRANSAMOUNT"];
$LGD_EXCHANGERATE = $_POST["LGD_EXCHANGERATE"];
$LGD_CARDNUM = $_POST["LGD_CARDNUM"];
$LGD_CARDINSTALLMONTH = $_POST["LGD_CARDINSTALLMONTH"];
$LGD_CARDNOINTYN = $_POST["LGD_CARDNOINTYN"];
$LGD_TIMESTAMP = $_POST["LGD_TIMESTAMP"];
$LGD_FINANCEAUTHNUM = $_POST["LGD_FINANCEAUTHNUM"];
$LGD_PAYTELNUM = $_POST["LGD_PAYTELNUM"];
$LGD_ACCOUNTNUM = $_POST["LGD_ACCOUNTNUM"];
$LGD_CASTAMOUNT = $_POST["LGD_CASTAMOUNT"];
$LGD_CASCAMOUNT = $_POST["LGD_CASCAMOUNT"];
$LGD_CASFLAG = $_POST["LGD_CASFLAG"];
$LGD_CASSEQNO = $_POST["LGD_CASSEQNO"];
$LGD_CASHRECEIPTNUM = $_POST["LGD_CASHRECEIPTNUM"];
$LGD_CASHRECEIPTSELFYN = $_POST["LGD_CASHRECEIPTSELFYN"];
$LGD_CASHRECEIPTKIND = $_POST["LGD_CASHRECEIPTKIND"];
$LGD_OCBSAVEPOINT = $_POST["LGD_OCBSAVEPOINT"];
$LGD_OCBTOTALPOINT = $_POST["LGD_OCBTOTALPOINT"];
$LGD_OCBUSABLEPOINT = $_POST["LGD_OCBUSABLEPOINT"];
$LGD_BUYER = $_POST["LGD_BUYER"];
$LGD_PRODUCTINFO = $_POST["LGD_PRODUCTINFO"];
$LGD_BUYERID = $_POST["LGD_BUYERID"];
$LGD_BUYERADDRESS = $_POST["LGD_BUYERADDRESS"];
$LGD_BUYERPHONE = $_POST["LGD_BUYERPHONE"];
$LGD_BUYEREMAIL = $_POST["LGD_BUYEREMAIL"];
$LGD_BUYERSSN = $_POST["LGD_BUYERSSN"];
$LGD_PRODUCTCODE = $_POST["LGD_PRODUCTCODE"];
$LGD_RECEIVER = $_POST["LGD_RECEIVER"];
$LGD_RECEIVERPHONE = $_POST["LGD_RECEIVERPHONE"];
$LGD_DELIVERYINFO = $_POST["LGD_DELIVERYINFO"];
$LGD_MERTKEY = $config['cf_lg_mert_key']; //LG유플러스에서 발급한 상점키로 변경해 주시기 바랍니다.
$LGD_HASHDATA2 = md5($LGD_MID.$LGD_OID.$LGD_AMOUNT.$LGD_RESPCODE.$LGD_TIMESTAMP.$LGD_MERTKEY);
/*
* 상점 처리결과 리턴메세지
*
* OK : 상점 처리결과 성공
* 그외 : 상점 처리결과 실패
*
* ※ 주의사항 : 성공시 'OK' 문자이외의 다른문자열이 포함되면 실패처리 되오니 주의하시기 바랍니다.
*/
$resultMSG = "결제결과 상점 DB처리(NOTE_URL) 결과값을 입력해 주시기 바랍니다.";
if ($LGD_HASHDATA2 == $LGD_HASHDATA) { //해쉬값 검증이 성공하면
if($LGD_RESPCODE == "0000"){ //결제가 성공이면
/*
* 거래성공 결과 상점 처리(DB) 부분
* 상점 결과 처리가 정상이면 "OK"
*/
//if( 결제성공 상점처리결과 성공 )
$resultMSG = "OK";
}else { //결제가 실패이면
/*
* 거래실패 결과 상점 처리(DB) 부분
* 상점결과 처리가 정상이면 "OK"
*/
//if( 결제실패 상점처리결과 성공 )
$resultMSG = "OK";
}
} else { //해쉬값 검증이 실패이면
/*
* hashdata검증 실패 로그를 처리하시기 바랍니다.
*/
$resultMSG = "결제결과 상점 DB처리(NOTE_URL) 해쉬값 검증이 실패하였습니다.";
}
echo $resultMSG;
+19
View File
@@ -0,0 +1,19 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<form name="sm_form" method="POST" action="<?php echo G5_MSHOP_URL; ?>/lg/xpay_approval.php">
<input type="hidden" name="LGD_OID" id="LGD_OID" value="<?php echo $od_id; ?>"> <!-- 주문번호 -->
<input type="hidden" name="LGD_BUYER" id="LGD_BUYER" value=""> <!-- 구매자 -->
<input type="hidden" name="LGD_PRODUCTINFO" id="LGD_PRODUCTINFO" value="<?php echo $goods; ?>"> <!-- 상품정보 -->
<input type="hidden" name="LGD_AMOUNT" id="LGD_AMOUNT" value=""> <!-- 결제금액 -->
<input type="hidden" name="LGD_CUSTOM_FIRSTPAY" id="LGD_CUSTOM_FIRSTPAY" value=""> <!-- 결제수단 -->
<input type="hidden" name="LGD_BUYEREMAIL" id="LGD_BUYEREMAIL" value=""> <!-- 구매자 이메일 -->
<input type="hidden" name="LGD_TAXFREEAMOUNT" id="LGD_TAXFREEAMOUNT" value="<?php echo $comm_free_mny; ?>"> <!-- 결제금액 중 면세금액 -->
<input type="hidden" name="LGD_BUYERID" id="LGD_BUYERID" value="<?php echo $LGD_BUYERID; ?>"> <!-- 구매자ID -->
<input type="hidden" name="LGD_CASHRECEIPTYN" id="LGD_CASHRECEIPTYN" value="N"> <!-- 현금영수증 사용 설정 -->
<input type="hidden" name="LGD_BUYERPHONE" id="LGD_BUYERPHONE" value=""> <!-- 구매자 휴대폰번호 -->
<input type="hidden" name="LGD_EASYPAY_ONLY" id="LGD_EASYPAY_ONLY" value=""> <!-- 페이나우 결제 호출 -->
<input type="hidden" name="good_mny" value="<?php echo $tot_price ?>" >
</form>
+20
View File
@@ -0,0 +1,20 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<input type="hidden" name="LGD_PAYKEY" id="LGD_PAYKEY"> <!-- LG유플러스 PAYKEY(인증후 자동셋팅)-->
<input type="hidden" name="good_mny" value="<?php echo $tot_price ?>" >
<input type="hidden" name="res_cd" value=""> <!-- 결과 코드 -->
<?php if($default['de_tax_flag_use']) { ?>
<input type="hidden" name="comm_tax_mny" value="<?php echo $comm_tax_mny; ?>"> <!-- 과세금액 -->
<input type="hidden" name="comm_vat_mny" value="<?php echo $comm_vat_mny; ?>"> <!-- 부가세 -->
<input type="hidden" name="comm_free_mny" value="<?php echo $comm_free_mny; ?>"> <!-- 비과세 금액 -->
<?php } ?>
<div id="display_pay_button" class="btn_confirm">
<span id="show_req_btn"><input type="button" name="submitChecked" onClick="pay_approval();" value="결제등록요청" class="btn_submit"></span>
<span id="show_pay_btn" style="display:none;"><input type="button" onClick="forderform_check();" value="주문하기" class="btn_submit"></span>
<a href="<?php echo G5_SHOP_URL; ?>" class="btn_cancel">취소</a>
</div>
+2
View File
@@ -0,0 +1,2 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가;
+79
View File
@@ -0,0 +1,79 @@
<?php
include_once('./_common.php');
/*
xpay_approval.php 에서 세션에 저장했던 파라미터 값이 유효한지 체크
세션 유지 시간(로그인 유지시간)을 적당히 유지 하거나 세션을 사용하지 않는 경우 DB처리 하시기 바랍니다.
*/
if(!isset($_SESSION['PAYREQ_MAP'])){
alert('세션이 만료 되었거나 유효하지 않은 요청 입니다.', G5_SHOP_URL);
}
$payReqMap = $_SESSION['PAYREQ_MAP']; //결제 요청시, Session에 저장했던 파라미터 MAP
$g5['title'] = 'LG 유플러스 eCredit서비스 결제';
$g5['body_script'] = ' onload="setLGDResult();"';
include_once(G5_PATH.'/head.sub.php');
$LGD_RESPCODE = $_REQUEST['LGD_RESPCODE'];
$LGD_RESPMSG = $_REQUEST['LGD_RESPMSG'];
$LGD_PAYKEY = '';
$LGD_OID = $payReqMap['LGD_OID'];
$sql = " select * from {$g5['g5_shop_order_data_table']} where od_id = '$LGD_OID' ";
$row = sql_fetch($sql);
$data = isset($row['dt_data']) ? unserialize(base64_decode($row['dt_data'])) : array();
if(isset($data['pp_id']) && $data['pp_id']) {
$order_action_url = G5_HTTPS_MSHOP_URL.'/personalpayformupdate.php';
$page_return_url = G5_SHOP_URL.'/personalpayform.php?pp_id='.$data['pp_id'];
} else {
$order_action_url = G5_HTTPS_MSHOP_URL.'/orderformupdate.php';
$page_return_url = G5_SHOP_URL.'/orderform.php';
if($_SESSION['ss_direct'])
$page_return_url .= '?sw_direct=1';
}
if($LGD_RESPCODE == '0000') {
$LGD_PAYKEY = $_REQUEST['LGD_PAYKEY'];
$payReqMap['LGD_RESPCODE'] = $LGD_RESPCODE;
$payReqMap['LGD_RESPMSG'] = $LGD_RESPMSG;
$payReqMap['LGD_PAYKEY'] = $LGD_PAYKEY;
} else {
alert('LGD_RESPCODE:' . $LGD_RESPCODE . ' ,LGD_RESPMSG:' . $LGD_RESPMSG, $page_return_url); //인증 실패에 대한 처리 로직 추가
}
?>
<?php
$exclude = array('res_cd', 'LGD_PAYKEY');
echo '<form name="forderform" method="post" action="'.$order_action_url.'" autocomplete="off">'.PHP_EOL;
echo make_order_field($data, $exclude);
echo '<input type="hidden" name="res_cd" value="'.get_text($LGD_RESPCODE).'">'.PHP_EOL;
echo '<input type="hidden" name="LGD_PAYKEY" value="'.get_text($LGD_PAYKEY).'">'.PHP_EOL;
echo '</form>'.PHP_EOL;
?>
<div>
<div id="show_progress">
<span style="display:block; text-align:center;margin-top:120px"><img src="<?php echo G5_MOBILE_URL; ?>/shop/img/loading.gif" alt=""></span>
<span style="display:block; text-align:center;margin-top:10px; font-size:14px">주문완료 중입니다. 잠시만 기다려 주십시오.</span>
</div>
</div>
<script type="text/javascript">
function setLGDResult() {
setTimeout( function() {
document.forderform.submit();
}, 300);
}
</script>
<?php
include_once(G5_PATH.'/tail.sub.php');
+176
View File
@@ -0,0 +1,176 @@
<?php
include_once('./_common.php');
require_once(G5_MSHOP_PATH.'/settle_lg.inc.php');
/*
* 1. 기본결제 인증요청 정보 변경
*
* 기본정보를 변경하여 주시기 바랍니다.(파라미터 전달시 POST를 사용하세요)
*/
$LGD_OID = $_POST['LGD_OID']; //주문번호(상점정의 유니크한 주문번호를 입력하세요)
$LGD_AMOUNT = $_POST['LGD_AMOUNT']; //결제금액("," 를 제외한 결제금액을 입력하세요)
$LGD_BUYER = $_POST['LGD_BUYER']; //구매자명
$LGD_PRODUCTINFO = $_POST['LGD_PRODUCTINFO']; //상품명
$LGD_BUYEREMAIL = $_POST['LGD_BUYEREMAIL']; //구매자 이메일
$LGD_CUSTOM_FIRSTPAY = $_POST['LGD_CUSTOM_FIRSTPAY']; //상점정의 초기결제수단
$LGD_TAXFREEAMOUNT = $_POST['LGD_TAXFREEAMOUNT']; //비과세 금액
$LGD_CASHRECEIPTYN = $_POST['LGD_CASHRECEIPTYN']; //현금영수증 사용설정
$LGD_BUYERID = $_POST['LGD_BUYERID']; //구매자 ID
$LGD_BUYERPHONE = $_POST['LGD_BUYERPHONE']; //구매자 휴대폰번호
$LGD_EASYPAY_ONLY = $_POST['LGD_EASYPAY_ONLY']; //페이나우결제창 호출
$LGD_RETURNURL = G5_MSHOP_URL.'/lg/returnurl.php';
$LGD_KVPMISPNOTEURL = G5_MSHOP_URL.'/lg/note_url.php';
$LGD_KVPMISPWAPURL = G5_MSHOP_URL.'/lg/mispwapurl.php?LGD_OID='.$LGD_OID; //ISP 카드 결제시, URL 대신 앱명 입력시, 앱호출함
$LGD_KVPMISPCANCELURL = G5_MSHOP_URL.'/lg/cancel_url.php';
$LGD_MTRANSFERWAPURL = G5_MSHOP_URL.'/lg/returnurl.php';
$LGD_MTRANSFERCANCELURL = G5_MSHOP_URL.'/lg/cancel_url.php';
$LGD_MTRANSFERNOTEURL = G5_MSHOP_URL.'/lg/note_url.php';
if(preg_match('/iPhone|iPad/', $_SERVER['HTTP_USER_AGENT']))
$LGD_MTRANSFERAUTOAPPYN = 'N';
else
$LGD_MTRANSFERAUTOAPPYN = 'A';
/*
*************************************************
* 2. MD5 해쉬암호화 (수정하지 마세요) - BEGIN
*
* MD5 해쉬암호화는 거래 위변조를 막기위한 방법입니다.
*************************************************
*
* 해쉬 암호화 적용( LGD_MID + LGD_OID + LGD_AMOUNT + LGD_TIMESTAMP + LGD_MERTKEY )
* LGD_MID : 상점아이디
* LGD_OID : 주문번호
* LGD_AMOUNT : 금액
* LGD_TIMESTAMP : 타임스탬프
* LGD_MERTKEY : 상점MertKey (mertkey는 상점관리자 -> 계약정보 -> 상점정보관리에서 확인하실수 있습니다)
*
* MD5 해쉬데이터 암호화 검증을 위해
* LG유플러스에서 발급한 상점키(MertKey)를 환경설정 파일(lgdacom/conf/mall.conf)에 반드시 입력하여 주시기 바랍니다.
*/
$xpay = new XPay($configPath, $CST_PLATFORM);
// Mert Key 설정
$xpay->set_config_value('t'.$LGD_MID, $config['cf_lg_mert_key']);
$xpay->set_config_value($LGD_MID, $config['cf_lg_mert_key']);
$xpay->Init_TX($LGD_MID);
$LGD_HASHDATA = md5($LGD_MID.$LGD_OID.$LGD_AMOUNT.$LGD_TIMESTAMP.$xpay->config[$LGD_MID]);
$LGD_CUSTOM_PROCESSTYPE = "TWOTR";
/*
*************************************************
* 2. MD5 해쉬암호화 (수정하지 마세요) - END
*************************************************
*/
$CST_WINDOW_TYPE = "submit"; // 수정불가
$payReqMap['CST_PLATFORM'] = $CST_PLATFORM; // 테스트, 서비스 구분
$payReqMap['CST_WINDOW_TYPE'] = $CST_WINDOW_TYPE; // 수정불가
$payReqMap['CST_MID'] = $CST_MID; // 상점아이디
$payReqMap['LGD_MID'] = $LGD_MID; // 상점아이디
$payReqMap['LGD_OID'] = $LGD_OID; // 주문번호
$payReqMap['LGD_BUYER'] = $LGD_BUYER; // 구매자
$payReqMap['LGD_PRODUCTINFO'] = $LGD_PRODUCTINFO; // 상품정보
$payReqMap['LGD_AMOUNT'] = $LGD_AMOUNT; // 결제금액
$payReqMap['LGD_BUYEREMAIL'] = $LGD_BUYEREMAIL; // 구매자 이메일
$payReqMap['LGD_CUSTOM_SKIN'] = $LGD_CUSTOM_SKIN; // 결제창 SKIN
$payReqMap['LGD_CUSTOM_PROCESSTYPE'] = $LGD_CUSTOM_PROCESSTYPE; // 트랜잭션 처리방식
$payReqMap['LGD_TIMESTAMP'] = $LGD_TIMESTAMP; // 타임스탬프
$payReqMap['LGD_HASHDATA'] = $LGD_HASHDATA; // MD5 해쉬암호값
$payReqMap['LGD_RETURNURL'] = $LGD_RETURNURL; // 응답수신페이지
$payReqMap['LGD_VERSION'] = "PHP_SmartXPay_1.0"; // 버전정보 (삭제하지 마세요)
$payReqMap['LGD_CUSTOM_FIRSTPAY'] = $LGD_CUSTOM_FIRSTPAY; // 디폴트 결제수단
// 2024년 7월에 모바일 결제수단 키가 LGD_CUSTOM_USABLEPAY 키로 쓰이는 것을 확인함
$payReqMap['LGD_CUSTOM_USABLEPAY'] = $LGD_CUSTOM_FIRSTPAY; // 디폴트 결제수단
$payReqMap['LGD_CUSTOM_SWITCHINGTYPE'] = "SUBMIT"; // 신용카드 카드사 인증 페이지 연동 방식
$payReqMap['LGD_ENCODING'] = "UTF-8";
$payReqMap['LGD_ENCODING_NOTEURL'] = "UTF-8";
$payReqMap['LGD_ENCODING_RETURNURL'] = "UTF-8";
$payReqMap['LGD_TAXFREEAMOUNT'] = $LGD_TAXFREEAMOUNT;
$payReqMap['LGD_CASHRECEIPTYN'] = $LGD_CASHRECEIPTYN;
$payReqMap['LGD_BUYERPHONE'] = $LGD_BUYERPHONE;
$payReqMap['LGD_BUYERID'] = $LGD_BUYERID;
$payReqMap['LGD_EASYPAY_ONLY'] = $LGD_EASYPAY_ONLY;
/*
****************************************************
* 안드로이드폰 신용카드 ISP(국민/BC)결제에만 적용 (시작)*
****************************************************
(주의)LGD_CUSTOM_ROLLBACK 의 값을 "Y"로 넘길 경우, LG U+ 전자결제에서 보낸 ISP(국민/비씨) 승인정보를 고객서버의 note_url에서 수신시 "OK" 리턴이 안되면 해당 트랜잭션은 무조건 롤백(자동취소)처리되고,
LGD_CUSTOM_ROLLBACK 의 값 을 "C"로 넘길 경우, 고객서버의 note_url에서 "ROLLBACK" 리턴이 될 때만 해당 트랜잭션은 롤백처리되며 그외의 값이 리턴되면 정상 승인완료 처리됩니다.
만일, LGD_CUSTOM_ROLLBACK 의 값이 "N" 이거나 null 인 경우, 고객서버의 note_url에서 "OK" 리턴이 안될시, "OK" 리턴이 될 때까지 3분간격으로 2시간동안 승인결과를 재전송합니다.
*/
$payReqMap['LGD_CUSTOM_ROLLBACK'] = ""; // 비동기 ISP에서 트랜잭션 처리여부
$payReqMap['LGD_KVPMISPNOTEURL'] = $LGD_KVPMISPNOTEURL; // 비동기 ISP(ex. 안드로이드) 승인결과를 받는 URL
$payReqMap['LGD_KVPMISPWAPURL'] = $LGD_KVPMISPWAPURL; // 비동기 ISP(ex. 안드로이드) 승인완료후 사용자에게 보여지는 승인완료 URL
$payReqMap['LGD_KVPMISPCANCELURL'] = $LGD_KVPMISPCANCELURL; // ISP 앱에서 취소시 사용자에게 보여지는 취소 URL
/*
****************************************************
* 안드로이드폰 신용카드 ISP(국민/BC)결제에만 적용 (끝) *
****************************************************
*/
// 안드로이드 에서 신용카드 적용 ISP(국민/BC)결제에만 적용 (선택)
// $payReqMap['LGD_KVPMISPAUTOAPPYN'] = "Y";
// Y: 안드로이드에서 ISP신용카드 결제시, 고객사에서 'App To App' 방식으로 국민, BC카드사에서 받은 결제 승인을 받고 고객사의 앱을 실행하고자 할때 사용
// 가상계좌(무통장) 결제연동을 하시는 경우 할당/입금 결과를 통보받기 위해 반드시 LGD_CASNOTEURL 정보를 LG 유플러스에 전송해야 합니다 .
$payReqMap['LGD_CASNOTEURL'] = $LGD_CASNOTEURL; // 가상계좌 NOTEURL
// 계좌이체 파라미터
//$payReqMap['LGD_MTRANSFERWAPURL'] = $LGD_MTRANSFERWAPURL;
//$payReqMap['LGD_MTRANSFERCANCELURL'] = $LGD_MTRANSFERCANCELURL;
$payReqMap['LGD_MTRANSFERNOTEURL'] = $LGD_MTRANSFERNOTEURL;
$payReqMap['LGD_MTRANSFERAUTOAPPYN'] = $LGD_MTRANSFERAUTOAPPYN;
//Return URL에서 인증 결과 수신 시 셋팅될 파라미터 입니다.*/
$payReqMap['LGD_RESPCODE'] = "";
$payReqMap['LGD_RESPMSG'] = "";
$payReqMap['LGD_PAYKEY'] = "";
$_SESSION['PAYREQ_MAP'] = $payReqMap;
$g5['title'] = '토스페이먼츠 eCredit서비스 결제';
$g5['body_script'] = ' onload="launchCrossPlatform();"';
include_once(G5_PATH.'/head.sub.php');
?>
<?php if ($default['de_card_test']) { // 테스트 결제시 ?>
<script language="javascript" src="https://js.tosspayments.com/xpay_crossplatform/sandbox/v1" type="text/javascript"></script>
<?php } else { //실 결제시 ?>
<script language="javascript" src="https://xpay.tosspayments.com/xpay/js/xpay_crossplatform.js" type="text/javascript"></script>
<?php } ?>
<script type="text/javascript">
/*
* iframe으로 결제창을 호출하시기를 원하시면 iframe으로 설정 (변수명 수정 불가)
*/
var LGD_window_type = '<?php echo $CST_WINDOW_TYPE; ?>';
/*
* 수정불가
*/
function launchCrossPlatform(){
lgdwin = open_paymentwindow(document.getElementById('LGD_PAYINFO'), '<?php echo $CST_PLATFORM; ?>', LGD_window_type);
}
/*
* FORM 명만 수정 가능
*/
function getFormObject() {
return document.getElementById("LGD_PAYINFO");
}
</script>
<form method="post" name="LGD_PAYINFO" id="LGD_PAYINFO" action="">
<?php
foreach ($payReqMap as $key => $value) {
echo'"<input type="hidden" name="'.get_text($key).'" id="'.get_text($key).'" value="'.get_text($value).'">';
}
?>
</form>
<?php
include_once(G5_PATH.'/tail.sub.php');
+193
View File
@@ -0,0 +1,193 @@
<?php
include_once('./_common.php');
// 상품 리스트에서 다른 필드로 정렬을 하려면 아래의 배열 코드에서 해당 필드를 추가하세요.
if( isset($sort) && ! in_array($sort, array('it_name', 'it_sum_qty', 'it_price', 'it_use_avg', 'it_use_cnt', 'it_update_time')) ){
$sort='';
}
$sql = " select *
from {$g5['g5_shop_category_table']}
where ca_id = '$ca_id'
and ca_use = '1' ";
$ca = sql_fetch($sql);
if (!$ca['ca_id'])
alert('등록된 분류가 없습니다.', G5_SHOP_URL);
// 테마미리보기 스킨 등의 변수 재설정
if(defined('_THEME_PREVIEW_') && _THEME_PREVIEW_ === true) {
$ca['ca_mobile_skin'] = (isset($tconfig['ca_mobile_skin']) && $tconfig['ca_mobile_skin']) ? $tconfig['ca_mobile_skin'] : $ca['ca_mobile_skin'];
$ca['ca_mobile_img_width'] = (isset($tconfig['ca_mobile_img_width']) && $tconfig['ca_mobile_img_width']) ? $tconfig['ca_mobile_img_width'] : $ca['ca_mobile_img_width'];
$ca['ca_mobile_img_height'] = (isset($tconfig['ca_mobile_img_height']) && $tconfig['ca_mobile_img_height']) ? $tconfig['ca_mobile_img_height'] : $ca['ca_mobile_img_height'];
$ca['ca_mobile_list_mod'] = (isset($tconfig['ca_mobile_list_mod']) && $tconfig['ca_mobile_list_mod']) ? $tconfig['ca_mobile_list_mod'] : $ca['ca_mobile_list_mod'];
$ca['ca_mobile_list_row'] = (isset($tconfig['ca_mobile_list_row']) && $tconfig['ca_mobile_list_row']) ? $tconfig['ca_mobile_list_row'] : $ca['ca_mobile_list_row'];
}
// 본인인증, 성인인증체크
if(!$is_admin) {
$msg = shop_member_cert_check($ca_id, 'list');
if($msg)
alert($msg, G5_SHOP_URL);
}
$g5['title'] = $ca['ca_name'];
include_once(G5_MSHOP_PATH.'/_head.php');
// 스킨경로
$skin_dir = G5_MSHOP_SKIN_PATH;
if($ca['ca_mobile_skin_dir']) {
if(preg_match('#^theme/(.+)$#', $ca['ca_mobile_skin_dir'], $match))
$skin_dir = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$match[1];
else
$skin_dir = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$ca['ca_mobile_skin_dir'];
if(is_dir($skin_dir)) {
$skin_file = $skin_dir.'/'.$ca['ca_mobile_skin'];
if(!is_file($skin_file))
$skin_dir = G5_MSHOP_SKIN_PATH;
} else {
$skin_dir = G5_MSHOP_SKIN_PATH;
}
}
define('G5_SHOP_CSS_URL', str_replace(G5_PATH, G5_URL, $skin_dir));
?>
<script>
var g5_shop_url = "<?php echo G5_SHOP_URL; ?>";
</script>
<script src="<?php echo G5_JS_URL; ?>/shop.mobile.list.js"></script>
<div id="sct">
<?php
// 상단 HTML
echo '<div id="sct_hhtml">'.conv_content($ca['ca_mobile_head_html'], 1).'</div>';
$cate_skin = $skin_dir.'/listcategory.skin.php';
if(!is_file($cate_skin))
$cate_skin = G5_MSHOP_SKIN_PATH.'/listcategory.skin.php';
include $cate_skin;
// 테마미리보기 베스트상품 재설정
if(defined('_THEME_PREVIEW_') && _THEME_PREVIEW_ === true) {
if(isset($theme_config['ca_mobile_list_best_mod']))
$theme_config['ca_mobile_list_best_mod'] = (isset($tconfig['ca_mobile_list_best_mod']) && $tconfig['ca_mobile_list_best_mod']) ? $tconfig['ca_mobile_list_best_mod'] : 0;
if(isset($theme_config['ca_mobile_list_best_row']))
$theme_config['ca_mobile_list_best_row'] = (isset($tconfig['ca_mobile_list_best_row']) && $tconfig['ca_mobile_list_best_row']) ? $tconfig['ca_mobile_list_best_row'] : 0;
}
// 분류 Best Item
$list_mod = (isset($theme_config['ca_mobile_list_best_mod']) && $theme_config['ca_mobile_list_best_mod']) ? (int)$theme_config['ca_mobile_list_best_mod'] : $ca['ca_mobile_list_mod'];
$list_row = (isset($theme_config['ca_mobile_list_best_row']) && $theme_config['ca_mobile_list_best_row']) ? (int)$theme_config['ca_mobile_list_best_row'] : $ca['ca_mobile_list_row'];
$limit = $list_mod * $list_row;
$best_skin = G5_MSHOP_SKIN_PATH.'/list.best.10.skin.php';
$sql = " select *
from {$g5['g5_shop_item_table']}
where ( ca_id like '$ca_id%' or ca_id2 like '$ca_id%' or ca_id3 like '$ca_id%' )
and it_use = '1'
and it_type4 = '1'
order by it_order, it_id desc
limit 0, $limit ";
$list = new item_list($best_skin, $list_mod, $list_row, $ca['ca_mobile_img_width'], $ca['ca_mobile_img_height']);
$list->set_query($sql);
$list->set_mobile(true);
$list->set_view('it_img', true);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_price', true);
echo $list->run();
// 상품 출력순서가 있다면
if ($sort != "")
$order_by = $sort.' '.$sortodr.' , it_order, it_id desc';
else
$order_by = 'it_order, it_id desc';
$error = '<p class="sct_noitem">등록된 상품이 없습니다.</p>';
// 리스트 스킨
$skin_file = is_include_path_check($skin_dir.'/'.$ca['ca_mobile_skin']) ? $skin_dir.'/'.$ca['ca_mobile_skin'] : $skin_dir.'/list.10.skin.php';
if (file_exists($skin_file)) {
echo '<div id="sct_sortlst">';
$sort_skin = $skin_dir.'/list.sort.skin.php';
if(!is_file($sort_skin))
$sort_skin = G5_MSHOP_SKIN_PATH.'/list.sort.skin.php';
include $sort_skin;
// 상품 보기 타입 변경 버튼
$sub_skin = $skin_dir.'/list.sub.skin.php';
if(!is_file($sub_skin))
$sub_skin = G5_MSHOP_SKIN_PATH.'/list.sub.skin.php';
if(is_file($sub_skin)){
include $sub_skin;
}
echo '</div>';
// 총몇개
$items = $ca['ca_mobile_list_mod'] * $ca['ca_mobile_list_row'];
// 페이지가 없으면 첫 페이지 (1 페이지)
if ($page < 1) $page = 1;
// 시작 레코드 구함
$from_record = ($page - 1) * $items;
$list = new item_list($skin_file, $ca['ca_mobile_list_mod'], $ca['ca_mobile_list_row'], $ca['ca_mobile_img_width'], $ca['ca_mobile_img_height']);
$list->set_category($ca['ca_id'], 1);
$list->set_category($ca['ca_id'], 2);
$list->set_category($ca['ca_id'], 3);
$list->set_is_page(true);
$list->set_mobile(true);
$list->set_order_by($order_by);
$list->set_from_record($from_record);
$list->set_view('it_img', true);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_price', true);
$list->set_view('sns', true);
$list->set_view('it_icon', true);
echo $list->run();
// where 된 전체 상품수
$total_count = $list->total_count;
}
else
{
echo '<div class="sct_nofile">'.str_replace(G5_PATH.'/', '', $skin_file).' 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</div>';
}
?>
<?php
$qstr1 = '';
if($total_count > $items) {
$qstr1 .= 'ca_id='.$ca_id;
$qstr1 .='&sort='.$sort.'&sortodr='.$sortodr;
$ajax_url = G5_SHOP_URL.'/ajax.list.php?'.$qstr1.'&use_sns=1';
?>
<div class="li_more">
<p id="item_load_msg"><img src="<?php echo G5_SHOP_CSS_URL; ?>/img/loading.gif" alt="로딩이미지" ><br>잠시만 기다려주세요.</p>
<div class="li_more_btn">
<button type="button" id="btn_more_item" data-url="<?php echo $ajax_url; ?>" data-page="<?php echo $page; ?>">더보기 +</button>
</div>
</div>
<?php } ?>
<?php
// 하단 HTML
echo '<div id="sct_thtml">'.conv_content($ca['ca_mobile_tail_html'], 1).'</div>';
?>
</div>
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
echo "\n<!-- {$ca['ca_mobile_skin']} -->\n";
+78
View File
@@ -0,0 +1,78 @@
<?php
include_once('./_common.php');
$type = isset($_REQUEST['type']) ? (int) preg_replace("/[^0-9]/", "", $_REQUEST['type']) : 1;
if ($type === 1) $g5['title'] = '히트상품';
else if ($type === 2) $g5['title'] = '추천상품';
else if ($type === 3) $g5['title'] = '최신상품';
else if ($type === 4) $g5['title'] = '인기상품';
else if ($type === 5) $g5['title'] = '세일상품';
else
alert('상품유형이 아닙니다.');
include_once(G5_MSHOP_PATH.'/_head.php');
// 한페이지에 출력하는 이미지수 = $list_mod * $list_row
// 모바일에서는 계산된 이미지수가 중요함
$list_mod = $default['de_mobile_listtype_list_mod']; // 한줄에 이미지 몇개씩 출력? 단, 모바일환경에서는 사용되지 않음.
$list_row = $default['de_mobile_listtype_list_row']; // 한 페이지에 몇라인씩 출력?
$img_width = $default['de_mobile_listtype_img_width']; // 출력이미지 폭
$img_height = $default['de_mobile_listtype_img_height']; // 출력이미지 높이
?>
<div id="listtype">
<?php
// 상품 출력순서가 있다면
$order_by = ' it_order, it_id desc ';
if ($sort != '')
$order_by = $sort.' '.$sortodr.' , it_order, it_id desc';
else
$order_by = 'it_order, it_id desc';
if (!$skin)
$skin = $default['de_mobile_listtype_list_skin'];
else
$skin = preg_replace('#\.+[\\\/]#', '', strip_tags($skin));
define('G5_SHOP_CSS_URL', G5_MSHOP_SKIN_URL);
// 리스트 유형별로 출력
$list_file = G5_MSHOP_SKIN_PATH.'/'.$skin;
if (file_exists($list_file)) {
// 총몇개 = 한줄에 몇개 * 몇줄
$items = $list_mod * $list_row;
// 페이지가 없으면 첫 페이지 (1 페이지)
if ($page < 1) $page = 1;
// 시작 레코드 구함
$from_record = ($page - 1) * $items;
$list = new item_list();
$list->set_type($type);
$list->set_list_skin($list_file);
$list->set_list_mod($list_mod);
$list->set_list_row($list_row);
$list->set_img_size($img_width, $img_height);
$list->set_is_page(true);
$list->set_mobile(true);
$list->set_order_by($order_by);
$list->set_from_record($from_record);
echo $list->run();
// where 된 전체 상품수
$total_count = $list->total_count;
// 전체 페이지 계산
$total_page = ceil($total_count / $items);
}
else
{
echo '<div align="center">'.get_text($skin).' 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</div>';
}
?>
</div>
<?php
$qstr .= '&amp;type='.$type.'&amp;sort='.$sort;
echo get_paging($config['cf_mobile_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&amp;page=");
?>
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
+139
View File
@@ -0,0 +1,139 @@
<?php
include_once('./_common.php');
// 테마에 mypage.php 있으면 include
if(defined('G5_THEME_MSHOP_PATH')) {
$theme_mypage_file = G5_THEME_MSHOP_PATH.'/mypage.php';
if(is_file($theme_mypage_file)) {
include_once($theme_mypage_file);
return;
unset($theme_mypage_file);
}
}
$g5['title'] = '마이페이지';
include_once(G5_MSHOP_PATH.'/_head.php');
// 쿠폰
$cp_count = get_shop_member_coupon_count($member['mb_id'], true);
?>
<div id="smb_my">
<section id="smb_my_ov">
<h2>회원정보 개요</h2>
<div class="my_name">
<?php echo get_member_profile_img($member['mb_id']); ?> <strong><?php echo $member['mb_id'] ? $member['mb_name'] : '비회원'; ?></strong>님
<ul class="smb_my_act">
<?php if ($is_admin == 'super') { ?><li><a href="<?php echo G5_ADMIN_URL; ?>/" class="btn_admin">관리자</a></li><?php } ?>
<li><a href="<?php echo G5_BBS_URL; ?>/member_confirm.php?url=register_form.php" class="btn01">정보수정</a></li>
<li><a href="<?php echo G5_BBS_URL; ?>/member_confirm.php?url=member_leave.php" onclick="return member_leave();" class="btn01">회원탈퇴</a></li>
</ul>
</div>
<ul class="my_pocou">
<li class="my_cou">
보유쿠폰
<a href="<?php echo G5_SHOP_URL; ?>/coupon.php" target="_blank" class="win_coupon"><?php echo number_format($cp_count); ?></a>
</li>
<li class="my_point">
보유포인트
<a href="<?php echo G5_BBS_URL; ?>/point.php" target="_blank" class="win_point"><?php echo number_format($member['mb_point']); ?>점</a>
</li>
</ul>
<div class="my_info">
<div class="my_info_wr">
<strong>연락처</strong>
<span><?php echo ($member['mb_tel'] ? $member['mb_tel'] : '미등록'); ?></span>
</div>
<div class="my_info_wr">
<strong>E-Mail</strong>
<span><?php echo ($member['mb_email'] ? $member['mb_email'] : '미등록'); ?></span>
</div>
<div class="my_info_wr">
<strong>최종접속일시</strong>
<span><?php echo $member['mb_today_login']; ?></span>
</div>
<div class="my_info_wr">
<strong>회원가입일시</strong>
<span><?php echo $member['mb_datetime']; ?></span>
</div>
<div class="my_info_wr ov_addr">
<strong>주소</strong>
<span><?php echo sprintf("(%s%s)", $member['mb_zip1'], $member['mb_zip2']).' '.print_address($member['mb_addr1'], $member['mb_addr2'], $member['mb_addr3'], $member['mb_addr_jibeon']); ?></span>
</div>
</div>
<div class="my_ov_btn"><button type="button" class="btn_op_area"><i class="fa fa-caret-down" aria-hidden="true"></i><span class="sound_only">상세정보 보기</span></button></div>
</section>
<script>
$(".btn_op_area").on("click", function() {
$(".my_info").toggle();
$(".fa-caret-down").toggleClass("fa-caret-up")
});
</script>
<section id="smb_my_od">
<h2><a href="<?php echo G5_SHOP_URL; ?>/orderinquiry.php">최근 주문내역</a></h2>
<?php
// 최근 주문내역
define("_ORDERINQUIRY_", true);
$limit = " limit 0, 5 ";
include G5_MSHOP_PATH.'/orderinquiry.sub.php';
?>
<a href="<?php echo G5_SHOP_URL; ?>/orderinquiry.php" class="btn_more">더보기</a>
</section>
<section id="smb_my_wish" class="wishlist">
<h2><a href="<?php echo G5_SHOP_URL; ?>/wishlist.php">최근 위시리스트</a></h2>
<ul>
<?php
$sql = " select *
from {$g5['g5_shop_wish_table']} a,
{$g5['g5_shop_item_table']} b
where a.mb_id = '{$member['mb_id']}'
and a.it_id = b.it_id
order by a.wi_id desc
limit 0, 6 ";
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++)
{
$image_w = 250;
$image_h = 250;
$image = get_it_image($row['it_id'], $image_w, $image_h, true);
$list_left_pad = $image_w + 10;
?>
<li>
<div class="wish_img"><?php echo $image; ?></div>
<div class="wish_info">
<a href="<?php echo shop_item_url($row['it_id']); ?>" class="info_link"><?php echo stripslashes($row['it_name']); ?></a>
<span class="info_date"><?php echo substr($row['wi_time'], 2, 8); ?></span>
</div>
</li>
<?php
}
if ($i == 0)
echo '<li class="empty_list">보관 내역이 없습니다.</li>';
?>
</ul>
<a href="<?php echo G5_SHOP_URL; ?>/wishlist.php" class="btn_more">더보기</a>
</section>
</div>
<script>
function member_leave()
{
return confirm('정말 회원에서 탈퇴 하시겠습니까?')
}
</script>
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
+6
View File
@@ -0,0 +1,6 @@
<?php
include_once('../../../common.php');
if (!defined('G5_USE_SHOP') || !G5_USE_SHOP)
die('<p>쇼핑몰 설치 후 이용해 주십시오.</p>');
define('_SHOP_', true);
+2
View File
@@ -0,0 +1,2 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
+190
View File
@@ -0,0 +1,190 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 나이스페이 공통 설정
require_once(G5_MSHOP_PATH.'/settle_nicepay.inc.php');
/*
****************************************************************************************
* <Authentication Result Parameter>
****************************************************************************************
*/
$authResultCode = isset($_POST['AuthResultCode']) ? clean_xss_tags($_POST['AuthResultCode']) : ''; // authentication result code 0000:success
$authResultMsg = isset($_POST['AuthResultMsg']) ? clean_xss_tags($_POST['AuthResultMsg']) : ''; // authentication result message
$nextAppURL = isset($_POST['NextAppURL']) ? clean_xss_tags($_POST['NextAppURL']) : ''; // authorization request URL
$txTid = isset($_POST['TxTid']) ? clean_xss_tags($_POST['TxTid']) : ''; // transaction ID
$authToken = isset($_POST['AuthToken']) ? clean_xss_tags($_POST['AuthToken']) : ''; // authentication TOKEN
$payMethod = isset($_POST['PayMethod']) ? clean_xss_tags($_POST['PayMethod']) : ''; // payment method
$mid = isset($_POST['MID']) ? clean_xss_tags($_POST['MID']) : ''; // merchant id
$moid = isset($_POST['Moid']) ? clean_xss_tags($_POST['Moid']) : ''; // order number
$amt = isset($_POST['Amt']) ? (int) preg_replace('/[^0-9]/', '', $_POST['Amt']) : 0; // Amount of payment
$reqReserved = isset($_POST['ReqReserved']) ? clean_xss_tags($_POST['ReqReserved']) : ''; // mall custom field
$netCancelURL = isset($_POST['NetCancelURL']) ? clean_xss_tags($_POST['NetCancelURL']) : ''; // netCancelURL
if (isset($pp['pp_id']) && $pp['pp_id']) { //개인결제
$session_order_id = get_session('ss_personalpay_id');
$order_price = (int) $pp['pp_price'];
} else {
$session_order_id = get_session('ss_order_id'); // 쇼핑몰 일반결제
}
if ($session_order_id != $moid){
alert("요청한 주문번호가 틀려서 결제를 진행할수 없습니다.\\n다시 장바구니에서 시도해 주세요.", G5_SHOP_URL);
}
if ($default['de_nicepay_mid'] != $mid) {
alert("요청한 상점 mid와 설정된 mid가 틀리므로 결제를 진행할수 없습니다.", G5_SHOP_URL);
}
if ($order_price != $amt) {
alert("요청한 결제금액이 틀리므로 결제를 진행할수 없습니다.", G5_SHOP_URL);
}
// API CALL foreach example
if (! function_exists('jsonRespDump')) {
function jsonRespDump($resp){
$respArr = json_decode($resp);
foreach ( $respArr as $key => $value ){
echo "$key=". $value."<br />";
}
}
}
if (! function_exists('nicepay_res')) {
function nicepay_res($key, $data, $default_val='') {
$response_val = isset($data[$key]) ? $data[$key] : $default_val;
return ($response_val ? $response_val : $default_val);
}
}
/*
****************************************************************************************
* <authorization parameters init>
****************************************************************************************
*/
$response = "";
if($authResultCode === "0000"){
/*
****************************************************************************************
* <Hash encryption> (do not modify)
****************************************************************************************
*/
$ediDate = preg_replace('/[^0-9]/', '', G5_TIME_YMDHIS);
$merchantKey = $default['de_nicepay_key']; // 상점키
$signData = bin2hex(hash('sha256', $authToken . $mid . $amt . $ediDate . $merchantKey, true));
try{
$data = Array(
'TID' => $txTid,
'AuthToken' => $authToken,
'MID' => $mid,
'Amt' => $amt,
'EdiDate' => $ediDate,
'SignData' => $signData,
'CharSet' => 'utf-8'
);
/*
****************************************************************************************
* <authorization request>
* authorization through server to server communication.
****************************************************************************************
// 3001 : 신용카드 성공코드
// 4000 : 계좌이체 성공코드
// 4100 : 가상계좌 발급 성공코드
// A000 : 휴대폰 소액결제 성공코드
// 7001 : 현금영수증
// https://developers.nicepay.co.kr/manual-auth.php
*/
$response = nicepay_reqPost($data, $nextAppURL);
$respArr = json_decode($response, true);
$ResultCode = nicepay_res('ResultCode', $respArr);
$ResultMsg = nicepay_res('ResultMsg', $respArr);
$tno = nicepay_res('TID', $respArr);
$amount = (int) nicepay_res('Amt', $respArr, 0);
$app_time = nicepay_res('AuthDate', $respArr);
$pay_method = nicepay_res('PayMethod', $respArr);
$od_app_no = $app_no = nicepay_res('AuthCode', $respArr); // 승인 번호 (신용카드, 계좌이체, 휴대폰)
$pay_type = $NICEPAY_METHOD[$pay_method];
// 승인된 코드가 아니면 결제가 되지 않게 합니다.
if (! in_array($ResultCode, array('3001', '4000', '4100', 'A000', '7001'))) {
alert($ResultMsg.' 코드 : '.$ResultCode, G5_SHOP_URL);
die();
}
if ($ResultCode == '3001') { // 신용카드
$card_cd = nicepay_res('CardCode', $respArr); // 카드사 코드
$card_name = nicepay_res('CardName', $respArr); // 카드 종류
} else if ($ResultCode == '4100') { // 가상계좌
$bank_name = $bankname = nicepay_res('VbankBankName', $respArr);
$account = nicepay_res('VbankNum', $respArr);
$va_date = nicepay_res('VbankExpDate', $respArr).' '.nicepay_res('VbankExpTime', $respArr); // 가상계좌 입금마감시간
$app_no = nicepay_res('VbankNum', $respArr);
if ($default['de_escrow_use'] == 1)
$escw_yn = 'Y';
} else if ($ResultCode == '4000') { // 계좌이체
$bank_name = $bankname = nicepay_res('BankName', $respArr);
$bank_code = nicepay_res('BankCode', $respArr);
$RcptType = nicepay_res('RcptType', $respArr); // 현금영수증타입 (0:발행안함,1:소득공제,2:지출증빙)
$RcptTID = nicepay_res('RcptTID', $respArr); // 현금영수증 TID, 현금영수증 거래인 경우 리턴
$RcptAuthCode = nicepay_res('RcptAuthCode', $respArr); // 현금영수증 승인번호, 현금영수증 거래인 경우 리턴
$AuthDate = nicepay_res('AuthDate', $respArr); // 현금영수증 승인번호, 현금영수증 거래인 경우 리턴
// 현금영수증 발급시 1 또는 2 이면
if ($RcptType) {
$pg_receipt_infos['od_cash'] = 1; // 현금영수증 발급인것으로 처리
$pg_receipt_infos['od_cash_no'] = $RcptAuthCode; // 현금영수증 승인번호
$pg_receipt_infos['od_cash_info'] = serialize(array('TID'=>$RcptTID, 'ApplNum'=>$RcptAuthCode, 'AuthDate'=>$AuthDate));
}
if ($default['de_escrow_use'] == 1)
$escw_yn = 'Y';
}
$depositor = ''; // 입금할 계좌 예금주 (나이스페이 경우 가상계좌의 예금주명을 리턴받지 못합니다. )
$account = nicepay_res('VbankNum', $respArr);
$commid = ''; // 통신사 코드
$mobile_no = ''; // 휴대폰결제시 휴대폰번호 (나이스페이 경우 결제한 휴대폰번호를 리턴받지 못합니다.)
$card_name = nicepay_res('CardName', $respArr);
} catch(Exception $e) {
$e->getMessage();
$data = Array(
'TID' => $txTid,
'AuthToken' => $authToken,
'MID' => $mid,
'Amt' => $amt,
'EdiDate' => $ediDate,
'SignData' => $signData,
'NetCancel' => '1',
'CharSet' => 'utf-8'
);
/*
*************************************************************************************
* <NET CANCEL>
* If an exception occurs during communication, cancelation is recommended
*************************************************************************************
*/
$response = nicepay_reqPost($data, $netCancelURL);
// jsonRespDump($response);
alert("결제 오류로 더 이상 진행할수 없습니다.");
}
} else {
//When authentication fail
$ResultCode = $authResultCode;
$ResultMsg = $authResultMsg;
alert($ResultMsg.' 실패 코드 : '.$ResultCode);
}
+140
View File
@@ -0,0 +1,140 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<!-- PC payment window only (not required for mobile payment window)-->
<script src="https://web.nicepay.co.kr/v3/webstd/js/nicepay-3.0.js" type="text/javascript"></script>
<script type="text/javascript">
//It is executed when call payment window.
function nicepayStart(f){
if(checkPlatform(window.navigator.userAgent) == "mobile"){
document.sm_form.action = "https://web.nicepay.co.kr/v3/v3Payment.jsp";
document.sm_form.acceptCharset="euc-kr";
document.sm_form.submit();
}else{
goPay(document.sm_form);
}
}
//[PC Only]When pc payment window is closed, nicepay-3.0.js call back nicepaySubmit() function <<'nicepaySubmit()' DO NOT CHANGE>>
function nicepaySubmit(){
document.sm_form.submit();
}
//[PC Only]payment window close function <<'nicepayClose()' DO NOT CHANGE>>
function nicepayClose(){
alert("payment window is closed");
}
//pc, mobile chack script (sample code)
function checkPlatform(ua) {
if(ua === undefined) {
ua = window.navigator.userAgent;
}
ua = ua.toLowerCase();
var platform = {};
var matched = {};
var userPlatform = "pc";
var platform_match = /(ipad)/.exec(ua) || /(ipod)/.exec(ua)
|| /(windows phone)/.exec(ua) || /(iphone)/.exec(ua)
|| /(kindle)/.exec(ua) || /(silk)/.exec(ua) || /(android)/.exec(ua)
|| /(win)/.exec(ua) || /(mac)/.exec(ua) || /(linux)/.exec(ua)
|| /(cros)/.exec(ua) || /(playbook)/.exec(ua)
|| /(bb)/.exec(ua) || /(blackberry)/.exec(ua)
|| [];
matched.platform = platform_match[0] || "";
if(matched.platform) {
platform[matched.platform] = true;
}
if(platform.android || platform.bb || platform.blackberry
|| platform.ipad || platform.iphone
|| platform.ipod || platform.kindle
|| platform.playbook || platform.silk
|| platform["windows phone"]) {
userPlatform = "mobile";
}
if(platform.cros || platform.mac || platform.linux || platform.win) {
userPlatform = "pc";
}
return userPlatform;
}
function nicepay_create_signdata(frm)
{
// 데이터 암호화 처리
var result = true;
$.ajax({
url: g5_url+"/shop/nicepay/createsigndata.php",
type: "POST",
data: {
price : frm.good_mny.value
},
dataType: "json",
async: false,
cache: false,
success: function(data) {
if(data.error == "") {
frm.EdiDate.value = data.ediDate;
frm.SignData.value = data.SignData;
} else {
alert(data.error);
result = false;
}
}
});
return result;
}
</script>
<form name="sm_form" method="post" action="" accept-charset="euc-kr">
<input type="hidden" name="PayMethod" value="CARD">
<input type="hidden" name="GoodsName" value="<?php echo get_text($goods); ?>">
<input type="hidden" name="Amt" value="<?php echo $tot_price; ?>">
<input type="hidden" name="MID" value="<?php echo $default['de_nicepay_mid']; ?>">
<input type="hidden" name="Moid" value="<?php echo $od_id; ?>">
<input type="hidden" name="BuyerName" value="">
<input type="hidden" name="BuyerEmail" value="">
<input type="hidden" name="BuyerTel" value="">
<input type="hidden" name="ReturnURL" value="<?php echo $nicepay_returnURL; ?>">
<input type="hidden" name="VbankExpDate" value="">
<input type="hidden" name="NpLang" value="KO"> <!-- EN:English, CN:Chinese, KO:Korean -->
<input type="hidden" name="GoodsCl" value="1"> <!-- products(1), contents(0)) -->
<input type="hidden" name="TransType" value="<?php echo $default['de_escrow_use'] ? '1' : '0';?>"> <!-- USE escrow false(0)/true(1) -->
<input type="hidden" name="CharSet" value="utf-8"> <!-- Return CharSet -->
<input type="hidden" name="ReqReserved" value=""> <!-- mall custom field -->
<input type="hidden" name="EdiDate" value=""> <!-- YYYYMMDDHHMISS -->
<input type="hidden" name="SignData" value=""> <!-- EncryptData -->
<input type="hidden" name="DirectShowOpt" value="">
<input type="hidden" name="SelectCardCode" value=""> <!-- 카드사 노출 제한, 카드코드 값(ex 비씨:01, 삼성:04) -->
<input type="hidden" name="NicepayReserved" value=""> <!-- 간편결제 (카카오페이에 사용됨) -->
<input type="hidden" name="DirectEasyPay"> <!-- 간편결제 요청 값 (네이버페이에 사용됨) -->
<input type="hidden" name="EasyPayMethod"> <!-- 간편결제 (네이버페이에 사용됨) -->
<input type="hidden" name="EasyPayCardCode"> <!-- 간편결제 카드 코드 -->
<input type="hidden" name="EasyPayQuota"> <!-- 간편결제 할부개월 (3개월일 경우 03 으로 설정) -->
<input type="hidden" name="MultiEasyPayQuota"> <!-- 간편결제 할부개월 다중 설정 옵션 PAYCO와 네이버페이만 가능 -->
<input type="hidden" name="good_mny" value="<?php echo $tot_price; ?>" >
<?php if ($default['de_tax_flag_use']) { ?>
<!-- 필드명:SupplyAmt / 사이즈:12 / 설명:공급가 액 -->
<input type="hidden" name="SupplyAmt" value="<?php echo $comm_tax_mny; ?>"> <!-- 과세금액 -->
<!-- 필드명:GoodsVat / 사이즈:12 / 설명:부가가 치세 -->
<input type="hidden" name="GoodsVat" value="<?php echo $comm_vat_mny; ?>"> <!-- 부가세 -->
<!-- 필드명:ServiceAmt / 사이즈:12 / 설명:봉사료 -->
<input type="hidden" name="ServiceAmt" value="0">
<!-- 필드명:TaxFreeAmt / 사이즈:12 / 설명:면세 금액 -->
<input type="hidden" name="TaxFreeAmt" value="<?php echo $comm_free_mny; ?>">
<input type="hidden" name="comm_tax_mny" value="<?php echo $comm_tax_mny; ?>"> <!-- 과세금액 -->
<input type="hidden" name="comm_vat_mny" value="<?php echo $comm_vat_mny; ?>"> <!-- 부가세 -->
<input type="hidden" name="comm_free_mny" value="<?php echo $comm_free_mny; ?>"> <!-- 비과세 금액 -->
<?php } ?>
</form>
+17
View File
@@ -0,0 +1,17 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<input type="hidden" name="good_mny" value="<?php echo $tot_price ?>" >
<?php if($default['de_tax_flag_use']) { ?>
<input type="hidden" name="comm_tax_mny" value="<?php echo $comm_tax_mny; ?>"> <!-- 과세금액 -->
<input type="hidden" name="comm_vat_mny" value="<?php echo $comm_vat_mny; ?>"> <!-- 부가세 -->
<input type="hidden" name="comm_free_mny" value="<?php echo $comm_free_mny; ?>"> <!-- 비과세 금액 -->
<?php } ?>
<div id="display_pay_button" class="btn_confirm">
<span id="show_req_btn"><input type="button" name="submitChecked" onClick="pay_approval();" value="결제등록" class="btn_submit"></span>
<span id="show_pay_btn" style="display:none;"><input type="button" onClick="forderform_check();" value="주문하기" class="btn_submit"></span>
<a href="<?php echo G5_SHOP_URL; ?>" class="btn_cancel">취소</a>
</div>
+2
View File
@@ -0,0 +1,2 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가;
+87
View File
@@ -0,0 +1,87 @@
<?php
include_once('./_common.php');
include_once(G5_MSHOP_PATH.'/settle_nicepay.inc.php');
$authResultCode = isset($_POST['AuthResultCode']) ? clean_xss_tags($_POST['AuthResultCode']) : ''; // authentication result code 0000:success
$authResultMsg = isset($_POST['AuthResultMsg']) ? clean_xss_tags($_POST['AuthResultMsg']) : ''; // authentication result message
$mid = isset($_POST['MID']) ? clean_xss_tags($_POST['MID']) : ''; // merchant id
$moid = isset($_POST['Moid']) ? clean_xss_tags($_POST['Moid']) : ''; // order number
$sql = " select * from {$g5['g5_shop_order_data_table']} where od_id = '$moid' ";
$row = sql_fetch($sql);
if (empty($row)) {
die('');
}
$data = unserialize(base64_decode($row['dt_data']));
if(isset($data['pp_id']) && $data['pp_id']) {
$order_action_url = G5_HTTPS_MSHOP_URL.'/personalpayformupdate.php';
$page_return_url = G5_SHOP_URL.'/personalpayform.php?pp_id='.$data['pp_id'];
} else {
$order_action_url = G5_HTTPS_MSHOP_URL.'/orderformupdate.php';
$page_return_url = G5_SHOP_URL.'/orderform.php';
if($_SESSION['ss_direct'])
$page_return_url .= '?sw_direct=1';
}
$params = array();
$var_datas = array();
foreach($data as $key=>$value) {
if(is_array($value)) {
foreach($value as $k=>$v) {
$_POST[$key][$k] = $params[$key][$k] = clean_xss_tags(strip_tags($v));
}
} else {
if(in_array($key, array('od_memo'))){
$_POST[$key] = $params[$key] = clean_xss_tags(strip_tags($value), 0, 0, 0, 0);
} else {
$_POST[$key] = $params[$key] = clean_xss_tags(strip_tags($value));
}
}
}
// 성공했다면
if ($authResultCode === '0000') {
if(isset($data['pp_id']) && $data['pp_id']) { //개인결제
foreach($params as $key=>$value){
if( in_array($key, shop_order_data_fields(1)) ){
$var_datas[$key] = $value;
$$key = $value;
}
}
include_once(G5_MSHOP_PATH.'/personalpayformupdate.php');
} else { //상점주문
foreach($params as $key=>$value){
if( in_array($key, shop_order_data_fields()) ){
$var_datas[$key] = $value;
$$key = $value;
}
}
$od_send_cost = (int) $_POST['od_send_cost'];
$od_send_cost2 = (int) $_POST['od_send_cost2'];
include_once(G5_MSHOP_PATH.'/orderformupdate.php');
}
} else {
// 실패시
alert('오류 : '.$authResultMsg.' 코드 : '.$authResultCode, $page_return_url);
}
+123
View File
@@ -0,0 +1,123 @@
<?php
include_once('./_common.php');
$order_action_url = G5_HTTPS_SHOP_URL.'/orderaddressupdate.php';
// 테마에 orderaddress.php 있으면 include
if(defined('G5_THEME_MSHOP_PATH')) {
$theme_orderaddress_file = G5_THEME_MSHOP_PATH.'/orderaddress.php';
if(is_file($theme_orderaddress_file)) {
include_once($theme_orderaddress_file);
return;
unset($theme_orderaddress_file);
}
}
$g5['title'] = '배송지 목록';
include_once(G5_PATH.'/head.sub.php');
?>
<form name="forderaddress" method="post" action="<?php echo $order_action_url; ?>" autocomplete="off">
<div id="sod_addr" class="new_win">
<h1 id="win_title">배송지 목록</h1>
<div class="list_01">
<ul>
<?php
$sep = chr(30);
for($i=0; $row=sql_fetch_array($result); $i++) {
$addr = $row['ad_name'].$sep.$row['ad_tel'].$sep.$row['ad_hp'].$sep.$row['ad_zip1'].$sep.$row['ad_zip2'].$sep.$row['ad_addr1'].$sep.$row['ad_addr2'].$sep.$row['ad_addr3'].$sep.$row['ad_jibeon'].$sep.$row['ad_subject'];
$addr = get_text($addr);
?>
<li>
<div class="addr_title chk_box">
<input type="hidden" name="ad_id[<?php echo $i; ?>]" value="<?php echo $row['ad_id'];?>">
<input type="checkbox" name="chk[]" value="<?php echo $i;?>" id="chk_<?php echo $i;?>" class="ad_chk selec_chk">
<label for="chk_<?php echo $i;?>"><span></span><strong class="sound_only">배송지선택</strong></label>
<label for="ad_subject<?php echo $i;?>" class="sound_only">배송지명</label>
<input type="text" name="ad_subject[<?php echo $i; ?>]" value="<?php echo $row['ad_subject']; ?>" class="ad_subject" maxlength="20">
</div>
<div class="addr_info">
<div class="addr_name"><?php echo get_text($row['ad_name']); ?></div>
<div class="addr_addr"><?php echo print_address($row['ad_addr1'], $row['ad_addr2'], $row['ad_addr3'], $row['ad_jibeon']); ?></div>
<div class="addr_tel"><i class="fa fa-phone" aria-hidden="true"></i> <?php echo $row['ad_tel']; ?> / <i class="fa fa-mobile" aria-hidden="true"></i> <?php echo $row['ad_hp']; ?></div>
</div>
<div class="addr_btn">
<input type="hidden" value="<?php echo $addr; ?>">
<button type="button" class="btn_sel sel_address">선택</button>
<a href="<?php echo $_SERVER['SCRIPT_NAME']; ?>?w=d&amp;ad_id=<?php echo $row['ad_id']; ?>" id="btn_del" class="del_address">삭제</a>
<input type="radio" name="ad_default" value="<?php echo $row['ad_id'];?>" id="ad_default<?php echo $i;?>" <?php if($row['ad_default']) echo 'checked="checked"';?>>
<label for="ad_default<?php echo $i;?>" class="add_lb">기본배송지</label>
</div>
</li>
<?php
}
?>
</ul>
</div>
<div class="win_btn">
<input type="submit" name="act_button" value="선택수정" class="btn_submit">
<button type="button" onclick="self.close();" class="btn_close">닫기</button>
</div>
</div>
</form>
<?php echo get_paging($config['cf_mobile_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&amp;page="); ?>
<script>
$(function() {
$(".sel_address").on("click", function() {
var addr = $(this).siblings("input").val().split(String.fromCharCode(30));
var f = window.opener.forderform;
f.od_b_name.value = addr[0];
f.od_b_tel.value = addr[1];
f.od_b_hp.value = addr[2];
f.od_b_zip.value = addr[3] + addr[4];
f.od_b_addr1.value = addr[5];
f.od_b_addr2.value = addr[6];
f.od_b_addr3.value = addr[7];
f.od_b_addr_jibeon.value = addr[8];
f.ad_subject.value = addr[9];
var zip1 = addr[3].replace(/[^0-9]/g, "");
var zip2 = addr[4].replace(/[^0-9]/g, "");
if(zip1 != "" && zip2 != "") {
var code = String(zip1) + String(zip2);
if(window.opener.zipcode != code) {
window.opener.zipcode = code;
window.opener.calculate_sendcost(code);
}
}
window.close();
});
$(".del_address").on("click", function() {
return confirm("배송지 목록을 삭제하시겠습니까?");
});
// 전체선택 부분
$("#chk_all").on("click", function() {
if($(this).is(":checked")) {
$("input[name^='chk[']").attr("checked", true);
} else {
$("input[name^='chk[']").attr("checked", false);
}
});
$(".btn_submit").on("click", function() {
if($("input[name^='chk[']:checked").length==0 ){
alert("수정하실 항목을 하나 이상 선택하세요.");
return false;
}
});
});
</script>
<?php
include_once(G5_PATH.'/tail.sub.php');
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+93
View File
@@ -0,0 +1,93 @@
<?php
include_once('./_common.php');
define("_ORDERINQUIRY_", true);
$order_info = array();
$request_pwd = isset($_POST['od_pwd']) ? $_POST['od_pwd'] : '';
$od_pwd = get_encrypt_string($request_pwd);
$od_id = isset($_POST['od_id']) ? safe_replace_regex($_POST['od_id'], 'od_id') : '';
// 회원인 경우
if ($is_member)
{
$sql_common = " from {$g5['g5_shop_order_table']} where mb_id = '{$member['mb_id']}' ";
}
else if ($od_id && $od_pwd) // 비회원인 경우 주문서번호와 비밀번호가 넘어왔다면
{
if( defined('G5_MYSQL_PASSWORD_LENGTH') && strlen($od_pwd) === G5_MYSQL_PASSWORD_LENGTH ) {
$sql_common = " from {$g5['g5_shop_order_table']} where od_id = '$od_id' and od_pwd = '$od_pwd' ";
} else {
$sql_common = " from {$g5['g5_shop_order_table']} where od_id = '$od_id' ";
$order_info = get_shop_order_data($od_id);
if (!check_password($request_pwd, $order_info['od_pwd'])) {
run_event('password_is_wrong', 'shop', $order_info);
alert('주문이 존재하지 않습니다.');
exit;
}
}
}
else // 그렇지 않다면 로그인으로 가기
{
goto_url(G5_BBS_URL.'/login.php?url='.urlencode(G5_SHOP_URL.'/orderinquiry.php'));
}
// 테이블의 전체 레코드수만 얻음
$sql = " select count(*) as cnt " . $sql_common;
$row = sql_fetch($sql);
$total_count = $row['cnt'];
// 비회원 주문확인시 비회원의 모든 주문이 다 출력되는 오류 수정
// 조건에 맞는 주문서가 없다면
if ($total_count == 0)
{
if ($is_member) // 회원일 경우는 메인으로 이동
alert('주문이 존재하지 않습니다.', G5_SHOP_URL);
else // 비회원일 경우는 이전 페이지로 이동
alert('주문이 존재하지 않습니다.');
}
$rows = $config['cf_mobile_page_rows'];
$total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page < 1) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
// 비회원 주문확인의 경우 바로 주문서 상세조회로 이동
if (!$is_member)
{
if( defined('G5_MYSQL_PASSWORD_LENGTH') && strlen($od_pwd) === G5_MYSQL_PASSWORD_LENGTH ) {
$sql = " select od_id, od_time, od_ip from {$g5['g5_shop_order_table']} where od_id = '$od_id' and od_pwd = '$od_pwd' ";
$row = sql_fetch($sql);
} else if( $order_info ){
if (check_password($request_pwd, $order_info['od_pwd'])) {
$row = $order_info;
}
}
if ($row['od_id']) {
$uid = md5($row['od_id'].$row['od_time'].$row['od_ip']);
set_session('ss_orderview_uid', $uid);
goto_url(G5_SHOP_URL.'/orderinquiryview.php?od_id='.$row['od_id'].'&amp;uid='.$uid);
}
}
$g5['title'] = '주문내역조회';
include_once(G5_MSHOP_PATH.'/_head.php');
?>
<div id="sod_v">
<p id="sod_v_info">주문서번호 링크를 누르시면 주문상세내역을 조회하실 수 있습니다.</p>
<?php
$limit = " limit $from_record, $rows ";
include G5_MSHOP_PATH.'/orderinquiry.sub.php';
?>
<?php echo get_paging($config['cf_mobile_pages'], $page, $total_page, "{$_SERVER['SCRIPT_NAME']}?$qstr&amp;page="); ?>
</div>
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
+102
View File
@@ -0,0 +1,102 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!defined("_ORDERINQUIRY_")) exit; // 개별 페이지 접근 불가
// 테마에 orderinquiry.sub.php 있으면 include
if(defined('G5_THEME_MSHOP_PATH')) {
$theme_inquiry_file = G5_THEME_MSHOP_PATH.'/orderinquiry.sub.php';
if(is_file($theme_inquiry_file)) {
include_once($theme_inquiry_file);
return;
unset($theme_inquiry_file);
}
}
?>
<?php if (!$limit) { ?>총 <?php echo $cnt; ?> 건<?php } ?>
<div id="sod_inquiry">
<ul>
<?php
$sql = " select *,
(od_cart_coupon + od_coupon + od_send_coupon) as couponprice
from {$g5['g5_shop_order_table']}
where mb_id = '{$member['mb_id']}'
order by od_id desc
$limit ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
// 주문상품
$sql = " select it_name, ct_option
from {$g5['g5_shop_cart_table']}
where od_id = '{$row['od_id']}'
order by io_type, ct_id
limit 1 ";
$ct = sql_fetch($sql);
$ct_name = get_text($ct['it_name']).' '.get_text($ct['ct_option']);
$sql = " select count(*) as cnt
from {$g5['g5_shop_cart_table']}
where od_id = '{$row['od_id']}' ";
$ct2 = sql_fetch($sql);
if($ct2['cnt'] > 1)
$ct_name .= ' 외 '.($ct2['cnt'] - 1).'건';
switch($row['od_status']) {
case '주문':
$od_status = '<span class="status_01">입금확인중</span>';
break;
case '입금':
$od_status = '<span class="status_02">입금완료</span>';
break;
case '준비':
$od_status = '<span class="status_03">상품준비중</span>';
break;
case '배송':
$od_status = '<span class="status_04">상품배송</span>';
break;
case '완료':
$od_status = '<span class="status_05">배송완료</span>';
break;
default:
$od_status = '<span class="status_06">주문취소</span>';
break;
}
$od_invoice = '';
if($row['od_delivery_company'] && $row['od_invoice'])
$od_invoice = '<span class="inv_inv"><i class="fa fa-truck" aria-hidden="true"></i> <strong>'.get_text($row['od_delivery_company']).'</strong> '.get_text($row['od_invoice']).'</span>';
$uid = md5($row['od_id'].$row['od_time'].$row['od_ip']);
?>
<li>
<div class="inquiry_idtime">
<a href="<?php echo G5_SHOP_URL; ?>/orderinquiryview.php?od_id=<?php echo $row['od_id']; ?>&amp;uid=<?php echo $uid; ?>" class="idtime_link"><?php echo $row['od_id']; ?></a>
<span class="idtime_time"><?php echo substr($row['od_time'],2,25); ?></span>
</div>
<div class="inquiry_name">
<?php echo $ct_name; ?>
</div>
<div class="inq_wr">
<div class="inquiry_price">
<?php echo display_price($row['od_receipt_price']); ?>
</div>
<div class="inv_status"><?php echo $od_status; ?></div>
</div>
<div class="inquiry_inv">
<?php echo $od_invoice; ?>
</div>
</li>
<?php
}
if ($i == 0)
echo '<li class="empty_list">주문 내역이 없습니다.</li>';
?>
</ul>
</div>
+722
View File
@@ -0,0 +1,722 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$od_id = isset($_REQUEST['od_id']) ? safe_replace_regex($_REQUEST['od_id'], 'od_id') : '';
// 테마에 orderinquiryview.php 있으면 include
if(defined('G5_THEME_MSHOP_PATH')) {
$theme_inquiryview_file = G5_THEME_MSHOP_PATH.'/orderinquiryview.php';
if(is_file($theme_inquiryview_file)) {
include_once($theme_inquiryview_file);
return;
unset($theme_inquiryview_file);
}
}
$g5['title'] = '주문상세내역';
include_once(G5_MSHOP_PATH.'/_head.php');
// LG 현금영수증 JS
if($od['od_pg'] == 'lg') {
if($default['de_card_test']) {
echo '<script language="JavaScript" src="'.SHOP_TOSSPAYMENTS_CASHRECEIPT_TEST_JS.'"></script>'.PHP_EOL;
} else {
echo '<script language="JavaScript" src="'.SHOP_TOSSPAYMENTS_CASHRECEIPT_REAL_JS.'"></script>'.PHP_EOL;
}
}
?>
<div id="sod_fin">
<div id="sod_fin_no">주문번호 <strong><?php echo $od_id; ?></strong></div>
<section class="sod_fin_list">
<h2>주문하신 상품</h2>
<?php
$st_count1 = $st_count2 = 0;
$custom_cancel = false;
$sql = " select it_id, it_name, cp_price, ct_send_cost, it_sc_type
from {$g5['g5_shop_cart_table']}
where od_id = '$od_id'
group by it_id
order by ct_id ";
$result = sql_query($sql);
?>
<ul id="sod_list_inq" class="sod_list">
<?php
for($i=0; $row=sql_fetch_array($result); $i++) {
$image_width = 65;
$image_height = 65;
$image = get_it_image($row['it_id'], 65, 65, '', '', $row['it_name']);
// 옵션항목
$sql = " select ct_id, it_name, ct_option, ct_qty, ct_price, ct_point, ct_status, io_type, io_price
from {$g5['g5_shop_cart_table']}
where od_id = '$od_id'
and it_id = '{$row['it_id']}'
order by io_type asc, ct_id asc ";
$res = sql_query($sql);
// 합계금액 계산
$sql = " select SUM(IF(io_type = 1, (io_price * ct_qty), ((ct_price + io_price) * ct_qty))) as price,
SUM(ct_qty) as qty
from {$g5['g5_shop_cart_table']}
where it_id = '{$row['it_id']}'
and od_id = '$od_id' ";
$sum = sql_fetch($sql);
// 배송비
switch($row['ct_send_cost'])
{
case 1:
$ct_send_cost = '착불';
break;
case 2:
$ct_send_cost = '무료';
break;
default:
$ct_send_cost = '선불';
break;
}
// 조건부무료
if($row['it_sc_type'] == 2) {
$sendcost = get_item_sendcost($row['it_id'], $sum['price'], $sum['qty'], $od_id);
if($sendcost == 0)
$ct_send_cost = '무료';
}
?>
<li class="sod_li">
<?php
for($k=0; $opt=sql_fetch_array($res); $k++) {
if($opt['io_type'])
$opt_price = $opt['io_price'];
else
$opt_price = $opt['ct_price'] + $opt['io_price'];
$sell_price = $opt_price * $opt['ct_qty'];
$point = $opt['ct_point'] * $opt['ct_qty'];
?>
<div class="li_op_wr">
<div class="li_name">
<a href="<?php echo shop_item_url($row['it_id']); ?>"><strong><?php echo $row['it_name']; ?></strong></a>
</div>
<a href="<?php echo shop_item_url($row['it_id']); ?>" class="total_img"><?php echo $image; ?></a>
<span class="prqty_stat"><span class="sound_only">상태</span><?php echo $opt['ct_status']; ?></span>
</div>
<div class="sod_opt"><span class="opt_name"><?php echo get_text($opt['ct_option']); ?></span></div>
<div class="li_prqty">
<span class="prqty_price li_prqty_sp"><span>판매가 </span><?php echo number_format($opt_price); ?></span>
<span class="prqty_qty li_prqty_sp"><span>수량 </span><?php echo number_format($opt['ct_qty']); ?></span>
<span class="prqty_sc li_prqty_sp"><span>배송비 </span><?php echo $ct_send_cost; ?></span>
<span class="total_point li_prqty_sp"><span>적립포인트 </span><?php echo number_format($point); ?></span>
</div>
<div class="li_total">
<span class="total_price total_span"><span>주문금액 </span><?php echo number_format($sell_price); ?></span>
</div>
<?php
$tot_point += $point;
$st_count1++;
if($opt['ct_status'] == '주문')
$st_count2++;
}
?>
</li>
<?php
}
// 주문 상품의 상태가 모두 주문이면 고객 취소 가능
if($st_count1 > 0 && $st_count1 == $st_count2)
$custom_cancel = true;
?>
</ul>
<div id="sod_sts_wrap">
<span class="sound_only">상품 상태 설명</span>
<div id="sod_sts_explan">
<dl id="sod_fin_legend">
<dt>주문</dt>
<dd>주문이 접수되었습니다.</dd>
<dt>입금</dt>
<dd>입금(결제)이 완료 되었습니다.</dd>
<dt>준비</dt>
<dd>상품 준비 중입니다.</dd>
<dt>배송</dt>
<dd>상품 배송 중입니다.</dd>
<dt>완료</dt>
<dd>상품 배송이 완료 되었습니다.</dd>
</dl>
</div>
<div class="btn_wr"><button type="button" id="sod_sts_explan_open">상태설명보기</button></div>
</div>
<?php
// 총계 = 주문상품금액합계 + 배송비 - 상품할인 - 결제할인 - 배송비할인
$tot_price = $od['od_cart_price'] + $od['od_send_cost'] + $od['od_send_cost2']
- $od['od_cart_coupon'] - $od['od_coupon'] - $od['od_send_coupon']
- $od['od_cancel_price'];
?>
<div class="sod_ta_wr">
<dl id="m_sod_bsk_tot">
<dt class="sod_bsk_dvr">주문총액</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_cart_price']); ?> 원</strong></dd>
<?php if($od['od_cart_coupon'] > 0) { ?>
<dt class="sod_bsk_dvr">상품할인</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_cart_coupon']); ?> 원</strong></dd>
<?php } ?>
<?php if($od['od_coupon'] > 0) { ?>
<dt class="sod_bsk_dvr">결제할인</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_coupon']); ?> 원</strong></dd>
<?php } ?>
<?php if ($od['od_send_cost'] > 0) { ?>
<dt class="sod_bsk_dvr">배송비</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_cost']); ?> 원</strong></dd>
<?php } ?>
<?php if($od['od_send_coupon'] > 0) { ?>
<dt class="sod_bsk_dvr">배송비할인</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_coupon']); ?> 원</strong></dd>
<?php } ?>
<?php if ($od['od_send_cost2'] > 0) { ?>
<dt class="sod_bsk_dvr">추가배송비</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_send_cost2']); ?> 원</strong></dd>
<?php } ?>
<?php if ($od['od_cancel_price'] > 0) { ?>
<dt class="sod_bsk_dvr">취소금액</dt>
<dd class="sod_bsk_dvr"><strong><?php echo number_format($od['od_cancel_price']); ?> 원</strong></dd>
<?php } ?>
<dt class="sod_bsk_point">적립포인트</dt>
<dd class="sod_bsk_point"><strong><?php echo number_format($tot_point); ?> 점</strong></dd>
<dt class="sod_bsk_cnt">총계</dt>
<dd class="sod_bsk_cnt"><strong><?php echo number_format($tot_price); ?> 원</strong></dd>
</dl>
</div>
</section>
<div id="sod_fin_view">
<h2>결제/배송 정보</h2>
<?php
$receipt_price = $od['od_receipt_price']
+ $od['od_receipt_point'];
$cancel_price = $od['od_cancel_price'];
$misu = true;
$misu_price = $tot_price - $receipt_price;
if ($misu_price == 0 && ($od['od_cart_price'] > $od['od_cancel_price'])) {
$wanbul = " (완불)";
$misu = false; // 미수금 없음
}
else
{
$wanbul = display_price($receipt_price);
}
// 결제정보처리
if($od['od_receipt_price'] > 0)
$od_receipt_price = display_price($od['od_receipt_price']);
else
$od_receipt_price = '아직 입금되지 않았거나 입금정보를 입력하지 못하였습니다.';
$app_no_subj = '';
$disp_bank = true;
$disp_receipt = false;
if($od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == 'KAKAOPAY' || is_inicis_order_pay($od['od_settle_case']) ) {
$app_no_subj = '승인번호';
$app_no = $od['od_app_no'];
$disp_bank = false;
$disp_receipt = true;
} else if($od['od_settle_case'] == '간편결제') {
$app_no_subj = '승인번호';
$app_no = $od['od_app_no'];
$disp_bank = false;
$disp_receipt = true;
} else if($od['od_settle_case'] == '휴대폰') {
$app_no_subj = '휴대폰번호';
$app_no = $od['od_bank_account'];
$disp_bank = false;
$disp_receipt = true;
} else if($od['od_settle_case'] == '가상계좌' || $od['od_settle_case'] == '계좌이체') {
$app_no_subj = '거래번호';
$app_no = $od['od_tno'];
if( function_exists('shop_is_taxsave') && $misu_price == 0 && shop_is_taxsave($od, true) === 2 ){
$disp_receipt = true;
}
}
?>
<section id="sod_fin_pay">
<h3>결제정보</h3>
<div class="odf_tbl">
<table>
<tbody>
<tr>
<th scope="row">주문번호</th>
<td><?php echo $od_id; ?></td>
</tr>
<tr>
<th scope="row">주문일시</th>
<td><?php echo $od['od_time']; ?></td>
</tr>
<tr>
<th scope="row">결제방식</th>
<td><?php echo check_pay_name_replace($od['od_settle_case'], $od, 1); ?></td>
</tr>
<tr>
<th scope="row">결제금액</th>
<td><?php echo $od_receipt_price; ?></td>
</tr>
<?php
if($od['od_receipt_price'] > 0)
{
?>
<tr>
<th scope="row">결제일시</th>
<td><?php echo $od['od_receipt_time']; ?></td>
</tr>
<?php
}
// 승인번호, 휴대폰번호, 거래번호
if($app_no_subj && trim($app_no))
{
?>
<tr>
<th scope="row"><?php echo $app_no_subj; ?></th>
<td><?php echo $app_no; ?></td>
</tr>
<?php
}
// 계좌정보
if($disp_bank)
{
?>
<tr>
<th scope="row">입금자명</th>
<td><?php echo get_text($od['od_deposit_name']); ?></td>
</tr>
<tr>
<th scope="row">입금계좌</th>
<td><?php echo get_text($od['od_bank_account']); ?></td>
</tr>
<?php
}
if($disp_receipt) {
?>
<tr>
<th scope="row">영수증</th>
<td>
<?php
if($od['od_settle_case'] == '휴대폰')
{
if($od['od_pg'] == 'lg') {
require_once G5_SHOP_PATH.'/settle_lg.inc.php';
$LGD_TID = $od['od_tno'];
$LGD_MERTKEY = $config['cf_lg_mert_key'];
$LGD_HASHDATA = md5($LGD_MID.$LGD_TID.$LGD_MERTKEY);
$hp_receipt_script = 'showReceiptByTID(\''.$LGD_MID.'\', \''.$LGD_TID.'\', \''.$LGD_HASHDATA.'\');';
} else if($od['od_pg'] == 'inicis') {
$hp_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid='.$od['od_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else if($od['od_pg'] == 'nicepay') {
$hp_receipt_script = 'window.open(\'https://npg.nicepay.co.kr/issue/IssueLoader.do?type=0&TID='.$od['od_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else {
$hp_receipt_script = 'window.open(\''.G5_BILL_RECEIPT_URL.'mcash_bill&tno='.$od['od_tno'].'&order_no='.$od['od_id'].'&trade_mony='.$od['od_receipt_price'].'\', \'winreceipt\', \'width=500,height=690,scrollbars=yes,resizable=yes\');';
}
?>
<a href="javascript:;" onclick="<?php echo $hp_receipt_script; ?>">영수증 출력</a>
<?php
}
if($od['od_settle_case'] == '신용카드' || $od['od_settle_case'] == '간편결제' || is_inicis_order_pay($od['od_settle_case']) || (shop_is_taxsave($od, true) && $misu_price == 0) )
{
if($od['od_pg'] == 'lg') {
require_once G5_SHOP_PATH.'/settle_lg.inc.php';
$LGD_TID = $od['od_tno'];
$LGD_MERTKEY = $config['cf_lg_mert_key'];
$LGD_HASHDATA = md5($LGD_MID.$LGD_TID.$LGD_MERTKEY);
$card_receipt_script = 'showReceiptByTID(\''.$LGD_MID.'\', \''.$LGD_TID.'\', \''.$LGD_HASHDATA.'\');';
} else if($od['od_pg'] == 'nicepay') {
$card_receipt_script = 'window.open(\'https://npg.nicepay.co.kr/issue/IssueLoader.do?type=0&TID='.$od['od_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else if($od['od_pg'] == 'inicis') {
$card_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid='.$od['od_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else {
$card_receipt_script = 'window.open(\''.G5_BILL_RECEIPT_URL.'card_bill&tno='.$od['od_tno'].'&order_no='.$od['od_id'].'&trade_mony='.$od['od_receipt_price'].'\', \'winreceipt\', \'width=470,height=815,scrollbars=yes,resizable=yes\');';
}
?>
<a href="javascript:;" onclick="<?php echo $card_receipt_script; ?>">영수증 출력</a>
<?php
}
if($od['od_settle_case'] == 'KAKAOPAY')
{
//$card_receipt_script = 'window.open(\'https://mms.cnspay.co.kr/trans/retrieveIssueLoader.do?TID='.$od['od_tno'].'&type=0\', \'popupIssue\', \'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=420,height=540\');';
$card_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid='.$od['od_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
?>
<a href="javascript:;" onclick="<?php echo $card_receipt_script; ?>">영수증 출력</a>
<?php
}
?>
</td>
</tr>
<?php
}
if ($od['od_receipt_point'] > 0)
{
?>
<tr>
<th scope="row">포인트사용</th>
<td><?php echo display_point($od['od_receipt_point']); ?></td>
</tr>
<?php
}
if ($od['od_refund_price'] > 0)
{
?>
<tr>
<th scope="row">환불 금액</th>
<td><?php echo display_price($od['od_refund_price']); ?></td>
</tr>
<?php
}
// 현금영수증 발급을 사용하는 경우 또는 현금영수증 발급을 한 주문건이면
if ((function_exists('shop_is_taxsave') && shop_is_taxsave($od)) || (function_exists('is_order_cashreceipt') && is_order_cashreceipt($od))) {
// 미수금이 없고 현금일 경우에만 현금영수증을 발급 할 수 있습니다.
if ($misu_price == 0 && is_order_cashreceipt($od)) {
?>
<tr>
<th scope="row">현금영수증</th>
<td>
<?php
if ($od['od_cash'])
{
if($od['od_pg'] == 'lg') {
require_once G5_SHOP_PATH.'/settle_lg.inc.php';
switch($od['od_settle_case']) {
case '계좌이체':
$trade_type = 'BANK';
break;
case '가상계좌':
$trade_type = 'CAS';
break;
default:
$trade_type = 'CR';
break;
}
$cash_receipt_script = 'javascript:showCashReceipts(\''.$LGD_MID.'\',\''.$od['od_id'].'\',\''.$od['od_casseqno'].'\',\''.$trade_type.'\',\''.$CST_PLATFORM.'\');';
} else if($od['od_pg'] == 'inicis') {
$cash = unserialize($od['od_cash_info']);
$cash_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/Cash_mCmReceipt.jsp?noTid='.$cash['TID'].'&clpaymethod=22\',\'showreceipt\',\'width=380,height=540,scrollbars=no,resizable=no\');';
} else if($od['od_pg'] == 'nicepay') {
$cash_receipt_script = 'window.open(\'https://npg.nicepay.co.kr/issue/IssueLoader.do?type=1&TID='.$od['od_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else {
require_once G5_SHOP_PATH.'/settle_kcp.inc.php';
$cash = unserialize($od['od_cash_info']);
$cash_receipt_script = 'window.open(\''.G5_CASH_RECEIPT_URL.$default['de_kcp_mid'].'&orderid='.$od_id.'&bill_yn=Y&authno='.$cash['receipt_no'].'\', \'taxsave_receipt\', \'width=360,height=647,scrollbars=0,menus=0\');';
}
?>
<a href="javascript:;" onclick="<?php echo $cash_receipt_script; ?>">현금영수증 확인하기</a>
<?php
}
else if (shop_is_taxsave($od))
{
?>
<a href="javascript:;" onclick="window.open('<?php echo G5_SHOP_URL; ?>/taxsave.php?od_id=<?php echo $od_id; ?>', 'taxsave', 'width=550,height=400,scrollbars=1,menus=0');">현금영수증을 발급하시려면 클릭하십시오.</a>
<?php } ?>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</section>
<section id="sod_fin_orderer">
<h3>주문하신 분</h3>
<div class="odf_tbl">
<table>
<tbody>
<tr>
<th scope="row">이 름</th>
<td><?php echo get_text($od['od_name']); ?></td>
</tr>
<tr>
<th scope="row">전화번호</th>
<td><?php echo get_text($od['od_tel']); ?></td>
</tr>
<tr>
<th scope="row">핸드폰</th>
<td><?php echo get_text($od['od_hp']); ?></td>
</tr>
<tr>
<th scope="row">주 소</th>
<td><?php echo get_text(sprintf("(%s%s)", $od['od_zip1'], $od['od_zip2']).' '.print_address($od['od_addr1'], $od['od_addr2'], $od['od_addr3'], $od['od_addr_jibeon'])); ?></td>
</tr>
<tr>
<th scope="row">E-mail</th>
<td><?php echo get_text($od['od_email']); ?></td>
</tr>
</tbody>
</table>
</div>
</section>
<section id="sod_fin_receiver">
<h3>받으시는 분</h3>
<div class="odf_tbl">
<table>
<tbody>
<tr>
<th scope="row">이 름</th>
<td><?php echo get_text($od['od_b_name']); ?></td>
</tr>
<tr>
<th scope="row">전화번호</th>
<td><?php echo get_text($od['od_b_tel']); ?></td>
</tr>
<tr>
<th scope="row">핸드폰</th>
<td><?php echo get_text($od['od_b_hp']); ?></td>
</tr>
<tr>
<th scope="row">주 소</th>
<td><?php echo get_text(sprintf("(%s%s)", $od['od_b_zip1'], $od['od_b_zip2']).' '.print_address($od['od_b_addr1'], $od['od_b_addr2'], $od['od_b_addr3'], $od['od_b_addr_jibeon'])); ?></td>
</tr>
<?php
// 희망배송일을 사용한다면
if ($default['de_hope_date_use'])
{
?>
<tr>
<th scope="row">희망배송일</th>
<td><?php echo substr($od['od_hope_date'],0,10).' ('.get_yoil($od['od_hope_date']).')' ;?></td>
</tr>
<?php }
if ($od['od_memo'])
{
?>
<tr>
<th scope="row">전하실 말씀</th>
<td><?php echo conv_content($od['od_memo'], 0); ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</section>
<section id="sod_fin_dvr">
<h3>배송정보</h3>
<div class="odf_tbl">
<table>
<tbody>
<?php
if ($od['od_invoice'] && $od['od_delivery_company'])
{
?>
<tr>
<th scope="row">배송회사</th>
<td><?php echo $od['od_delivery_company']; ?> <?php echo get_delivery_inquiry($od['od_delivery_company'], $od['od_invoice'], 'dvr_link'); ?></td>
</tr>
<tr>
<th scope="row">운송장번호</th>
<td><?php echo $od['od_invoice']; ?></td>
</tr>
<tr>
<th scope="row">배송일시</th>
<td><?php echo $od['od_invoice_time']; ?></td>
</tr>
<?php
}
else
{
?>
<tr>
<td class="empty_table">아직 배송하지 않았거나 배송정보를 입력하지 못하였습니다.</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</section>
</div>
<section id="sod_fin_tot">
<h2>결제합계</h2>
<ul>
<li>
총 구매액
<strong><?php echo display_price($tot_price); ?></strong>
</li>
<?php
if ($misu_price > 0) {
echo '<li>';
echo '미결제액'.PHP_EOL;
echo '<strong>'.display_price($misu_price).'</strong>';
echo '</li>';
}
?>
<li id="alrdy">
결제액
<strong><?php echo $wanbul; ?></strong>
<?php if( $od['od_receipt_point'] ){ //포인트로 결제한 내용이 있으면 ?>
<div class="right">
<p><span class="title"><i class="fa fa-angle-right" aria-hidden="true"></i> 포인트 결제</span><?php echo number_format($od['od_receipt_point']); ?> 점</p>
<p><span class="title"><i class="fa fa-angle-right" aria-hidden="true"></i> 실결제</span><?php echo number_format($od['od_receipt_price']); ?> 원</p>
</div>
<?php } ?>
</li>
</ul>
</section>
<section id="sod_fin_cancel">
<h2>주문취소</h2>
<?php
// 취소한 내역이 없다면
if ($cancel_price == 0) {
if ($custom_cancel) {
?>
<button type="button" onclick="document.getElementById('sod_fin_cancelfrm').style.display='block';">주문 취소하기</button>
<div id="sod_fin_cancelfrm">
<form method="post" action="<?php echo G5_SHOP_URL; ?>/orderinquirycancel.php" onsubmit="return fcancel_check(this);">
<input type="hidden" name="od_id" value="<?php echo $od['od_id']; ?>">
<input type="hidden" name="token" value="<?php echo $token; ?>">
<label for="cancel_memo" class="sound_only">취소사유</label>
<input type="text" name="cancel_memo" id="cancel_memo" required class="frm_input required" maxlength="100" placeholder="취소사유">
<input type="submit" value="확인" class="btn_frmline">
</form>
</div>
<?php
}
} else {
?>
<p>주문 취소, 반품, 품절된 내역이 있습니다.</p>
<?php } ?>
</section>
<?php if ($od['od_settle_case'] == '가상계좌' && $od['od_misu'] > 0 && $default['de_card_test'] && $is_admin && $od['od_pg'] == 'kcp') {
preg_match("/\s{1}([^\s]+)\s?/", $od['od_bank_account'], $matchs);
$deposit_no = trim($matchs[1]);
?>
<p>관리자가 가상계좌 테스트를 한 경우에만 보입니다.</p>
<div id="kcp_acc_test" class="odf_tbl">
<form method="post" action="http://devadmin.kcp.co.kr/Modules/Noti/TEST_Vcnt_Noti_Proc.jsp" target="_blank">
<table>
<caption>모의입금처리</caption>
<tbody>
<tr>
<th scope="col"><label for="e_trade_no">KCP 거래번호</label></th>
<td><input type="text" name="e_trade_no" value="<?php echo $od['od_tno']; ?>"></td>
</tr>
<tr>
<th scope="col"><label for="deposit_no">입금계좌</label></th>
<td><input type="text" name="deposit_no" value="<?php echo $deposit_no; ?>"></td>
</tr>
<tr>
<th scope="col"><label for="req_name">입금자명</label></th>
<td><input type="text" name="req_name" value="<?php echo $od['od_deposit_name']; ?>"></td>
</tr>
<tr>
<th scope="col"><label for="noti_url">입금통보 URL</label></th>
<td><input type="text" name="noti_url" value="<?php echo G5_SHOP_URL; ?>/settle_kcp_common.php"></td>
</tr>
</tbody>
</table>
<div id="sod_fin_test" class="btn_confirm">
<input type="submit" value="입금통보 테스트" class="btn_submit">
</div>
</form>
</div>
<?php } ?>
</div>
<script>
$(function() {
$("#sod_sts_explan_open").on("click", function() {
var $explan = $("#sod_sts_explan");
if($explan.is(":animated"))
return false;
if($explan.is(":visible")) {
$explan.slideUp(200);
$("#sod_sts_explan_open").text("상태설명보기");
} else {
$explan.slideDown(200);
$("#sod_sts_explan_open").text("상태설명닫기");
}
});
$("#sod_sts_explan_close").on("click", function() {
var $explan = $("#sod_sts_explan");
if($explan.is(":animated"))
return false;
$explan.slideUp(200);
$("#sod_sts_explan_open").text("상태설명보기");
});
});
function fcancel_check(f)
{
if(!confirm("주문을 정말 취소하시겠습니까?"))
return false;
var memo = f.cancel_memo.value;
if(memo == "") {
alert("취소사유를 입력해 주십시오.");
return false;
}
return true;
}
</script>
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
+58
View File
@@ -0,0 +1,58 @@
<?php
include_once('./_common.php');
$g5['title'] = '개인결제 리스트';
include_once(G5_MSHOP_PATH.'/_head.php');
?>
<!-- 상품 목록 시작 { -->
<div id="sct_pv">
<?php
// 리스트 유형별로 출력
$list_file = G5_MSHOP_SKIN_PATH.'/personalpay.skin.php';
if (file_exists($list_file)) {
$list_mod = 3;
$list_row = 5;
$img_width = 230;
$img_height = 230;
$sql_common = " from {$g5['g5_shop_personalpay_table']}
where pp_use = '1'
and pp_tno = '' ";
// 총몇개 = 한줄에 몇개 * 몇줄
$items = $list_mod * $list_row;
$sql = "select COUNT(*) as cnt $sql_common ";
$row = sql_fetch($sql);
$total_count = $row['cnt'];
// 전체 페이지 계산
$total_page = ceil($total_count / $items);
// 페이지가 없으면 첫 페이지 (1 페이지)
if ($page < 1) $page = 1;
// 시작 레코드 구함
$from_record = ($page - 1) * $items;
$sql = " select *
$sql_common
order by pp_id desc
limit $from_record, $items";
$result = sql_query($sql);
include $list_file;
}
else
{
echo '<p class="sct_nofile">personalpay.skin.php 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</p>';
}
echo get_paging($config['cf_mobile_pages'], $page, $total_page, $_SERVER['SCRIPT_NAME'].'?'.$qstr.'&amp;page=');
?>
</div>
<!-- } 상품 목록 끝 -->
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
+396
View File
@@ -0,0 +1,396 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
require_once(G5_MSHOP_PATH.'/settle_'.$default['de_pg_service'].'.inc.php');
$tablet_size = "1.0"; // 화면 사이즈 조정 - 기기화면에 맞게 수정(갤럭시탭,아이패드 - 1.85, 스마트폰 - 1.0)
?>
<div id="sod_approval_frm">
<?php
// 결제대행사별 코드 include (결제등록 필드)
require_once(G5_MSHOP_PATH.'/'.$default['de_pg_service'].'/orderform.1.php');
?>
</div>
<style>
#sod_frm_paysel input[type="radio"] + label:before {opacity: 1;}
#sod_frm_paysel input[type="radio"] + label:after {opacity: 1;}
.tbl_frm01 th {padding: 10px 10px;}
.btn_cancel {
width: 100%;
height: 50px;
line-height: 45px;
font-size: 1.25em;
margin: 5px 0;
border: 1px solid #ccd1d9;
border-radius: 10px;
}
.sod_right h2 {
background: #fff;
border-bottom: 1px solid #e2e4e7;
font-size: 1.167em;
padding: 20px 0px 20px 0px;
}
</style>
<div id="m_pv_sod_frm" class="personal_pay_wrap">
<form name="forderform" method="post" action="<?php echo $order_action_url; ?>" autocomplete="off">
<input type="hidden" name="pp_id" value="<?php echo $pp['pp_id']; ?>">
<section id="m_sod_frm_orderer" class="pesonal sod_left mb-0">
<h2>개인결제정보</h2>
<div class="odf_tbl tbl_frm01 tbl_wrap">
<table>
<tbody>
<?php if(trim($pp['pp_content'])) { ?>
<tr>
<th>상세내용</th>
<td><?php echo conv_content($pp['pp_content'], 0); ?></td>
</tr>
<?php } ?>
<tr>
<th>결제금액</th>
<td><?php echo display_price($pp['pp_price']); ?></td>
</tr>
<tr>
<th scope="row"><label for="pp_name">이름</label></th>
<td><input type="text" name="pp_name" value="<?php echo get_text($pp['pp_name']); ?>" id="pp_name" required class="required frm_input"></td>
</tr>
<tr>
<th scope="row"><label for="pp_email">이메일</label></th>
<td><input type="email" name="pp_email" value="<?php echo $member['mb_email']; ?>" id="pp_email" required class="required frm_input"></td>
</tr>
<tr>
<th scope="row"><label for="pp_hp">휴대폰</label></th>
<td><input type="text" name="pp_hp" value="<?php echo get_text($member['mb_hp']); ?>" id="pp_hp" class="frm_input"></td>
</tr>
</tbody>
</table>
</div>
</section>
<div class="sod_right">
<h2>결제수단</h2>
<?php
$multi_settle = 0;
$checked = '';
$escrow_title = "";
if ($default['de_escrow_use']) {
$escrow_title = "에스크로 ";
}
if ($default['de_vbank_use'] || $default['de_iche_use'] || $default['de_card_use'] || $default['de_hp_use']) {
echo '<fieldset id="sod_frm_paysel">';
echo '<legend>결제방법 선택</legend>';
echo '<ul class="pay_way">';
}
// 가상계좌 사용
if ($default['de_vbank_use']) {
$multi_settle++;
echo '<li><input type="radio" id="pp_settle_vbank" name="pp_settle_case" value="가상계좌" '.$checked.'> <label for="pp_settle_vbank" class="lb_icon"><span></span>'.$escrow_title.'가상계좌</label></li>'.PHP_EOL;
$checked = '';
}
// 계좌이체 사용
if ($default['de_iche_use']) {
$multi_settle++;
echo '<li><input type="radio" id="pp_settle_iche" name="pp_settle_case" value="계좌이체" '.$checked.'> <label for="pp_settle_iche">'.$escrow_title.'계좌이체</label></li>'.PHP_EOL;
$checked = '';
}
// 휴대폰 사용
if ($default['de_hp_use']) {
$multi_settle++;
echo '<li><input type="radio" id="pp_settle_hp" name="pp_settle_case" value="휴대폰" '.$checked.'> <label for="pp_settle_hp">휴대폰</label></li>'.PHP_EOL;
$checked = '';
}
// 신용카드 사용
if ($default['de_card_use']) {
$multi_settle++;
echo '<li><input type="radio" id="pp_settle_card" name="pp_settle_case" value="신용카드" '.$checked.'> <label for="pp_settle_card">신용카드</label></li>'.PHP_EOL;
$checked = '';
}
if ($default['de_vbank_use'] || $default['de_iche_use'] || $default['de_card_use'] || $default['de_hp_use']) {
echo '</ul>';
echo '</fieldset>';
}
?>
<?php
if ($multi_settle == 0)
echo '<p>결제할 방법이 없습니다.<br>운영자에게 알려주시면 감사하겠습니다.</p>';
?>
<?php
// 결제대행사별 코드 include (결제대행사 정보 필드 및 주분버튼)
require_once(G5_MSHOP_PATH.'/'.$default['de_pg_service'].'/orderform.2.php');
?>
<div id="show_progress" style="display:none;">
<img src="<?php echo G5_MOBILE_URL; ?>/shop/img/loading.gif" alt="">
<span>결제진행 중입니다. 잠시만 기다려 주십시오.</span>
</div>
</div>
<div class="cb"></div>
</form>
<?php
if ($default['de_escrow_use']) {
// 결제대행사별 코드 include (에스크로 안내)
require_once(G5_MSHOP_PATH.'/'.$default['de_pg_service'].'/orderform.3.php');
}
?>
</div>
<script>
/* 결제방법에 따른 처리 후 결제등록요청 실행 */
var settle_method = "";
function pay_approval()
{
var f = document.sm_form;
var pf = document.forderform;
// 필드체크
if(!payfield_check(pf))
return false;
// 금액체크
if(!payment_check(pf))
return false;
<?php if($default['de_pg_service'] == 'kcp') { ?>
f.buyr_name.value = pf.pp_name.value;
f.buyr_mail.value = pf.pp_email.value;
f.buyr_tel1.value = pf.pp_hp.value;
f.buyr_tel2.value = pf.pp_hp.value;
f.rcvr_name.value = pf.pp_name.value;
f.rcvr_tel1.value = pf.pp_hp.value;
f.rcvr_tel2.value = pf.pp_hp.value;
f.rcvr_mail.value = pf.pp_email.value;
f.settle_method.value = settle_method;
<?php } else if($default['de_pg_service'] == 'lg') { ?>
var pay_method = "";
switch(settle_method) {
case "계좌이체":
pay_method = "SC0030";
break;
case "가상계좌":
pay_method = "SC0040";
break;
case "휴대폰":
pay_method = "SC0060";
break;
case "신용카드":
pay_method = "SC0010";
break;
}
f.LGD_CUSTOM_FIRSTPAY.value = pay_method;
f.LGD_BUYER.value = pf.pp_name.value;
f.LGD_BUYEREMAIL.value = pf.pp_email.value;
f.LGD_BUYERPHONE.value = pf.pp_hp.value;
f.LGD_AMOUNT.value = f.good_mny.value;
<?php if($default['de_tax_flag_use']) { ?>
f.LGD_TAXFREEAMOUNT.value = pf.comm_free_mny.value;
<?php } ?>
<?php } else if($default['de_pg_service'] == 'inicis') { ?>
var paymethod = "";
var width = 330;
var height = 480;
var xpos = (screen.width - width) / 2;
var ypos = (screen.width - height) / 2;
var position = "top=" + ypos + ",left=" + xpos;
var features = position + ", width=320, height=440";
switch(settle_method) {
case "계좌이체":
paymethod = "bank";
break;
case "가상계좌":
paymethod = "vbank";
break;
case "휴대폰":
paymethod = "mobile";
break;
case "신용카드":
paymethod = "wcard";
break;
}
f.P_AMT.value = f.good_mny.value;
f.P_UNAME.value = pf.pp_name.value;
f.P_MOBILE.value = pf.pp_hp.value;
f.P_EMAIL.value = pf.pp_email.value;
<?php if($default['de_tax_flag_use']) { ?>
f.P_TAX.value = pf.comm_vat_mny.value;
f.P_TAXFREE = pf.comm_free_mny.value;
<?php } ?>
f.P_RETURN_URL.value = "<?php echo $return_url.$pp_id; ?>";
f.action = "https://mobile.inicis.com/smart/" + paymethod + "/";
<?php } else if($default['de_pg_service'] == 'nicepay') { ?>
f.Amt.value = f.good_mny.value;
f.BuyerName.value = pf.pp_name.value;
f.BuyerEmail.value = pf.pp_email.value;
f.BuyerTel.value = pf.pp_hp.value;
f.DirectShowOpt.value = ""; // 간편결제 요청 값 초기화
f.DirectEasyPay.value = ""; // 간편결제 요청 값 초기화
f.NicepayReserved.value = ""; // 간편결제 요청 값 초기화
f.EasyPayMethod.value = ""; // 간편결제 요청 값 초기화
<?php if ($default['de_escrow_use']) { // 간편결제시 에스크로값이 0이 되므로 기본설정값을 지정 ?>
f.TransType.value = "1";
<?php } ?>
switch(settle_method) {
case "계좌이체":
paymethod = "BANK";
break;
case "가상계좌":
paymethod = "VBANK";
break;
case "휴대폰":
paymethod = "CELLPHONE";
break;
case "신용카드":
paymethod = "CARD";
break;
default:
paymethod = "무통장";
break;
}
f.PayMethod.value = paymethod;
<?php if($default['de_tax_flag_use']) { ?>
f.SupplyAmt.value = pf.comm_tax_mny.value;
f.GoodsVat.value = pf.comm_vat_mny.value;
f.TaxFreeAmt.value = pf.comm_free_mny.value;
<?php } ?>
if (! nicepay_create_signdata(f)) {
return false;
}
<?php } ?>
//var new_win = window.open("about:blank", "tar_opener", "scrollbars=yes,resizable=yes");
//f.target = "tar_opener";
// 주문 정보 임시저장
var order_data = $(pf).serialize();
var save_result = "";
$.ajax({
type: "POST",
data: order_data,
url: g5_url+"/shop/ajax.orderdatasave.php",
cache: false,
async: false,
success: function(data) {
save_result = data;
}
});
if(save_result) {
alert(save_result);
return false;
}
<?php if($default['de_pg_service'] == 'nicepay') { ?>
nicepayStart(f);
return;
<?php } ?>
f.submit();
}
function forderform_check()
{
var f = document.forderform;
// 필드체크
if(!payfield_check(f))
return false;
// 금액체크
if(!payment_check(f))
return false;
if(f.res_cd.value != "0000") {
alert("결제등록요청 후 결제해 주십시오.");
return false;
}
document.getElementById("display_pay_button").style.display = "none";
document.getElementById("show_progress").style.display = "block";
setTimeout(function() {
f.submit();
}, 300);
}
// 결제폼 필드체크
function payfield_check(f)
{
var settle_case = document.getElementsByName("pp_settle_case");
var settle_check = false;
for (i=0; i<settle_case.length; i++)
{
if (settle_case[i].checked)
{
settle_check = true;
settle_method = settle_case[i].value;
break;
}
}
if (!settle_check)
{
alert("결제방식을 선택하십시오.");
return false;
}
return true;
}
// 결제체크
function payment_check(f)
{
var tot_price = <?php echo (int)$pp['pp_price']; ?>;
if (document.getElementById("pp_settle_iche")) {
if (document.getElementById("pp_settle_iche").checked) {
if (tot_price < 150) {
alert("계좌이체는 150원 이상 결제가 가능합니다.");
return false;
}
}
}
if (document.getElementById("pp_settle_card")) {
if (document.getElementById("pp_settle_card").checked) {
if (tot_price < 1000) {
alert("신용카드는 1000원 이상 결제가 가능합니다.");
return false;
}
}
}
if (document.getElementById("pp_settle_hp")) {
if (document.getElementById("pp_settle_hp").checked) {
if (tot_price < 350) {
alert("휴대폰은 350원 이상 결제가 가능합니다.");
return false;
}
}
}
return true;
}
</script>
+286
View File
@@ -0,0 +1,286 @@
<?php
include_once('./_common.php');
include_once(G5_LIB_PATH.'/mailer.lib.php');
$page_return_url = G5_SHOP_URL.'/personalpayform.php?pp_id='.get_session('ss_personalpay_id');
$post_tran_cd = isset($_POST['tran_cd']) ? $_POST['tran_cd'] : '';
$post_enc_info = isset($_POST['enc_info']) ? $_POST['enc_info'] : '';
$post_enc_data = isset($_POST['enc_data']) ? $_POST['enc_data'] : '';
$post_lgd_paykey = isset($_POST['LGD_PAYKEY']) ? $_POST['LGD_PAYKEY'] : '';
$post_p_hash = isset($_POST['P_HASH']) ? $_POST['P_HASH'] : '';
$pp_id = isset($_POST['pp_id']) ? preg_replace('/[^0-9]/', '', $_POST['pp_id']) : 0;
$good_mny = isset($_POST['good_mny']) ? preg_replace('/[^0-9]/', '', $_POST['good_mny']) : 0;
// 결제등록 완료 체크
if($default['de_pg_service'] == 'kcp' && ($post_tran_cd === '' || $post_enc_info === '' || $post_enc_data === ''))
alert('결제등록 요청 후 주문해 주십시오.', $page_return_url);
if($default['de_pg_service'] == 'lg' && ! $post_lgd_paykey)
alert('결제등록 요청 후 주문해 주십시오.', $page_return_url);
if($default['de_pg_service'] == 'inicis' && ! $post_p_hash)
alert('결제등록 요청 후 주문해 주십시오.', $page_return_url);
// 개인결제 정보
$pp_check = false;
$sql = " select * from {$g5['g5_shop_personalpay_table']} where pp_id = '{$pp_id}' and pp_use = '1' ";
$pp = sql_fetch($sql);
if(! (isset($pp['pp_id']) && $pp['pp_id']))
alert('개인결제 정보가 존재하지 않습니다.', G5_SHOP_URL.'/personalpay.php');
$hash_data = md5($pp_id.$good_mny.$pp['pp_time']);
if($pp['pp_tno']){
if( $default['de_pg_service'] == 'inicis' && ($pp_id === get_session('ss_personalpay_id') && $hash_data === get_session('ss_personalpay_hash')) ){
$uid = md5($pp['pp_id'].$pp['pp_time'].$_SERVER['REMOTE_ADDR']);
set_session('ss_personalpay_uid', $uid);
goto_url(G5_SHOP_URL.'/personalpayresult.php?pp_id='.$pp['pp_id'].'&amp;uid='.$uid);
} else {
alert('이미 결제하신 개인결제 내역입니다.', G5_SHOP_URL);
}
}
if($pp_id !== get_session('ss_personalpay_id') || $hash_data !== get_session('ss_personalpay_hash'))
die('개인결제 정보가 올바르지 않습니다.');
if ($pp_settle_case == "계좌이체")
{
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_result.php';
break;
case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php';
break;
case 'nicepay':
include G5_MSHOP_PATH.'/nicepay/nicepay_result.php';
break;
default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$bank_name = iconv("cp949", "utf-8", $bank_name);
break;
}
$pp_tno = $tno;
$pp_receipt_price = $amount;
$pp_receipt_time = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3 \\4:\\5:\\6", $app_time);
$pp_deposit_name = $pp_name;
$pp_bank_account = $bank_name;
$pg_price = $amount;
}
else if ($pp_settle_case == "가상계좌")
{
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_result.php';
break;
case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php';
break;
case 'nicepay':
include G5_MSHOP_PATH.'/nicepay/nicepay_result.php';
break;
default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$bankname = iconv("cp949", "utf-8", $bankname);
$depositor = iconv("cp949", "utf-8", $depositor);
break;
}
$pp_tno = $tno;
$pp_app_no = $app_no;
$pp_receipt_price = 0;
$pp_bank_account = $bankname.' '.$account;
$pp_deposit_name = $depositor;
$pg_price = $amount;
}
else if ($pp_settle_case == "휴대폰")
{
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_result.php';
break;
case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php';
break;
case 'nicepay':
include G5_MSHOP_PATH.'/nicepay/nicepay_result.php';
break;
default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
break;
}
$pp_tno = $tno;
$pp_receipt_price = $amount;
$pp_receipt_time = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3 \\4:\\5:\\6", $app_time);
$pp_bank_account = $commid.' '.$mobile_no;
$pg_price = $amount;
}
else if ($pp_settle_case == "신용카드")
{
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_result.php';
break;
case 'inicis':
include G5_MSHOP_PATH.'/inicis/pay_result.php';
break;
case 'nicepay':
include G5_MSHOP_PATH.'/nicepay/nicepay_result.php';
break;
default:
include G5_MSHOP_PATH.'/kcp/pp_ax_hub.php';
$card_name = iconv("cp949", "utf-8", $card_name);
break;
}
$pp_tno = $tno;
$pp_app_no = $app_no;
$pp_receipt_price = $amount;
$pp_receipt_time = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/", "\\1-\\2-\\3 \\4:\\5:\\6", $app_time);
$pp_bank_account = $card_name;
$pg_price = $amount;
}
else
{
die("od_settle_case Error!!!");
}
// 주문금액과 결제금액이 일치하는지 체크
if((int)$pp['pp_price'] !== (int)$pg_price) {
$cancel_msg = '결제금액 불일치';
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_cancel.php';
break;
case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break;
case 'nicepay':
$cancelAmt = (int)$pg_price;
include G5_SHOP_PATH.'/nicepay/cancel_process.php';
break;
default:
include G5_SHOP_PATH.'/kcp/pp_ax_hub_cancel.php';
break;
}
die("Receipt Amount Error");
}
$pp_pg = $default['de_pg_service'];
// 결제정보 입력
$sql = " update {$g5['g5_shop_personalpay_table']}
set pp_pg = '$pp_pg',
pp_tno = '$pp_tno',
pp_app_no = '$app_no',
pp_receipt_price = '$pp_receipt_price',
pp_settle_case = '$pp_settle_case',
pp_bank_account = '$pp_bank_account',
pp_deposit_name = '$pp_deposit_name',
pp_receipt_time = '$pp_receipt_time',
pp_receipt_ip = '{$_SERVER['REMOTE_ADDR']}'
where pp_id = '{$pp['pp_id']}' ";
$result = sql_query($sql, false);
// 결제정보 입력 오류시 결제 취소
if(!$result) {
$cancel_msg = '결제정보 입력 오류';
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_cancel.php';
break;
case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break;
default:
include G5_SHOP_PATH.'/kcp/pp_ax_hub_cancel.php';
break;
}
die("<p>$sql<p>" . sql_error_info() . "<p>error file : {$_SERVER['SCRIPT_NAME']}");
}
// 주문번호가 있으면 결제정보 반영
if($pp_receipt_price > 0 && $pp['pp_id'] && $pp['od_id']) {
$od_escrow = 0;
if($escw_yn == 'Y')
$od_escrow = 1;
$sql = " update {$g5['g5_shop_order_table']}
set od_receipt_price = od_receipt_price + '$pp_receipt_price',
od_receipt_time = '$pp_receipt_time',
od_pg = '$pp_pg',
od_tno = '$pp_tno',
od_app_no = '$app_no',
od_escrow = '$od_escrow',
od_settle_case = '$pp_settle_case',
od_deposit_name = '$pp_deposit_name',
od_bank_account = '$pp_bank_account',
od_shop_memo = concat(od_shop_memo, \"\\n개인결제 ".$pp['pp_id']." 로 결제완료 - ".$pp_receipt_time."\")
where od_id = '{$pp['od_id']}' ";
$result = sql_query($sql, false);
// 결제정보 입력 오류시 결제 취소
if(!$result) {
$cancel_msg = '결제정보 입력 오류';
switch($default['de_pg_service']) {
case 'lg':
include G5_SHOP_PATH.'/lg/xpay_cancel.php';
break;
case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break;
default:
include G5_SHOP_PATH.'/kcp/pp_ax_hub_cancel.php';
break;
}
die("<p>$sql<p>" . sql_error_info() . "<p>error file : {$_SERVER['SCRIPT_NAME']}");
}
// 미수금 정보 업데이트
$info = get_order_info($pp['od_id']);
$sql = " update {$g5['g5_shop_order_table']}
set od_misu = '{$info['od_misu']}' ";
if($info['od_misu'] == 0)
$sql .= " , od_status = '입금' ";
$sql .= " where od_id = '{$pp['od_id']}' ";
sql_query($sql, FALSE);
// 장바구니 상태변경
if($info['od_misu'] == 0) {
$sql = " update {$g5['g5_shop_cart_table']}
set ct_status = '입금'
where od_id = '{$pp['od_id']}' ";
sql_query($sql, FALSE);
}
}
// 주문 정보 임시 데이터 삭제
$sql = " delete from {$g5['g5_shop_order_data_table']} where od_id = '{$pp['pp_id']}' and dt_pg = '$pp_pg' ";
sql_query($sql);
// 개인결제번호제거
set_session('ss_personalpay_id', '');
set_session('ss_personalpay_hash', '');
$uid = md5($pp['pp_id'].$pp['pp_time'].$_SERVER['REMOTE_ADDR']);
set_session('ss_personalpay_uid', $uid);
$is_noti_pay = isset($is_noti_pay) ? $is_noti_pay : false;
if( $is_noti_pay ){
$order_id = $pp['pp_id'];
return;
}
goto_url(G5_SHOP_URL.'/personalpayresult.php?pp_id='.$pp['pp_id'].'&amp;uid='.$uid);
+322
View File
@@ -0,0 +1,322 @@
<?php
include_once('./_common.php');
$sql = "select * from {$g5['g5_shop_personalpay_table']} where pp_id = '$pp_id' ";
$pp = sql_fetch($sql);
if (! (isset($pp['pp_id']) && $pp['pp_id']) || (md5($pp['pp_id'].$pp['pp_time'].$_SERVER['REMOTE_ADDR']) != get_session('ss_personalpay_uid'))) {
if( isset($_GET['ini_noti']) && $pp['pp_tno'] ){
alert("해당 개인결제는 정상적으로 결제되었습니다.", G5_SHOP_URL."/personalpay.php");
} else {
alert("조회하실 개인결제 내역이 없습니다.", G5_SHOP_URL."/personalpay.php");
}
}
// 결제방법
$settle_case = $pp['pp_settle_case'];
$g5['title'] = '개인결제상세내역';
include_once(G5_MSHOP_PATH.'/_head.php');
// LG 현금영수증 JS
if($pp['pp_pg'] == 'lg') {
if($default['de_card_test']) {
echo '<script language="JavaScript" src="'.SHOP_TOSSPAYMENTS_CASHRECEIPT_TEST_JS.'"></script>'.PHP_EOL;
} else {
echo '<script language="JavaScript" src="'.SHOP_TOSSPAYMENTS_CASHRECEIPT_REAL_JS.'"></script>'.PHP_EOL;
}
}
?>
<div id="sod_fin">
<p id="sod_fin_no">개인결제번호 <strong><?php echo $pp_id; ?></strong></p>
<section id="sod_fin_view">
<h2>결제 정보</h2>
<?php
$misu = true;
if ($pp['pp_price'] == $pp['pp_receipt_price']) {
$wanbul = " (완불)";
$misu = false; // 미수금 없음
}
else
{
$wanbul = display_price($pp['pp_receipt_price']);
}
$misu_price = $pp['pp_price'] - $pp['pp_receipt_price'];
// 결제정보처리
if($pp['pp_receipt_price'] > 0)
$pp_receipt_price = display_price($pp['pp_receipt_price']);
else
$pp_receipt_price = '아직 입금되지 않았거나 입금정보를 입력하지 못하였습니다.';
$app_no_subj = '';
$disp_bank = true;
$disp_receipt = false;
if($pp['pp_settle_case'] == '신용카드') {
$app_no_subj = '승인번호';
$app_no = $pp['pp_app_no'];
$disp_bank = false;
$disp_receipt = true;
} else if($pp['pp_settle_case'] == '휴대폰') {
$app_no_subj = '휴대폰번호';
$app_no = $pp['pp_bank_account'];
$disp_bank = false;
$disp_receipt = true;
} else if($pp['pp_settle_case'] == '가상계좌' || $pp['pp_settle_case'] == '계좌이체') {
$app_no_subj = '거래번호';
$app_no = $pp['pp_tno'];
}
?>
<section id="sod_fin_pay">
<h3>결제정보</h3>
<div class="odf_tbl">
<table>
<colgroup>
<col class="grid_3">
<col>
</colgroup>
<tbody>
<?php if($pp['od_id']) { ?>
<tr>
<th scope="row">주문번호</th>
<td><?php echo $pp['od_id']; ?></td>
</tr>
<?php } ?>
<tr>
<th scope="row">결제방식</th>
<td><?php echo $pp['pp_settle_case']; ?></td>
</tr>
<?php if($pp['pp_receipt_price'] > 0) { ?>
<tr>
<th scope="row">결제금액</th>
<td><?php echo $pp_receipt_price; ?></td>
</tr>
<tr>
<th scope="row">결제일시</th>
<td><?php echo is_null_time($pp['pp_receipt_time']) ? '' : $pp['pp_receipt_time']; ?></td>
</tr>
<?php
}
// 승인번호, 휴대폰번호, 거래번호
if($app_no_subj)
{
?>
<tr>
<th scope="row"><?php echo $app_no_subj; ?></th>
<td><?php echo $app_no; ?></td>
</tr>
<?php
}
// 계좌정보
if($disp_bank)
{
?>
<tr>
<th scope="row">입금자명</th>
<td><?php echo get_text($pp['pp_deposit_name']); ?></td>
</tr>
<tr>
<th scope="row">입금계좌</th>
<td><?php echo get_text($pp['pp_bank_account']); ?></td>
</tr>
<?php
}
if($disp_receipt) {
?>
<tr>
<th scope="row">영수증</th>
<td>
<?php
if($pp['pp_settle_case'] == '휴대폰')
{
if($pp['pp_pg'] == 'lg') {
require_once G5_SHOP_PATH.'/settle_lg.inc.php';
$LGD_TID = $pp['pp_tno'];
$LGD_MERTKEY = $config['cf_lg_mert_key'];
$LGD_HASHDATA = md5($LGD_MID.$LGD_TID.$LGD_MERTKEY);
$hp_receipt_script = 'showReceiptByTID(\''.$LGD_MID.'\', \''.$LGD_TID.'\', \''.$LGD_HASHDATA.'\');';
} else if($pp['pp_pg'] == 'inicis') {
$hp_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid='.$pp['pp_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else if($pp['pp_pg'] == 'nicepay') {
$hp_receipt_script = 'window.open(\'https://npg.nicepay.co.kr/issue/IssueLoader.do?type=0&TID='.$pp['pp_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else {
$hp_receipt_script = 'window.open(\''.G5_BILL_RECEIPT_URL.'mcash_bill&tno='.$pp['pp_tno'].'&order_no='.$pp['pp_id'].'&trade_mony='.$pp['pp_receipt_price'].'\', \'winreceipt\', \'width=500,height=690,scrollbars=yes,resizable=yes\');';
}
?>
<a href="javascript:;" onclick="<?php echo $hp_receipt_script; ?>">영수증 출력</a>
<?php
}
if($pp['pp_settle_case'] == '신용카드')
{
if($pp['pp_pg'] == 'lg') {
require_once G5_SHOP_PATH.'/settle_lg.inc.php';
$LGD_TID = $pp['pp_tno'];
$LGD_MERTKEY = $config['cf_lg_mert_key'];
$LGD_HASHDATA = md5($LGD_MID.$LGD_TID.$LGD_MERTKEY);
$card_receipt_script = 'showReceiptByTID(\''.$LGD_MID.'\', \''.$LGD_TID.'\', \''.$LGD_HASHDATA.'\');';
} else if($pp['pp_pg'] == 'nicepay') {
$card_receipt_script = 'window.open(\'https://npg.nicepay.co.kr/issue/IssueLoader.do?type=0&TID='.$pp['pp_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else if($pp['pp_pg'] == 'inicis') {
$card_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/mCmReceipt_head.jsp?noTid='.$pp['pp_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else {
$card_receipt_script = 'window.open(\''.G5_BILL_RECEIPT_URL.'card_bill&tno='.$pp['pp_tno'].'&order_no='.$pp['pp_id'].'&trade_mony='.$pp['pp_receipt_price'].'\', \'winreceipt\', \'width=470,height=815,scrollbars=yes,resizable=yes\');';
}
?>
<a href="javascript:;" onclick="<?php echo $card_receipt_script; ?>">영수증 출력</a>
<?php
}
?>
<td>
</td>
</tr>
<?php
}
// 현금영수증 발급을 사용하는 경우에만
if ($default['de_taxsave_use']) {
$is_cash_receipt = true;
// 주문내역이 있으면 현금영수증 발급하지 않음
if($pp['od_id']) {
$sql = " select count(od_id) as cnt from {$g5['g5_shop_order_table']} where od_id = '{$pp['od_id']}' ";
$row = sql_fetch($sql);
if($row['cnt'] > 0)
$is_cash_receipt = false;
}
// 미수금이 없고 현금일 경우에만 현금영수증을 발급 할 수 있습니다.
if ($is_cash_receipt && $misu_price == 0 && $pp['pp_receipt_price'] && ($pp['pp_settle_case'] == '계좌이체' || $pp['pp_settle_case'] == '가상계좌')) {
?>
<tr>
<th scope="row">현금영수증</th>
<td>
<?php
if ($pp['pp_cash'])
{
if($pp['pp_pg'] == 'lg') {
require_once G5_SHOP_PATH.'/settle_lg.inc.php';
switch($pp['pp_settle_case']) {
case '계좌이체':
$trade_type = 'BANK';
break;
case '가상계좌':
$trade_type = 'CAS';
break;
default:
$trade_type = 'CR';
break;
}
$cash_receipt_script = 'javascript:showCashReceipts(\''.$LGD_MID.'\',\''.$pp['pp_id'].'\',\''.$pp['pp_casseqno'].'\',\''.$trade_type.'\',\''.$CST_PLATFORM.'\');';
} else if($pp['pp_pg'] == 'inicis') {
$cash = unserialize($pp['pp_cash_info']);
$cash_receipt_script = 'window.open(\'https://iniweb.inicis.com/DefaultWebApp/mall/cr/cm/Cash_mCmReceipt.jsp?noTid='.$cash['TID'].'&clpaymethod=22\',\'showreceipt\',\'width=380,height=540,scrollbars=no,resizable=no\');';
} else if($pp['pp_pg'] == 'nicepay') {
$cash_receipt_script = 'window.open(\'https://npg.nicepay.co.kr/issue/IssueLoader.do?type=1&TID='.$od['od_tno'].'&noMethod=1\',\'receipt\',\'width=430,height=700\');';
} else {
require_once G5_SHOP_PATH.'/settle_kcp.inc.php';
$cash = unserialize($pp['pp_cash_info']);
$cash_receipt_script = 'window.open(\''.G5_CASH_RECEIPT_URL.$default['de_kcp_mid'].'&orderid='.$pp_id.'&bill_yn=Y&authno='.$cash['receipt_no'].'\', \'taxsave_receipt\', \'width=360,height=647,scrollbars=0,menus=0\');';
}
?>
<a href="javascript:;" onclick="<?php echo $cash_receipt_script; ?>">현금영수증 확인하기</a>
<?php
}
else
{
?>
<a href="javascript:;" onclick="window.open('<?php echo G5_SHOP_URL; ?>/taxsave.php?tx=personalpay&od_id=<?php echo $pp_id; ?>', 'taxsave', 'width=550,height=400,scrollbars=1,menus=0');">현금영수증을 발급하시려면 클릭하십시오.</a>
<?php } ?>
</td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</section>
</section>
<section id="sod_fin_tot">
<h2>결제합계</h2>
<ul>
<li>
총 주문액
<strong><?php echo display_price($pp['pp_price']); ?></strong>
</li>
<?php
if ($misu_price > 0) {
echo '<li>';
echo '미결제액'.PHP_EOL;
echo '<strong>'.display_price($misu_price).'</strong>';
echo '</li>';
}
?>
<li id="alrdy">
결제액
<strong><?php echo $wanbul; ?></strong>
</li>
</ul>
</section>
<?php if ($pp['pp_settle_case'] == '가상계좌' && $pp['pp_receipt_price'] == 0 && $default['de_card_test'] && $is_admin && $pp['pp_pg'] == 'kcp') {
preg_match("/\s{1}([^\s]+)\s?/", $pp['pp_bank_account'], $matchs);
$deposit_no = trim($matchs[1]);
?>
<p>관리자가 가상계좌 테스트를 한 경우에만 보입니다.</p>
<div class="tbl_frm01 tbl_wrap">
<form method="post" action="http://devadmin.kcp.co.kr/Modules/Noti/TEST_Vcnt_Noti_Proc.jsp" target="_blank">
<table>
<caption>모의입금처리</caption>
<colgroup>
<col class="grid_3">
<col>
</colgroup>
<tbody>
<tr>
<th scope="col"><label for="e_trade_no">KCP 거래번호</label></th>
<td><input type="text" name="e_trade_no" value="<?php echo $pp['pp_tno']; ?>"></td>
</tr>
<tr>
<th scope="col"><label for="deposit_no">입금계좌</label></th>
<td><input type="text" name="deposit_no" value="<?php echo $deposit_no; ?>"></td>
</tr>
<tr>
<th scope="col"><label for="req_name">입금자명</label></th>
<td><input type="text" name="req_name" value="<?php echo $pp['pp_deposit_name']; ?>"></td>
</tr>
<tr>
<th scope="col"><label for="noti_url">입금통보 URL</label></th>
<td><input type="text" name="noti_url" value="<?php echo G5_SHOP_URL; ?>/settle_kcp_common.php"></td>
</tr>
</tbody>
</table>
<div id="sod_fin_test" class="btn_confirm">
<input type="submit" value="입금통보 테스트" class="btn_submit">
</div>
</form>
</div>
<?php } ?>
</div>
<!-- } 개인결제상세내역 끝 -->
<?php
include_once(G5_MSHOP_PATH.'/_tail.php');
+2
View File
@@ -0,0 +1,2 @@
<?php
include_once('../../common.php');
@@ -0,0 +1,9 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
//삼성페이 또는 Lpay 사용시에만 해당함
if( ! is_inicis_simple_pay() || ('inicis' == $default['de_pg_service']) ){ //PG가 이니시스인 경우 아래 내용 사용 안함
return;
}
include_once(G5_MSHOP_PATH.'/settle_inicis.inc.php');
+85
View File
@@ -0,0 +1,85 @@
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//삼성페이 또는 L.pay 사용시에만 해당함
if( ! is_inicis_simple_pay() || ('inicis' == $default['de_pg_service']) ){ //PG가 이니시스인 경우 아래 내용 사용 안함
return;
}
?>
<script>
jQuery(function($){
$( document ).ready(function() {
var pf = document.forderform;
// 이후에 Lpay 가 추가됨
$(pf).on("form_sumbit_order_samsungpay", samsungpay_form_submit);
function samsungpay_form_submit(){
var $form = $(this),
pf = $form[0],
samsungpayform = document.samsungpay_form;
var paymethod = "";
var width = 330;
var height = 480;
var xpos = (screen.width - width) / 2;
var ypos = (screen.width - height) / 2;
var position = "top=" + ypos + ",left=" + xpos;
var features = position + ", width=320, height=440";
var p_reserved = samsungpayform.DEF_RESERVED.value;
samsungpayform.P_RESERVED.value = p_reserved;
paymethod = "wcard";
if( typeof settle_method != "undefined" && settle_method == "inicis_kakaopay" ){ // L.pay 로 결제하는 경우
samsungpayform.P_RESERVED.value = samsungpayform.P_RESERVED.value.replace("&useescrow=Y", "")+"&d_kakaopay=Y";
} else if( typeof settle_method != "undefined" && settle_method == "lpay" ){ // L.pay 로 결제하는 경우
samsungpayform.P_RESERVED.value = samsungpayform.P_RESERVED.value.replace("&useescrow=Y", "")+"&d_lpay=Y";
} else { // 그 외에는 삼성페이로 인식
samsungpayform.P_RESERVED.value = samsungpayform.P_RESERVED.value.replace("&useescrow=Y", "")+"&d_samsungpay=Y";
}
if( ! jQuery("form[name='sm_form']").length ){
alert("해당 폼이 존재 하지 않는 결제오류입니다.");
return false;
}
samsungpayform.P_AMT.value = samsungpayform.good_mny.value = document.sm_form.good_mny.value;
samsungpayform.P_UNAME.value = pf.od_name.value;
samsungpayform.P_MOBILE.value = pf.od_hp.value;
samsungpayform.P_EMAIL.value = pf.od_email.value;
<?php if($default['de_tax_flag_use']) { ?>
samsungpayform.P_TAX.value = pf.comm_vat_mny.value;
samsungpayform.P_TAXFREE = pf.comm_free_mny.value;
<?php } ?>
samsungpayform.P_RETURN_URL.value = "<?php echo $return_url.$od_id; ?>";
samsungpayform.action = "https://mobile.inicis.com/smart/" + paymethod + "/";
// 주문 정보 임시저장
var order_data = $(pf).serialize();
var save_result = "";
$.ajax({
type: "POST",
data: order_data,
url: g5_url+"/shop/ajax.orderdatasave.php",
cache: false,
async: false,
success: function(data) {
save_result = data;
}
});
if(save_result) {
alert(save_result);
return;
}
samsungpayform.submit();
return false;
}
});
});
</script>
+34
View File
@@ -0,0 +1,34 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
//삼성페이 또는 L.pay 사용시에만 해당함
if( ! is_inicis_simple_pay() || ('inicis' == $default['de_pg_service']) ){ //PG가 이니시스인 경우 아래 내용 사용 안함
return;
}
?>
<form name="samsungpay_form" id="samsungpay_form" method="POST" action="" accept-charset="euc-kr">
<input type="hidden" name="P_OID" value="<?php echo $od_id; ?>">
<input type="hidden" name="P_GOODS" value="<?php echo $goods; ?>">
<input type="hidden" name="P_AMT" value="<?php echo $tot_price; ?>">
<input type="hidden" name="P_UNAME" value="">
<input type="hidden" name="P_MOBILE" value="">
<input type="hidden" name="P_EMAIL" value="">
<input type="hidden" name="P_MID" value="<?php echo $default['de_inicis_mid']; ?>">
<input type="hidden" name="P_NEXT_URL" value="<?php echo $next_url; ?>">
<input type="hidden" name="P_NOTI_URL" value="<?php echo $noti_url; ?>">
<input type="hidden" name="P_RETURN_URL" value="">
<input type="hidden" name="P_HPP_METHOD" value="2">
<input type="hidden" name="P_RESERVED" value="bank_receipt=N&twotrs_isp=Y&block_isp=Y<?php echo $useescrow; ?>">
<input type="hidden" name="DEF_RESERVED" value="bank_receipt=N&twotrs_isp=Y&block_isp=Y<?php echo $useescrow; ?>">
<input type="hidden" name="P_NOTI" value="<?php echo $od_id; ?>">
<input type="hidden" name="P_QUOTABASE" value="01:02:03:04:05:06:07:08:09:10:11:12"> <!-- 할부기간 설정 01은 일시불 -->
<input type="hidden" name="P_SKIP_TERMS" value="Y">
<input type="hidden" name="good_mny" value="<?php echo $tot_price; ?>" >
<?php if($default['de_tax_flag_use']) { ?>
<input type="hidden" name="P_TAX" value="">
<input type="hidden" name="P_TAXFREE" value="">
<?php } ?>
</form>
+22
View File
@@ -0,0 +1,22 @@
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
//삼성페이 또는 L.pay 사용시에만 해당함
if( ! is_inicis_simple_pay() || ('inicis' == $default['de_pg_service']) ){ //PG가 이니시스인 경우 아래 내용 사용 안함
return;
}
?>
<input type="hidden" name="good_mny" value="<?php echo $tot_price ?>" >
<input type="hidden" name="res_cd" value=""> <!-- 결과 코드 -->
<input type="hidden" name="P_HASH" value="">
<input type="hidden" name="P_TYPE" value="">
<input type="hidden" name="P_UNAME" value="">
<input type="hidden" name="P_AUTH_DT" value="">
<input type="hidden" name="P_AUTH_NO" value="">
<input type="hidden" name="P_HPP_CORP" value="">
<input type="hidden" name="P_APPL_NUM" value="">
<input type="hidden" name="P_VACT_NUM" value="">
<input type="hidden" name="P_VACT_NAME" value="">
<input type="hidden" name="P_VACT_BANK" value="">
<input type="hidden" name="P_CARD_ISSUER" value="">

Some files were not shown because too many files have changed in this diff Show More