KG 이니시스 모바일 결제 낮은 확률로 누락될수 있는 오류 수정
This commit is contained in:
@ -180,19 +180,31 @@ if( !$row ) {
|
||||
// 임시저장 테이블이 없을 경우 생성
|
||||
if(!sql_query(" DESC {$g5['g5_shop_post_log_table']} ", false)) {
|
||||
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['g5_shop_post_log_table']}` (
|
||||
`log_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`oid` bigint(20) unsigned NOT NULL,
|
||||
`mb_id` varchar(255) NOT NULL DEFAULT '',
|
||||
`post_data` text NOT NULL,
|
||||
`ol_code` varchar(255) NOT NULL DEFAULT '',
|
||||
`ol_msg` varchar(255) NOT NULL DEFAULT '',
|
||||
`ol_msg` text NOT NULL,
|
||||
`ol_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`ol_ip` varchar(25) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`oid`)
|
||||
PRIMARY KEY (`log_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ", true);
|
||||
|
||||
$is_check = true;
|
||||
}
|
||||
|
||||
$result = sql_query("describe `{$g5['g5_shop_post_log_table']}`");
|
||||
while ($row = sql_fetch_array($result)){
|
||||
if( $row['Field'] === 'ol_msg' && $row['Type'] === 'varchar(255)' ){
|
||||
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` MODIFY ol_msg TEXT NOT NULL;", false);
|
||||
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` DROP PRIMARY KEY;", false);
|
||||
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` ADD `log_id` int(11) NOT NULL AUTO_INCREMENT, ADD PRIMARY KEY (`log_id`);", false);
|
||||
$is_check = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$is_check = run_replace('admin_dbupgrade', $is_check);
|
||||
|
||||
$db_upgrade_msg = $is_check ? 'DB 업그레이드가 완료되었습니다.' : '더 이상 업그레이드 할 내용이 없습니다.<br>현재 DB 업그레이드가 완료된 상태입니다.';
|
||||
|
||||
@ -169,14 +169,15 @@ if(!isset($default['de_listtype_list_skin'])) {
|
||||
// 임시저장 테이블이 없을 경우 생성
|
||||
if(!sql_query(" DESC {$g5['g5_shop_post_log_table']} ", false)) {
|
||||
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['g5_shop_post_log_table']}` (
|
||||
`log_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`oid` bigint(20) unsigned NOT NULL,
|
||||
`mb_id` varchar(255) NOT NULL DEFAULT '',
|
||||
`post_data` text NOT NULL,
|
||||
`ol_code` varchar(255) NOT NULL DEFAULT '',
|
||||
`ol_msg` varchar(255) NOT NULL DEFAULT '',
|
||||
`ol_msg` text NOT NULL,
|
||||
`ol_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`ol_ip` varchar(25) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`oid`)
|
||||
PRIMARY KEY (`log_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ", false);
|
||||
}
|
||||
|
||||
|
||||
@ -847,14 +847,15 @@ CREATE TABLE IF NOT EXISTS `g5_shop_item_stocksms` (
|
||||
|
||||
DROP TABLE IF EXISTS `g5_shop_order_post_log`;
|
||||
CREATE TABLE IF NOT EXISTS `g5_shop_order_post_log` (
|
||||
`log_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`oid` bigint(20) unsigned NOT NULL,
|
||||
`mb_id` varchar(255) NOT NULL DEFAULT '',
|
||||
`post_data` text NOT NULL,
|
||||
`ol_code` varchar(255) NOT NULL DEFAULT '',
|
||||
`ol_msg` varchar(255) NOT NULL DEFAULT '',
|
||||
`ol_msg` text NOT NULL,
|
||||
`ol_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`ol_ip` varchar(25) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`oid`)
|
||||
PRIMARY KEY (`log_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@ -2636,16 +2636,28 @@ function add_order_post_log($msg='', $code='error'){
|
||||
$od_id = get_session('ss_order_id');
|
||||
|
||||
if( $code === 'delete' ){
|
||||
sql_query(" delete from {$g5['g5_shop_post_log_table']} where (oid = '$od_id' and mb_id = '{$member['mb_id']}') OR ol_datetime < '".date('Y-m-d H:i:s', strtotime('-15 day', G5_SERVER_TIME))."' ", false);
|
||||
sql_query(" delete from {$g5['g5_shop_post_log_table']} where (oid = '$od_id' and mb_id = '{$member['mb_id']}' and ol_code != 'error') OR ol_datetime < '".date('Y-m-d H:i:s', strtotime('-15 day', G5_SERVER_TIME))."' ", false);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $code === 'error' ) {
|
||||
$result = sql_query("describe `{$g5['g5_shop_post_log_table']}`");
|
||||
while ($row = sql_fetch_array($result)){
|
||||
if( $row['Field'] === 'ol_msg' && $row['Type'] === 'varchar(255)' ){
|
||||
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` MODIFY ol_msg TEXT NOT NULL;", false);
|
||||
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` DROP PRIMARY KEY;", false);
|
||||
sql_query("ALTER TABLE `{$g5['g5_shop_post_log_table']}` ADD `log_id` int(11) NOT NULL AUTO_INCREMENT, ADD PRIMARY KEY (`log_id`);", false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "insert into `{$g5['g5_shop_post_log_table']}`
|
||||
set oid = '$od_id',
|
||||
mb_id = '{$member['mb_id']}',
|
||||
post_data = '$post_data',
|
||||
ol_code = '$code',
|
||||
ol_msg = '$msg',
|
||||
ol_msg = '".addslashes($msg)."',
|
||||
ol_datetime = '".G5_TIME_YMDHIS."',
|
||||
ol_ip = '{$_SERVER['REMOTE_ADDR']}'";
|
||||
|
||||
@ -2654,14 +2666,15 @@ function add_order_post_log($msg='', $code='error'){
|
||||
} else {
|
||||
if(!sql_query(" DESC {$g5['g5_shop_post_log_table']} ", false)) {
|
||||
sql_query(" CREATE TABLE IF NOT EXISTS `{$g5['g5_shop_post_log_table']}` (
|
||||
`log_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`oid` bigint(20) unsigned NOT NULL,
|
||||
`mb_id` varchar(255) NOT NULL DEFAULT '',
|
||||
`post_data` text NOT NULL,
|
||||
`ol_code` varchar(255) NOT NULL DEFAULT '',
|
||||
`ol_msg` varchar(255) NOT NULL DEFAULT '',
|
||||
`ol_msg` text NOT NULL,
|
||||
`ol_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`ol_ip` varchar(25) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`oid`)
|
||||
PRIMARY KEY (`log_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ", false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,14 +20,14 @@ if(function_exists('is_use_easypay') && is_use_easypay('global_nhnkcp') && $post
|
||||
|
||||
if( $default['de_pg_service'] == 'inicis' && get_session('ss_order_id') ){
|
||||
if( $exist_order = get_shop_order_data(get_session('ss_order_id')) ){ //이미 상품이 주문되었다면 리다이렉트
|
||||
if($exist_order['od_tno']){
|
||||
if(isset($exist_order['od_tno']) && $exist_order['od_tno']){
|
||||
exists_inicis_shop_order(get_session('ss_order_id'), array(), $exist_order['od_time'], $exist_order['od_ip']);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(function_exists('add_order_post_log')) add_order_post_log('init');
|
||||
if(function_exists('add_order_post_log')) add_order_post_log('init', 'init');
|
||||
|
||||
$page_return_url = G5_SHOP_URL.'/orderform.php';
|
||||
if(get_session('ss_direct'))
|
||||
@ -649,10 +649,22 @@ $sql = " insert {$g5['g5_shop_order_table']}
|
||||
";
|
||||
$result = sql_query($sql, false);
|
||||
|
||||
// 정말로 insert 가 되었는지 한번더 체크한다.
|
||||
$exists_sql = "select od_id, od_tno, od_ip from {$g5['g5_shop_order_table']} where od_id = '$od_id'";
|
||||
$exists_order = sql_fetch($exists_sql);
|
||||
|
||||
if(! $result && (isset($exists_order['od_id']) && $od_id && $exists_order['od_id'] === $od_id)) {
|
||||
if(isset($exists_order['od_tno']) && $exists_order['od_tno']){
|
||||
//이미 상품이 주문되었다면 리다이렉트
|
||||
exists_inicis_shop_order($od_id, array(), $exists_order['od_time'], $REMOTE_ADDR);
|
||||
goto_url(G5_SHOP_URL);
|
||||
}
|
||||
}
|
||||
|
||||
// 주문정보 입력 오류시 결제 취소
|
||||
if(!$result) {
|
||||
if(! $result || ! (isset($exists_order['od_id']) && $od_id && $exists_order['od_id'] === $od_id)) {
|
||||
if($tno) {
|
||||
$cancel_msg = '주문정보 입력 오류';
|
||||
$cancel_msg = '주문정보 입력 오류 : '.$sql;
|
||||
switch($od_pg) {
|
||||
case 'lg':
|
||||
include G5_SHOP_PATH.'/lg/xpay_cancel.php';
|
||||
|
||||
@ -12,7 +12,7 @@ if(function_exists('is_use_easypay') && is_use_easypay('global_nhnkcp') && isset
|
||||
$default['de_pg_service'] = 'kcp';
|
||||
}
|
||||
|
||||
if(function_exists('add_order_post_log')) add_order_post_log('init');
|
||||
if(function_exists('add_order_post_log')) add_order_post_log('init', 'init');
|
||||
|
||||
if(($od_settle_case != '무통장' && $od_settle_case != 'KAKAOPAY') && $default['de_pg_service'] == 'lg' && !$_POST['LGD_PAYKEY']){
|
||||
if(function_exists('add_order_post_log')) add_order_post_log('결제등록 요청 후 주문해 주십시오.');
|
||||
@ -603,10 +603,14 @@ $sql = " insert {$g5['g5_shop_order_table']}
|
||||
";
|
||||
$result = sql_query($sql, false);
|
||||
|
||||
// 정말로 insert 가 되었는지 한번더 체크한다.
|
||||
$exists_sql = "select od_id, od_tno, od_ip from {$g5['g5_shop_order_table']} where od_id = '$od_id'";
|
||||
$exists_order = sql_fetch($exists_sql);
|
||||
|
||||
// 주문정보 입력 오류시 결제 취소
|
||||
if(!$result) {
|
||||
if(! $result || ! (isset($exists_order['od_id']) && $od_id && $exists_order['od_id'] === $od_id)) {
|
||||
if($tno) {
|
||||
$cancel_msg = '주문정보 입력 오류';
|
||||
$cancel_msg = '주문정보 입력 오류 : '.$sql;
|
||||
switch($od_pg) {
|
||||
case 'lg':
|
||||
include G5_SHOP_PATH.'/lg/xpay_cancel.php';
|
||||
|
||||
Reference in New Issue
Block a user