diff --git a/shop/kcp/pp_cli_hub.php b/shop/kcp/pp_cli_hub.php index 310b87b4e..e36ace944 100644 --- a/shop/kcp/pp_cli_hub.php +++ b/shop/kcp/pp_cli_hub.php @@ -29,6 +29,12 @@ setlocale(LC_CTYPE, 'ko_KR.euc-kr'); /* = 01. KCP 지불 서버 정보 설정 = */ /* = -------------------------------------------------------------------------- = */ $g_conf_home_dir = G5_SHOP_PATH.'/kcp'; // ※ 쇼핑몰 모듈 설치 절대 경로 bin전까지 + $g_conf_key_dir = ''; + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') + { + $g_conf_log_dir = G5_SHOP_PATH.'/kcp/log'; + $g_conf_key_dir = G5_SHOP_PATH.'/kcp/bin/pub.key'; + } $g_conf_log_level = "3"; if ($default['de_card_test']) { @@ -200,7 +206,7 @@ setlocale(LC_CTYPE, 'ko_KR.euc-kr'); $g_conf_site_key, $tx_cd, "", $g_conf_pa_url, $g_conf_pa_port, "payplus_cli_slib", $ordr_idxx, $cust_ip, $g_conf_log_level, - "", $g_conf_tx_mode ); + "", $g_conf_tx_mode, $g_conf_key_dir, $g_conf_log_dir ); } else { diff --git a/shop/kcp/pp_cli_hub_lib.php b/shop/kcp/pp_cli_hub_lib.php index b7e4242ec..42393d545 100644 --- a/shop/kcp/pp_cli_hub_lib.php +++ b/shop/kcp/pp_cli_hub_lib.php @@ -132,7 +132,8 @@ class C_PAYPLUS_CLI $site_key, $tx_cd, $pub_key_str, $pa_url, $pa_port, $user_agent, $ordr_idxx, $cust_ip, - $log_level, $opt, $mode ) + $log_level, $opt, $mode, + $key_dir, $log_dir) { $payx_data = $this->m_payx_data; @@ -156,26 +157,59 @@ class C_PAYPLUS_CLI } else { - $res_data = $this->mf_exec( $home_dir . "/bin/pp_cli", - "-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_level=" . $log_level . "," . - "opt=" . $opt . "" ); + 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_level=" . $log_level . "," . + "opt=" . $opt . "" ); + } if ( $res_data == "" ) {