#241 에스크로 주문 배송시작 연동 작업 중
This commit is contained in:
85
adm/shop_admin/orderescrow.inc.php
Normal file
85
adm/shop_admin/orderescrow.inc.php
Normal file
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
$def_locale = setlocale(LC_CTYPE, 0);
|
||||
$locale_change = false;
|
||||
if(preg_match("/utf[\-]?8/i", $def_locale)) {
|
||||
setlocale(LC_CTYPE, 'ko_KR.euc-kr');
|
||||
$locale_change = true;
|
||||
}
|
||||
|
||||
if ($default['de_card_test']) {
|
||||
if ($default['de_escrow_use'] == 1) {
|
||||
// 에스크로결제 테스트
|
||||
$default['de_kcp_mid'] = "T0007";
|
||||
$default['de_kcp_site_key'] = '2.mDT7R4lUIfHlHq4byhYjf__';
|
||||
}
|
||||
else {
|
||||
// 일반결제 테스트
|
||||
$default['de_kcp_mid'] = "T0000";
|
||||
$default['de_kcp_site_key'] = '3grptw1.zW0GSo4PQdaGvsF__';
|
||||
}
|
||||
}
|
||||
else {
|
||||
$default['de_kcp_mid'] = "SR".$default['de_kcp_mid'];
|
||||
}
|
||||
|
||||
$g_conf_site_cd = $default['de_kcp_mid'];
|
||||
$g_conf_home_dir = G4_SHOP_PATH.'/kcp';
|
||||
$g_conf_key_dir = '';
|
||||
$g_conf_log_dir = '';
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
|
||||
{
|
||||
$g_conf_key_dir = G4_SHOP_PATH.'/kcp/bin/pub.key';
|
||||
$g_conf_log_dir = G4_SHOP_PATH.'/kcp/log';
|
||||
}
|
||||
|
||||
if (preg_match("/^T000/", $g_conf_site_cd) || $default['de_card_test']) {
|
||||
$g_conf_gw_url = "testpaygw.kcp.co.kr";
|
||||
}
|
||||
else {
|
||||
$g_conf_gw_url = "paygw.kcp.co.kr";
|
||||
if (!preg_match("/^SR/", $g_conf_site_cd)) {
|
||||
alert("SR 로 시작하지 않는 KCP SITE CODE 는 지원하지 않습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
$g_conf_log_level = "3";
|
||||
$g_conf_gw_port = "8090";
|
||||
|
||||
include_once(G4_SHOP_PATH.'/kcp/pp_ax_hub_lib.php');
|
||||
|
||||
$req_tx = 'mod_escrow';
|
||||
$mod_type = 'STE1';
|
||||
$mod_desc = '에스크로 배송시작 등록';
|
||||
|
||||
$c_PayPlus = new C_PP_CLI;
|
||||
$c_PayPlus->mf_clear();
|
||||
|
||||
$tran_cd = "00200000";
|
||||
|
||||
// 에스크로 상태변경
|
||||
$tno_count = count($arr_tno);
|
||||
for($i=0; $i<$tno_count; $i++) {
|
||||
if(!$arr_tno[$i] || !$arr_corp[$i] || !$arr_numb[$i])
|
||||
continue;
|
||||
|
||||
$c_PayPlus->mf_set_modx_data( "tno", $arr_tno[$i] );
|
||||
$c_PayPlus->mf_set_modx_data( "mod_type", $mod_type );
|
||||
$c_PayPlus->mf_set_modx_data( "mod_ip", $cust_ip );
|
||||
$c_PayPlus->mf_set_modx_data( "mod_desc", $mod_desc );
|
||||
|
||||
$c_PayPlus->mf_set_modx_data( "deli_numb", $arr_numb[$i] );
|
||||
$c_PayPlus->mf_set_modx_data( "deli_corp", $arr_corp[$i] );
|
||||
|
||||
$c_PayPlus->mf_do_tx( $trace_no, $g_conf_home_dir, $g_conf_site_cd, "", $tran_cd, "",
|
||||
$g_conf_gw_url, $g_conf_gw_port, "payplus_cli_slib", $ordr_idxx,
|
||||
$cust_ip, "3" , 0, 0, $g_conf_key_dir, $g_conf_log_dir); // 응답 전문 처리
|
||||
|
||||
$res_cd = $c_PayPlus->m_res_cd; // 결과 코드
|
||||
$res_msg = $c_PayPlus->m_res_msg; // 결과 메시지
|
||||
}
|
||||
|
||||
if($locale_change)
|
||||
setlocale(LC_CTYPE, $def_locale);
|
||||
?>
|
||||
@ -308,6 +308,8 @@ $pg_anchor = '<ul class="anchor">
|
||||
<input type="hidden" name="page" value="<?php echo $page; ?>">
|
||||
<input type="hidden" name="od_name" value="<?php echo $od['od_name']; ?>">
|
||||
<input type="hidden" name="od_hp" value="<?php echo $od['od_hp']; ?>">
|
||||
<input type="hidden" name="od_tno" value="<?php echo $od['od_tno']; ?>">
|
||||
<input type="hidden" name="od_escrow" value="<?php echo $od['od_escrow']; ?>">
|
||||
|
||||
<section id="anc_sodr_chk" class="compare_left">
|
||||
<h3>결제상세정보 확인</h3>
|
||||
|
||||
@ -42,6 +42,25 @@ define("_ORDERSMS_", true);
|
||||
include "./ordersms.inc.php";
|
||||
|
||||
|
||||
// 에스크로 배송처리
|
||||
if($_POST['od_tno'] && $_POST['od_escrow'] == 1) {
|
||||
$arr_tno = array();
|
||||
$arr_corp = array();
|
||||
$arr_numb = array();
|
||||
|
||||
// 배송회사정보
|
||||
$sql = " select dl_company from {$g4['shop_delivery_table']} where dl_id = '$dl_id' ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
$arr_tno[0] = $_POST['od_tno'];
|
||||
$arr_corp[0] = $row['dl_company'];
|
||||
$arr_numb[0] = $od_invoice;
|
||||
$cust_ip = getenv('REMOTE_ADDR');
|
||||
|
||||
include_once('./orderescrow.inc.php');
|
||||
}
|
||||
|
||||
|
||||
$qstr = "sort1=$sort1&sort2=$sort2&sel_field=$sel_field&search=$search&page=$page";
|
||||
|
||||
goto_url("./orderform.php?od_id=$od_id&$qstr");
|
||||
|
||||
Reference in New Issue
Block a user