이니시스 웹표준결제 PHP7.1.1_v1.0 모듈 적용
This commit is contained in:
@ -1790,12 +1790,6 @@ if($default['de_iche_use'] || $default['de_vbank_use'] || $default['de_hp_use']
|
|||||||
echo '</script>'.PHP_EOL;
|
echo '</script>'.PHP_EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('mcrypt_module_open')) {
|
|
||||||
echo '<script>'.PHP_EOL;
|
|
||||||
echo 'alert("MCRYPT 관련 함수를 사용할 수 없습니다.\n서버 관리자에게 문의해 주십시오.");'.PHP_EOL;
|
|
||||||
echo '</script>'.PHP_EOL;
|
|
||||||
}
|
|
||||||
|
|
||||||
$log_path = G5_SHOP_PATH.'/inicis/log';
|
$log_path = G5_SHOP_PATH.'/inicis/log';
|
||||||
|
|
||||||
if(!is_dir($log_path)) {
|
if(!is_dir($log_path)) {
|
||||||
|
|||||||
@ -106,7 +106,7 @@ class INILog {
|
|||||||
var $mkey;
|
var $mkey;
|
||||||
var $mergelog;
|
var $mergelog;
|
||||||
|
|
||||||
function INILog($request) {
|
function __construct($request) {
|
||||||
$this->debug_msg = array("", "CRITICAL", "ERROR", "NOTICE", "4", "INFO", "6", "DEBUG", "8");
|
$this->debug_msg = array("", "CRITICAL", "ERROR", "NOTICE", "4", "INFO", "6", "DEBUG", "8");
|
||||||
$this->debug_mode = $request["debug"];
|
$this->debug_mode = $request["debug"];
|
||||||
$this->type = $request["type"];
|
$this->type = $request["type"];
|
||||||
@ -132,7 +132,7 @@ class INILog {
|
|||||||
$this->handle = fopen($logfile, "a+");
|
$this->handle = fopen($logfile, "a+");
|
||||||
if (!$this->handle)
|
if (!$this->handle)
|
||||||
return false;
|
return false;
|
||||||
$this->WriteLog(INFO, "START " . PROGRAM . " " . $this->type . " (V" . VERSION . "-" . BUILDDATE . ")(OS:" . php_uname('s') . php_uname('r') . ",PHP:" . phpversion() . ")");
|
$this->WriteLog(INFO, "START " . PROGRAM . " " . $this->type . " (" . VERSION . "-" . BUILDDATE . ")(OS:" . php_uname('s') . php_uname('r') . ",PHP:" . phpversion() . ")");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -218,7 +218,7 @@ class INIData {
|
|||||||
var $m_RESULT = array(); //Encrypted 필드 hash table
|
var $m_RESULT = array(); //Encrypted 필드 hash table
|
||||||
var $m_RESULT2 = array(); //PG Added Entity
|
var $m_RESULT2 = array(); //PG Added Entity
|
||||||
|
|
||||||
function INIData($request, $request2) {
|
function __construct($request, $request2) {
|
||||||
$this->m_Xml = NULL;
|
$this->m_Xml = NULL;
|
||||||
|
|
||||||
$this->m_REQUEST = $request;
|
$this->m_REQUEST = $request;
|
||||||
@ -274,8 +274,8 @@ class INIData {
|
|||||||
}
|
}
|
||||||
$this->m_sPayMethod = $this->m_REQUEST["paymethod"];
|
$this->m_sPayMethod = $this->m_REQUEST["paymethod"];
|
||||||
|
|
||||||
$this->m_TXVersion = sprintf("%-4.4s", VERSION) .
|
$this->m_TXVersion = sprintf("%-6.6s", VERSION) .
|
||||||
sprintf("B%-6.6s", BUILDDATE) .
|
sprintf("B%-8.8s", BUILDDATE) .
|
||||||
sprintf("%-5.5s", $this->m_Type) .
|
sprintf("%-5.5s", $this->m_Type) .
|
||||||
sprintf("%-10.10s", php_uname('s')) .
|
sprintf("%-10.10s", php_uname('s')) .
|
||||||
sprintf("%-3.3s", "PHP") . //modulescript
|
sprintf("%-3.3s", "PHP") . //modulescript
|
||||||
@ -515,6 +515,12 @@ class INIData {
|
|||||||
$CD = $xml->add_node($CI, TX_CANCELTID, $this->m_REQUEST["tid"]);
|
$CD = $xml->add_node($CI, TX_CANCELTID, $this->m_REQUEST["tid"]);
|
||||||
$CD = $xml->add_node($CI, TX_CANCELMSG, $this->m_REQUEST["cancelmsg"], array("urlencode" => "1"));
|
$CD = $xml->add_node($CI, TX_CANCELMSG, $this->m_REQUEST["cancelmsg"], array("urlencode" => "1"));
|
||||||
$CD = $xml->add_node($CI, TX_CANCELREASON, $this->m_REQUEST["cancelcode"]);
|
$CD = $xml->add_node($CI, TX_CANCELREASON, $this->m_REQUEST["cancelcode"]);
|
||||||
|
|
||||||
|
//휴대폰 익월환불 추가
|
||||||
|
$CD = $xml->add_node($CI, TX_REFUNDACCTNUM, $this->m_REQUEST["racctnum"]);
|
||||||
|
$CD = $xml->add_node($CI, TX_REFUNDBANKCODE, $this->m_REQUEST["rbankcode"]);
|
||||||
|
$CD = $xml->add_node($CI, TX_REFUNDACCTNAME, $this->m_REQUEST["racctname"], array("urlencode" => "1"));
|
||||||
|
|
||||||
$this->AddUserDefinedEntity(CANCELINFO, "", $xml, $CI);
|
$this->AddUserDefinedEntity(CANCELINFO, "", $xml, $CI);
|
||||||
} else if ($this->m_Type == TYPE_REPAY) {
|
} else if ($this->m_Type == TYPE_REPAY) {
|
||||||
//PartCancelInfo(ROOT)
|
//PartCancelInfo(ROOT)
|
||||||
@ -598,10 +604,14 @@ class INIData {
|
|||||||
$CD = $xml->add_node($CI, TX_REFUNDACCTNUM, $this->m_REQUEST["racctnum"]);
|
$CD = $xml->add_node($CI, TX_REFUNDACCTNUM, $this->m_REQUEST["racctnum"]);
|
||||||
$CD = $xml->add_node($CI, TX_REFUNDBANKCODE, $this->m_REQUEST["rbankcode"]);
|
$CD = $xml->add_node($CI, TX_REFUNDBANKCODE, $this->m_REQUEST["rbankcode"]);
|
||||||
$CD = $xml->add_node($CI, TX_REFUNDACCTNAME, $this->m_REQUEST["racctname"], array("urlencode" => "1"));
|
$CD = $xml->add_node($CI, TX_REFUNDACCTNAME, $this->m_REQUEST["racctname"], array("urlencode" => "1"));
|
||||||
|
$CD = $xml->add_node($CI, TX_REFUNDFLGREMIT, $this->m_REQUEST["refundflgremit"]);
|
||||||
|
|
||||||
|
|
||||||
$this->AddUserDefinedEntity(CANCELINFO, "", $xml, $CI);
|
$this->AddUserDefinedEntity(CANCELINFO, "", $xml, $CI);
|
||||||
} else if ($this->m_Type == TYPE_INQUIRY) {
|
} else if ($this->m_Type == TYPE_INQUIRY) {
|
||||||
$CI = $xml->add_node("", INQUIRYINFO);
|
$CI = $xml->add_node("", INQUIRYINFO);
|
||||||
$CD = $xml->add_node($CI, TX_INQR_TID, $this->m_REQUEST["tid"]);
|
$CD = $xml->add_node($CI, TX_INQR_TID, $this->m_REQUEST["tid"]);
|
||||||
|
$CD = $xml->add_node($CI, TX_INQR_OID, $this->m_REQUEST["oid"], array("urlencode" => "1"));
|
||||||
//$this->AddUserDefinedEntity( INQUIRYINFO, "", $xml, $CI );
|
//$this->AddUserDefinedEntity( INQUIRYINFO, "", $xml, $CI );
|
||||||
} else if ($this->m_Type == TYPE_OPENSUB) {
|
} else if ($this->m_Type == TYPE_OPENSUB) {
|
||||||
$OI = $xml->add_node("", OPENSUBINFO);
|
$OI = $xml->add_node("", OPENSUBINFO);
|
||||||
@ -1085,12 +1095,16 @@ class INICrypto {
|
|||||||
var $pgpubkeyid = NULL;
|
var $pgpubkeyid = NULL;
|
||||||
var $mprivkeyid = NULL;
|
var $mprivkeyid = NULL;
|
||||||
var $mkey;
|
var $mkey;
|
||||||
|
var $encMethod = "mcrypt";
|
||||||
|
|
||||||
function INICrypto($request) {
|
function __construct($request) {
|
||||||
$this->homedir = $request["inipayhome"];
|
$this->homedir = $request["inipayhome"];
|
||||||
$this->mid = $request["mid"];
|
$this->mid = $request["mid"];
|
||||||
$this->admin = $request["admin"];
|
$this->admin = $request["admin"];
|
||||||
$this->mkey = $request["mkey"];
|
$this->mkey = $request["mkey"];
|
||||||
|
if(isset($request['encMethod']) && !empty($request['encMethod'])){
|
||||||
|
$this->encMethod = strtolower($request['encMethod']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function LoadPGPubKey(&$pg_pubcert_SN) {
|
function LoadPGPubKey(&$pg_pubcert_SN) {
|
||||||
@ -1212,13 +1226,17 @@ class INICrypto {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function SymmEncrypt($src_data, &$enc_data, $key, $iv) {
|
function SymmEncrypt($src_data, &$enc_data, $key, $iv) {
|
||||||
$size = mcrypt_get_block_size(MCRYPT_3DES, MCRYPT_MODE_CBC);
|
if($this->encMethod == "openssl"){ //php version >= 5.3
|
||||||
$src_data = $this->pkcs5_pad($src_data, $size);
|
$enc_data = openssl_encrypt($src_data, "DES-EDE3-CBC", $key, OPENSSL_RAW_DATA, $iv);
|
||||||
$cipher = mcrypt_module_open(MCRYPT_3DES, '', MCRYPT_MODE_CBC, '');
|
} else {
|
||||||
mcrypt_generic_init($cipher, $key, $iv);
|
$size = mcrypt_get_block_size(MCRYPT_3DES, MCRYPT_MODE_CBC);
|
||||||
$enc_data = mcrypt_generic($cipher, $src_data);
|
$src_data = $this->pkcs5_pad($src_data, $size);
|
||||||
mcrypt_generic_deinit($cipher);
|
$cipher = mcrypt_module_open(MCRYPT_3DES, '', MCRYPT_MODE_CBC, '');
|
||||||
mcrypt_module_close($cipher);
|
mcrypt_generic_init($cipher, $key, $iv);
|
||||||
|
$enc_data = mcrypt_generic($cipher, $src_data);
|
||||||
|
mcrypt_generic_deinit($cipher);
|
||||||
|
mcrypt_module_close($cipher);
|
||||||
|
}
|
||||||
|
|
||||||
if (!$enc_data)
|
if (!$enc_data)
|
||||||
return ENC_FINAL_ERR;
|
return ENC_FINAL_ERR;
|
||||||
@ -1228,11 +1246,15 @@ class INICrypto {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function SymmDecrypt($enc_data, &$dec_data, $key, $iv) {
|
function SymmDecrypt($enc_data, &$dec_data, $key, $iv) {
|
||||||
$cipher = mcrypt_module_open(MCRYPT_3DES, '', MCRYPT_MODE_CBC, '');
|
if($this->encMethod == "openssl"){
|
||||||
mcrypt_generic_init($cipher, $key, $iv);
|
$dec_data = openssl_decrypt($enc_data, "DES-EDE3-CBC", $key, OPENSSL_RAW_DATA, $iv);
|
||||||
$dec_data = mdecrypt_generic($cipher, $enc_data);
|
} else {
|
||||||
mcrypt_generic_deinit($cipher);
|
$cipher = mcrypt_module_open(MCRYPT_3DES, '', MCRYPT_MODE_CBC, '');
|
||||||
mcrypt_module_close($cipher);
|
mcrypt_generic_init($cipher, $key, $iv);
|
||||||
|
$dec_data = mdecrypt_generic($cipher, $enc_data);
|
||||||
|
mcrypt_generic_deinit($cipher);
|
||||||
|
mcrypt_module_close($cipher);
|
||||||
|
}
|
||||||
|
|
||||||
if (!$dec_data)
|
if (!$dec_data)
|
||||||
return false;
|
return false;
|
||||||
@ -1275,7 +1297,7 @@ class INICrypto {
|
|||||||
$chr = $string{$i};
|
$chr = $string{$i};
|
||||||
$ord = ord($chr);
|
$ord = ord($chr);
|
||||||
if ($ord < 10)
|
if ($ord < 10)
|
||||||
$string{$i} = "";
|
$string{$i} = " ";
|
||||||
else
|
else
|
||||||
$string{$i} = $chr;
|
$string{$i} = $chr;
|
||||||
}
|
}
|
||||||
@ -1336,4 +1358,3 @@ class INICrypto {
|
|||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@ -65,6 +65,7 @@
|
|||||||
* @note 2012.07.09 PHP ini 파일 error display setting 추가
|
* @note 2012.07.09 PHP ini 파일 error display setting 추가
|
||||||
* @buildno 5036
|
* @buildno 5036
|
||||||
* @note 2014.12.09 add gather parameter tid, type
|
* @note 2014.12.09 add gather parameter tid, type
|
||||||
|
* @note 20151113 주문번호 거래조회 추가
|
||||||
*/
|
*/
|
||||||
ini_set('error_reporting', E_ALL ^ E_NOTICE);
|
ini_set('error_reporting', E_ALL ^ E_NOTICE);
|
||||||
ini_set('display_errors', 'Off');
|
ini_set('display_errors', 'Off');
|
||||||
@ -72,8 +73,8 @@ ini_set('display_errors', 'Off');
|
|||||||
/* GLOBAL */
|
/* GLOBAL */
|
||||||
define("PROGRAM", "INIPHP");
|
define("PROGRAM", "INIPHP");
|
||||||
define("LANG", "PHP");
|
define("LANG", "PHP");
|
||||||
define("VERSION", "5036");
|
define("VERSION", "NV5053");
|
||||||
define("BUILDDATE", "141209");
|
define("BUILDDATE", "20190404");
|
||||||
define("TID_LEN", 40);
|
define("TID_LEN", 40);
|
||||||
define("MAX_KEY_LEN", 24);
|
define("MAX_KEY_LEN", 24);
|
||||||
define("MAX_IV_LEN", 8);
|
define("MAX_IV_LEN", 8);
|
||||||
@ -93,15 +94,15 @@ define("INFO", 5);
|
|||||||
define("DEBUG", 7);
|
define("DEBUG", 7);
|
||||||
|
|
||||||
/* SERVER INFO */
|
/* SERVER INFO */
|
||||||
define("PG_HOST", "pg.inicis.com");
|
define("PG_HOST", "formpg.inicis.com");
|
||||||
define("DRPG_HOST", "drpg.inicis.com");
|
|
||||||
define("PG_IP", "203.238.37.3");
|
define("PG_IP", "203.238.37.3");
|
||||||
define("DRPG_IP", "211.219.96.180");
|
define("KSPG_IP", "39.115.212.10");
|
||||||
define("PG_PORT", 34049);
|
define("PG_PORT", 34049);
|
||||||
define("G_SERVER", "gthr.inicis.com");
|
define("G_SERVER", "gthr.inicis.com");
|
||||||
define("G_CGI", "/cgi-bin/g.cgi");
|
define("G_CGI", "/cgi-bin/g.cgi");
|
||||||
define("G_PORT", 80);
|
define("G_PORT", 80);
|
||||||
|
|
||||||
|
|
||||||
define("OK", "0");
|
define("OK", "0");
|
||||||
|
|
||||||
define("IV", "Initiative Tech");
|
define("IV", "Initiative Tech");
|
||||||
@ -224,7 +225,6 @@ define("TYPE_ESCROW_CNF", "confirm"); //구매확인/거절(플러그인)
|
|||||||
define("TYPE_ESCROW_DNY", "deny"); //위에서 처리됨,의미없음
|
define("TYPE_ESCROW_DNY", "deny"); //위에서 처리됨,의미없음
|
||||||
define("TYPE_ESCROW_DNY_CNF", "dcnf");
|
define("TYPE_ESCROW_DNY_CNF", "dcnf");
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------
|
//------------------------------------------------------
|
||||||
//PayMethod(서비스별, TX)
|
//PayMethod(서비스별, TX)
|
||||||
//------------------------------------------------------
|
//------------------------------------------------------
|
||||||
@ -322,6 +322,8 @@ define("TX_CANCELREASON", "CancelReason"); //2012-10-19 취소사유코드
|
|||||||
define("TX_REFUNDACCTNUM", "RefundAcctNum");
|
define("TX_REFUNDACCTNUM", "RefundAcctNum");
|
||||||
define("TX_REFUNDBANKCODE", "RefundBankCode");
|
define("TX_REFUNDBANKCODE", "RefundBankCode");
|
||||||
define("TX_REFUNDACCTNAME", "RefundAcctName");
|
define("TX_REFUNDACCTNAME", "RefundAcctName");
|
||||||
|
define("TX_REFUNDFLGREMIT", "RefundFlgRemit");
|
||||||
|
|
||||||
//PartCancelInfo
|
//PartCancelInfo
|
||||||
define("TX_PRTC_TID", "PRTC_TID");
|
define("TX_PRTC_TID", "PRTC_TID");
|
||||||
define("TX_PRTC_PRICE", "PRTC_Price");
|
define("TX_PRTC_PRICE", "PRTC_Price");
|
||||||
@ -359,6 +361,7 @@ define("TX_CSHR_SUBAPPLPRICE1", "CSHR_SubApplPrice1");
|
|||||||
define("TX_CSHR_SUBSERVICEPRICE1", "CSHR_SubServicePrice1");
|
define("TX_CSHR_SUBSERVICEPRICE1", "CSHR_SubServicePrice1");
|
||||||
//거래조회(12.04.20)
|
//거래조회(12.04.20)
|
||||||
define("TX_INQR_TID", "INQR_TID");
|
define("TX_INQR_TID", "INQR_TID");
|
||||||
|
define("TX_INQR_OID", "INQR_OID");
|
||||||
//서브몰하위가맹점등록(14.03.06)
|
//서브몰하위가맹점등록(14.03.06)
|
||||||
define("TX_OPENREG_TID", "OrgTID");
|
define("TX_OPENREG_TID", "OrgTID");
|
||||||
define("TX_OPENREG_MID", "MID");
|
define("TX_OPENREG_MID", "MID");
|
||||||
@ -492,6 +495,7 @@ define("ISP_PURCHASECODE", "ISP_PurchaseCode");
|
|||||||
define("ACCT_APPLDATE", "ACCT_ApplDate");
|
define("ACCT_APPLDATE", "ACCT_ApplDate");
|
||||||
define("ACCT_APPLTIME", "ACCT_ApplTime");
|
define("ACCT_APPLTIME", "ACCT_ApplTime");
|
||||||
define("ACCT_APPLNUM", "ACCT_ApplNum");
|
define("ACCT_APPLNUM", "ACCT_ApplNum");
|
||||||
|
|
||||||
//HPP
|
//HPP
|
||||||
define("HPP_APPLDATE", "HPP_ApplDate");
|
define("HPP_APPLDATE", "HPP_ApplDate");
|
||||||
define("HPP_APPLTIME", "HPP_ApplTime");
|
define("HPP_APPLTIME", "HPP_ApplTime");
|
||||||
|
|||||||
@ -113,6 +113,13 @@ class INIpay50 {
|
|||||||
return $this->MakeChkFake();
|
return $this->MakeChkFake();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//TID 인입 기반 거래의 경우 TID 를 기록함
|
||||||
|
$temp_request = array_change_key_case($this->m_REQUEST, CASE_LOWER);
|
||||||
|
if(isset($temp_request['tid'])){
|
||||||
|
$this->m_Log->WriteLog(INFO, "INPUT TID > ".$temp_request['tid']);
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------------- */
|
/* -------------------------------------------------- */
|
||||||
//Generate TID
|
//Generate TID
|
||||||
/* -------------------------------------------------- */
|
/* -------------------------------------------------- */
|
||||||
@ -227,70 +234,79 @@ class INIpay50 {
|
|||||||
$this->m_Log->WriteLog(INFO, "MAKE HEAD OK");
|
$this->m_Log->WriteLog(INFO, "MAKE HEAD OK");
|
||||||
//$this->m_Log->WriteLog( INFO, "MAKE HEAD OK[".$head."]" );
|
//$this->m_Log->WriteLog( INFO, "MAKE HEAD OK[".$head."]" );
|
||||||
|
|
||||||
$this->m_Log->WriteLog(INFO, "MSG_TO_PG:[" . $this->m_Data->m_sMsg . "]");
|
$this->m_Log->WriteLog(DEBUG, "MSG_TO_PG:[" . $this->m_Data->m_sMsg . "]");
|
||||||
|
|
||||||
|
|
||||||
/* -------------------------------------------------- */
|
/* -------------------------------------------------- */
|
||||||
//소켓생성
|
//소켓생성
|
||||||
/* -------------------------------------------------- */
|
/* -------------------------------------------------- */
|
||||||
//DRPG 셋팅, added 07.11.15
|
|
||||||
//취소시-PG설정 변경(도메인->IP), edited 10.09.09
|
//플러그인 에스크로 결제 구분 설정
|
||||||
if ($this->m_type == TYPE_SECUREPAY) {
|
$is_plugin_escrow = FALSE;
|
||||||
if ($this->m_REQUEST["pgn"] == "")
|
if($this->m_type == TYPE_ESCROW && ($this->m_Data->m_EscrowType == TYPE_ESCROW_CNF || $this->m_Data->m_EscrowType == TYPE_ESCROW_DNY)) $is_plugin_escrow = TRUE;
|
||||||
$host = $this->m_Data->m_PG1;
|
|
||||||
else
|
|
||||||
$host = $this->m_REQUEST["pgn"];
|
if($this->m_REQUEST["pgn"] != "") {
|
||||||
}
|
$host = $this->m_REQUEST["pgn"];
|
||||||
else {
|
} else {
|
||||||
if ($this->m_REQUEST["pgn"] == "") {
|
if ($this->m_type == TYPE_SECUREPAY || $is_plugin_escrow == TRUE) { //plugin
|
||||||
if ($this->m_cancelRC == 1)
|
$host = $this->m_Data->m_PG1;
|
||||||
$host = DRPG_IP;
|
} else if ($this->m_cancelRC == 1){ //원거래없음
|
||||||
else
|
$host = KSPG_IP;
|
||||||
$host = PG_IP;
|
} else {
|
||||||
} else
|
$host = PG_HOST;
|
||||||
$host = $this->m_REQUEST["pgn"];
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->m_Socket = new INISocket($host);
|
$this->m_Socket = new INISocket($host);
|
||||||
|
|
||||||
|
//1차 NSLOOKUP FAIL
|
||||||
if (($rtv = $this->m_Socket->DNSLookup()) != OK) {
|
if (($rtv = $this->m_Socket->DNSLookup()) != OK) {
|
||||||
$err_msg = "[" . $host . "]DNS LOOKUP 실패(MAIN)" . $this->m_Socket->getErr();
|
$err_msg = "[" . $host . "] 1차 DNS LOOKUP 실패" . $this->m_Socket->getErr();
|
||||||
$this->m_Log->WriteLog(ERROR, $err_msg);
|
$this->m_Log->WriteLog(ERROR, $err_msg);
|
||||||
$this->MakeTXErrMsg($rtv, $err_msg);
|
$this->MakeTXErrMsg($rtv, $err_msg);
|
||||||
if ($this->m_type == TYPE_SECUREPAY) { //PI일경우, PI가 내려주는 pg1ip로!
|
|
||||||
|
if ($this->m_type == TYPE_SECUREPAY || $is_plugin_escrow == TRUE) {
|
||||||
$this->m_Socket->ip = $this->m_Data->m_PG1IP;
|
$this->m_Socket->ip = $this->m_Data->m_PG1IP;
|
||||||
} else {
|
} else {
|
||||||
if ($this->m_cancelRC == 1)
|
if ($this->m_cancelRC == 1) $this->m_Socket->ip = KSPG_IP;
|
||||||
$this->m_Socket->ip = DRPG_IP;
|
else $this->m_Socket->ip = PG_IP;
|
||||||
else
|
|
||||||
$this->m_Socket->ip = PG_IP;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->m_Log->WriteLog(INFO, "DNS LOOKUP OK(" . $this->m_Socket->host . ":" . $this->m_Socket->ip . ":" . $this->m_Socket->port . ") laptime:" . $this->m_Socket->dns_laptime);
|
|
||||||
|
$this->m_Log->WriteLog(INFO, "DNS LOOKUP OK(" . $this->m_Socket->host . ", " . $this->m_Socket->ip . ":" . $this->m_Socket->port . ") laptime:" . $this->m_Socket->dns_laptime);
|
||||||
|
|
||||||
if (($rtv = $this->m_Socket->open()) != OK) {
|
if (($rtv = $this->m_Socket->open()) != OK) {
|
||||||
$this->m_Socket->close();
|
$this->m_Socket->close();
|
||||||
|
|
||||||
//PG2로 전환
|
//PG2로 전환
|
||||||
$err_msg = "[" . $host . "소켓연결오류(MAIN)::PG2로 전환";
|
$err_msg = "[" . $host."(". $this->m_Socket->ip .") 소켓연결오류(1차):: 2차 연결시도";
|
||||||
$this->m_Log->WriteLog(ERROR, $err_msg);
|
$this->m_Log->WriteLog(ERROR, $err_msg);
|
||||||
$this->MakeTXErrMsg($rtv, $err_msg);
|
$this->MakeTXErrMsg($rtv, $err_msg);
|
||||||
if ($this->m_type == TYPE_SECUREPAY) {
|
if ($this->m_type == TYPE_SECUREPAY || $is_plugin_escrow == TRUE) {
|
||||||
$host = $this->m_Data->m_PG2;
|
$host = $this->m_Data->m_PG2;
|
||||||
} else {
|
} else {
|
||||||
$host = DRPG_HOST;
|
$host = $this->m_Socket->ip == PG_IP ? KSPG_IP:PG_IP;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->m_Socket = new INISocket($host);
|
$this->m_Socket = new INISocket($host);
|
||||||
if (($rtv = $this->m_Socket->DNSLookup()) != OK) {
|
|
||||||
$err_msg = "[" . $host . "]DNS LOOKUP 실패(MAIN)" . $this->m_Socket->getErr();
|
//SECUREPAY만 2차 NSLOOKUP 진행, 이외는 IP통신
|
||||||
$this->m_Log->WriteLog(ERROR, $err_msg);
|
if ($this->m_type == TYPE_SECUREPAY || $is_plugin_escrow == TRUE) {
|
||||||
$this->MakeTXErrMsg($rtv, $err_msg);
|
if (($rtv = $this->m_Socket->DNSLookup()) != OK) {
|
||||||
if ($this->m_type == TYPE_SECUREPAY) { //PI일경우, PI가 내려주는 pg2ip로!
|
$err_msg = "[" . $host . "] 2차 DNS LOOKUP 실패" . $this->m_Socket->getErr();
|
||||||
$this->m_Socket->ip = $this->m_Data->m_PG2IP;
|
$this->m_Log->WriteLog(ERROR, $err_msg);
|
||||||
} else {
|
$this->MakeTXErrMsg($rtv, $err_msg);
|
||||||
$this->m_Socket->ip = DRPG_IP;
|
$this->m_Socket->ip = $this->m_Data->m_PG2IP;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
$this->m_Socket->ip = $host;
|
||||||
}
|
}
|
||||||
$this->m_Log->WriteLog(INFO, "DNS LOOKUP OK(" . $this->m_Socket->host . ":" . $this->m_Socket->ip . ":" . $this->m_Socket->port . ") laptime:" . $this->m_Socket->dns_laptime);
|
|
||||||
|
$this->m_Log->WriteLog(INFO, "DNS LOOKUP OK(" . $this->m_Socket->host . ", " . $this->m_Socket->ip . ":" . $this->m_Socket->port . ") laptime:" . $this->m_Socket->dns_laptime);
|
||||||
|
|
||||||
if (($rtv = $this->m_Socket->open()) != OK) {
|
if (($rtv = $this->m_Socket->open()) != OK) {
|
||||||
$err_msg = "[" . $host . "소켓연결오류(MAIN)::" . $this->m_Socket->getErr();
|
$err_msg = "[" . $host . "소켓연결오류(2차)::" . $this->m_Socket->getErr();
|
||||||
$this->m_Log->WriteLog(ERROR, $err_msg);
|
$this->m_Log->WriteLog(ERROR, $err_msg);
|
||||||
$this->MakeTXErrMsg($rtv, $err_msg);
|
$this->MakeTXErrMsg($rtv, $err_msg);
|
||||||
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
|
$this->m_Log->CloseLog($this->GetResult(NM_RESULTMSG));
|
||||||
@ -450,17 +466,6 @@ class INIpay50 {
|
|||||||
$this->m_Crypto->FreeAllKey();
|
$this->m_Crypto->FreeAllKey();
|
||||||
$this->m_Socket->close();
|
$this->m_Socket->close();
|
||||||
|
|
||||||
/* -------------------------------------------------- */
|
|
||||||
//취소실패-원거래없음시에 DRPG로 재시도
|
|
||||||
//2008.04.01
|
|
||||||
/* -------------------------------------------------- */
|
|
||||||
if ($this->GetResult(NM_RESULTCODE) == "01" && ($this->m_type == TYPE_CANCEL || $this->m_type == TYPE_INQUIRY) && $this->m_cancelRC == 0) {
|
|
||||||
if (intval($this->GetResult(NM_ERRORCODE)) > 400000 && substr($this->GetResult(NM_ERRORCODE), 3, 3) == "623") {
|
|
||||||
$this->m_cancelRC = 1;
|
|
||||||
$this->startAction();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class INISocket {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function INISocket($host) {
|
function __construct($host) {
|
||||||
$this->family = AF_INET;
|
$this->family = AF_INET;
|
||||||
$this->type = SOCK_STREAM;
|
$this->type = SOCK_STREAM;
|
||||||
$this->protocol = SOL_TCP;
|
$this->protocol = SOL_TCP;
|
||||||
@ -52,7 +52,7 @@ class INISocket {
|
|||||||
function DNSLookUP() {
|
function DNSLookUP() {
|
||||||
$starttime = GetMicroTime();
|
$starttime = GetMicroTime();
|
||||||
$ip = @gethostbyname($this->host);
|
$ip = @gethostbyname($this->host);
|
||||||
if ($ip) {
|
if ($ip == PG_IP || $ip == KSPG_IP) {
|
||||||
$this->ip = $ip;
|
$this->ip = $ip;
|
||||||
} else {
|
} else {
|
||||||
$this->error("Hostname " . $this->host . " could not be resolved");
|
$this->error("Hostname " . $this->host . " could not be resolved");
|
||||||
|
|||||||
@ -186,7 +186,7 @@ class XML {
|
|||||||
*/
|
*/
|
||||||
//modify by ddaemiri, 2007.05.28
|
//modify by ddaemiri, 2007.05.28
|
||||||
//load_file -> load_xml로 파일 및 string 으로 모두 입력받을 수 있음.
|
//load_file -> load_xml로 파일 및 string 으로 모두 입력받을 수 있음.
|
||||||
function XML($file = "") {
|
function __construct($file = "") {
|
||||||
// Check whether a file was given.
|
// Check whether a file was given.
|
||||||
if (!empty($file)) {
|
if (!empty($file)) {
|
||||||
// Load the XML file.
|
// Load the XML file.
|
||||||
@ -207,6 +207,17 @@ class XML {
|
|||||||
* @see handle_start_element(), handle_end_element(),
|
* @see handle_start_element(), handle_end_element(),
|
||||||
* handle_character_data()
|
* handle_character_data()
|
||||||
*/
|
*/
|
||||||
|
function remove_ctrl($string) {
|
||||||
|
for ($i = 0; $i < strlen($string); $i++) {
|
||||||
|
$chr = $string{$i};
|
||||||
|
$ord = ord($chr);
|
||||||
|
if ($ord < 10)
|
||||||
|
$string{$i} = " ";
|
||||||
|
else
|
||||||
|
$string{$i} = $chr;
|
||||||
|
}
|
||||||
|
return trim($string);
|
||||||
|
}
|
||||||
//modify by ddaemiri, 2007.05.28
|
//modify by ddaemiri, 2007.05.28
|
||||||
//load_file -> load_xml로 파일 및 string 으로 모두 입력받을 수 있음.
|
//load_file -> load_xml로 파일 및 string 으로 모두 입력받을 수 있음.
|
||||||
function load_xml($file, $str) {
|
function load_xml($file, $str) {
|
||||||
@ -216,7 +227,7 @@ class XML {
|
|||||||
if ($str == "")
|
if ($str == "")
|
||||||
$content = implode("", file($file));
|
$content = implode("", file($file));
|
||||||
else
|
else
|
||||||
$content = $str;
|
$content = $this->remove_ctrl($str);
|
||||||
|
|
||||||
// Check whether content has been read.
|
// Check whether content has been read.
|
||||||
if (!empty($content)) {
|
if (!empty($content)) {
|
||||||
@ -1273,7 +1284,7 @@ class XML {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Perform an axis action.
|
// Perform an axis action.
|
||||||
$contexts = call_user_method($method, $this, $axis, $context);
|
$contexts = call_user_func(array($this, $method), $axis, $context);
|
||||||
|
|
||||||
// Check whether there are predicates.
|
// Check whether there are predicates.
|
||||||
if (count($axis["predicate"]) > 0) {
|
if (count($axis["predicate"]) > 0) {
|
||||||
@ -1331,7 +1342,7 @@ class XML {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Return the result of the function.
|
// Return the result of the function.
|
||||||
return call_user_method($method, $this, $node, $arguments);
|
return call_user_func(array($this, $method), $axis, $context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3092,21 +3103,9 @@ class XML {
|
|||||||
// Read all arguments.
|
// Read all arguments.
|
||||||
$arguments = func_get_args();
|
$arguments = func_get_args();
|
||||||
|
|
||||||
// Create a new string for the inserting command.
|
//보안 이슈로 eval 함수 제거 20161011 jhkim
|
||||||
$command = "\$message = sprintf(\$message, ";
|
array_shift($arguments);
|
||||||
|
$message = vsprintf($message, $arguments);
|
||||||
// Run through the array of arguments.
|
|
||||||
for ($i = 1; $i < sizeof($arguments); $i++) {
|
|
||||||
// Add the number of the argument to the command.
|
|
||||||
$command .= "\$arguments[" . $i . "], ";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Replace the last separator.
|
|
||||||
//$command = eregi_replace(", $", ");", $command);
|
|
||||||
$command = preg_replace("/, $/i", ");", $command);
|
|
||||||
|
|
||||||
// Execute the command.
|
|
||||||
eval($command);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Display the error message.
|
// Display the error message.
|
||||||
|
|||||||
@ -54,6 +54,10 @@ $inipay = new INIpay50;
|
|||||||
$inipay->SetField("inipayhome", G5_SHOP_PATH.'/inicis'); // 이니페이 홈디렉터리(상점수정 필요)
|
$inipay->SetField("inipayhome", G5_SHOP_PATH.'/inicis'); // 이니페이 홈디렉터리(상점수정 필요)
|
||||||
$inipay->SetField("debug", "false");
|
$inipay->SetField("debug", "false");
|
||||||
|
|
||||||
|
if( ! function_exists('mcrypt_encrypt')) { // mcrypt 관련 함수가 없다면 취소시 openssl로 합니다.
|
||||||
|
$inipay->SetField("encMethod", "openssl");
|
||||||
|
}
|
||||||
|
|
||||||
$util = new INIStdPayUtil();
|
$util = new INIStdPayUtil();
|
||||||
|
|
||||||
$timestamp = $util->getTimestamp(); // util에 의해서 자동생성
|
$timestamp = $util->getTimestamp(); // util에 의해서 자동생성
|
||||||
|
|||||||
@ -20,7 +20,7 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_SKIN_URL.'/style.css">',
|
|||||||
echo '<li>';
|
echo '<li>';
|
||||||
$it_name = get_text($row['it_name']);
|
$it_name = get_text($row['it_name']);
|
||||||
// 이미지로 할 경우
|
// 이미지로 할 경우
|
||||||
$it_img = get_it_image($row[it_id], 60, 60, true);
|
$it_img = get_it_image($row['it_id'], 60, 60, true);
|
||||||
echo '<div class="prd_img">'.$it_img.'</div>';
|
echo '<div class="prd_img">'.$it_img.'</div>';
|
||||||
echo '<a href="'.G5_SHOP_URL.'/item.php?it_id='.$row['it_id'].'">'.$it_name.'</a>';
|
echo '<a href="'.G5_SHOP_URL.'/item.php?it_id='.$row['it_id'].'">'.$it_name.'</a>';
|
||||||
//echo '<a href="'.G5_SHOP_URL.'/wishlist.php">'.$it_name.'</a>';
|
//echo '<a href="'.G5_SHOP_URL.'/wishlist.php">'.$it_name.'</a>';
|
||||||
|
|||||||
@ -20,7 +20,7 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_SKIN_URL.'/style.css">',
|
|||||||
echo '<li>';
|
echo '<li>';
|
||||||
$it_name = get_text($row['it_name']);
|
$it_name = get_text($row['it_name']);
|
||||||
// 이미지로 할 경우
|
// 이미지로 할 경우
|
||||||
$it_img = get_it_image($row[it_id], 60, 60, true);
|
$it_img = get_it_image($row['it_id'], 60, 60, true);
|
||||||
echo '<div class="prd_img">'.$it_img.'</div>';
|
echo '<div class="prd_img">'.$it_img.'</div>';
|
||||||
echo '<a href="'.G5_SHOP_URL.'/item.php?it_id='.$row['it_id'].'">'.$it_name.'</a>';
|
echo '<a href="'.G5_SHOP_URL.'/item.php?it_id='.$row['it_id'].'">'.$it_name.'</a>';
|
||||||
//echo '<a href="'.G5_SHOP_URL.'/wishlist.php">'.$it_name.'</a>';
|
//echo '<a href="'.G5_SHOP_URL.'/wishlist.php">'.$it_name.'</a>';
|
||||||
|
|||||||
Reference in New Issue
Block a user