이니시스 모바일 IOS의 경우 isp에서 리다이렉트로 인한 문제 수정

This commit is contained in:
thisgun
2017-09-21 17:38:54 +09:00
parent 904c3b0533
commit db7e07da2a
14 changed files with 476 additions and 21 deletions

View File

@ -7,4 +7,7 @@ if (!defined('G5_USE_SHOP') || !G5_USE_SHOP)
die('<p>쇼핑몰 설치 후 이용해 주십시오.</p>');
include_once(G5_ADMIN_PATH.'/admin.lib.php');
include_once('./admin.shop.lib.php');
check_order_inicis_tmps();
?>

View File

@ -119,4 +119,64 @@ function conv_sms_contents($od_id, $contents)
return stripslashes($sms_contents);
}
function check_order_inicis_tmps(){
global $g5, $config, $default, $member;
$admin_cookie_time = get_cookie('admin_visit_time');
if( ! $admin_cookie_time ){
if( $default['de_pg_service'] === 'inicis' && empty($default['de_card_test']) ){
$sql = " select * from {$g5['g5_shop_inicis_log_table']} where P_TID <> '' and P_TYPE in ('CARD', 'ISP', 'BANK') and P_MID <> '' and P_STATUS = '00' and is_mail_send = 0 and substr(P_AUTH_DT, 1, 14) < '".date('YmdHis', strtotime('-3 minutes', G5_SERVER_TIME))."' ";
$result = sql_query($sql, false);
if( !$result ){
return;
}
$mail_msg = '';
for($i=0;$row=sql_fetch_array($result);$i++){
$oid = $row['oid'];
$p_tid = $row['P_TID'];
$p_mid = strtolower($tmps['P_MID']);
if( in_array($p_mid, array('iniescrow0', 'inipaytest')) ) continue;
$sql = "update {$g5['g5_shop_inicis_log_table']} set is_mail_send = 1 where oid = '".$oid."' and P_TID = '".$p_tid."' ";
sql_query($sql);
$sql = " select od_id from {$g5['g5_shop_order_table']} where od_id = '$oid' and od_tno = '$p_tid' ";
$tmp = sql_fetch($sql);
if( $tmp['od_id'] ) continue;
$sql = " select pp_id from {$g5['g5_shop_personalpay_table']} where pp_id = '$oid' and pp_tno = '$p_tid' ";
$tmp = sql_fetch($sql);
if( $tmp['pp_id'] ) continue;
$mail_msg .= '<a href="'.G5_ADMIN_URL.'/shop_admin/inorderform.php?od_id='.$oid.'" target="_blank" >미완료 발생 주문번호 : '.$oid.'</a><br><br>';
}
if( $mail_msg ){
include_once(G5_LIB_PATH.'/mailer.lib.php');
$mails = array_unique(array($member['mb_email'], $config['cf_admin_email']));
foreach($mails as $mail_address){
if (!preg_match("/([0-9a-zA-Z_-]+)@([0-9a-zA-Z_-]+)\.([0-9a-zA-Z_-]+)/", $mail_address)) continue;
mailer($member['mb_nick'], $member['mb_email'], $mail_address, $config['cf_title'].' 사이트 미완료 주문 알림', '이니시스를 통해 결제한 주문건 중에서 미완료 주문이 발생했습니다.<br><br>발생된 원인으로는 장바구니 금액와 실결제 금액이 맞지 않는 경우, 네트워크 오류, 프로그램 오류, 알수 없는 오류 등이 있습니다.<br><br>아래 내용과 실제 주문내역, 이니시스 상점 관리자 에서 결제된 내용을 확인하여 조치를 취해 주세요.<br><br>'.$mail_msg, 0);
}
}
}
set_cookie('admin_visit_time', G5_SERVER_TIME, 3600); //1시간 간격으로 체크
}
} //end function check_order_inicis_tmps
?>

View File

@ -382,6 +382,76 @@ $pg_anchor = '<ul class="anchor">
</section>
<section>
<?php
// 이니시스를 사용하고 있다면
if( $default['de_pg_service'] === 'inicis' && empty($default['de_card_test']) ){
$sql = " select * from {$g5['g5_shop_inicis_log_table']} where P_TID <> '' and P_TYPE in ('CARD', 'ISP', 'BANK') and P_MID <> '' and P_STATUS = '00' and oid = '".$od['od_id']."' ";
$results = sql_query($sql);
$tmps = array();
while( $tmp=sql_fetch_array($results) ){
$sql = " select od_id from {$g5['g5_shop_order_table']} where od_id = '".$tmp['oid']."' and od_tno = '".$tmp['P_TID']."' ";
$exist_od = sql_fetch($sql);
if( $exist_od['od_id'] ) continue;
$sql = " select pp_id from {$g5['g5_shop_personalpay_table']} where pp_id = '".$tmp['oid']."' and pp_tno = '".$tmp['P_TID']."' ";
$exist_od = sql_fetch($sql);
if( $exist_od['od_id'] ) continue;
$tmps[] = $tmp;
}
if( $tmps ) {
?>
<h2 class="h2_frm">이니시스 결제 로그</h2>
<div class="local_desc01 local_desc">
<p>실결제로 결제된 경우 반드시 이니시스 상점 관리자에서 해당 결제건을 확인 후에 주문을 처리해 주세요.</p>
</div>
<div class="tbl_head01 tbl_wrap">
<table>
<caption>이니시스 결제 로그</caption>
<tbody>
<?php foreach( $tmps as $tmp ){
if( empty($tmp) ) continue;
?>
<tr>
<th>주문번호</th>
<td><?php echo $tmp['oid']; ?></td>
</tr>
<tr>
<th>결제 TID</th>
<td><?php echo $tmp['P_TID']; ?></td>
</tr>
<tr>
<th>결제 MID</th>
<td><?php echo $tmp['P_MID']; ?><?php echo in_array( strtolower($tmp['P_MID']), array('iniescrow0', 'inipaytest') ) ? ' ( 테스트결제 )' : ''; ?></td>
</tr>
<tr>
<th>결제 시간</th>
<td><?php echo date('Y-m-d H:i:s', strtotime(substr($tmp['P_AUTH_DT'], 0, 14))); ?></td>
</tr>
<tr>
<th>결제 수단</th>
<td><?php echo $tmp['P_TYPE'].' '.$tmp['P_FN_NM']; ?></td>
</tr>
<tr>
<th>결제된 금액</th>
<td><?php echo $tmp['P_AMT'] ? number_format($tmp['P_AMT']) : 0; ?></td>
</tr>
<?php } //end foreach ?>
</tbody>
</table>
</div>
<?php
} //end if tmps
} //end if inicis
?>
<h2 class="h2_frm">주문자/배송지 정보</h2>
<?php echo $pg_anchor; ?>