session_start(); include $_SERVER[DOCUMENT_ROOT] . "/common/conf/config.inc.php"; include $_SERVER[DOCUMENT_ROOT] . "/module/category/category.lib.php"; include $_SERVER[DOCUMENT_ROOT] . "/module/shop/shop.lib.php"; include $_SERVER[DOCUMENT_ROOT] . "/module/mail/mail.lib.php"; include $_SERVER[DOCUMENT_ROOT] . "/module/point/point.lib.php"; if (function_exists("mb_http_input")) mb_http_input("utf-8"); if (function_exists("mb_http_output")) mb_http_output("utf-8"); ?> include "./KSPayWebHost.inc.php"; ?> $rcid = $_POST["reWHCid"]; $rctype = $_POST["reWHCtype"]; $rhash = $_POST["reWHHash"]; $ipg = new KSPayWebHost($rcid, null); $authyn = ""; $trno = ""; $trddt = ""; $trdtm = ""; $amt = ""; $authno = ""; $msg1 = ""; $msg2 = ""; $ordno = ""; $isscd = ""; $aqucd = ""; $temp_v = ""; $result = ""; $halbu = ""; $cbtrno = ""; $cbauthno = ""; $resultcd = ""; //업체에서 추가하신 인자값을 받는 부분입니다 $a = $_POST["a"]; $b = $_POST["b"]; $c = $_POST["c"]; $d = $_POST["d"]; if ($ipg->kspay_send_msg("1")) { $authyn = $ipg->kspay_get_value("authyn"); $trno = $ipg->kspay_get_value("trno" ); $trddt = $ipg->kspay_get_value("trddt" ); $trdtm = $ipg->kspay_get_value("trdtm" ); $amt = $ipg->kspay_get_value("amt" ); $authno = $ipg->kspay_get_value("authno"); $msg1 = $ipg->kspay_get_value("msg1" ); $msg2 = $ipg->kspay_get_value("msg2" ); $ordno = $ipg->kspay_get_value("ordno" ); $isscd = $ipg->kspay_get_value("isscd" ); $aqucd = $ipg->kspay_get_value("aqucd" ); $temp_v = ""; $result = $ipg->kspay_get_value("result"); $halbu = $ipg->kspay_get_value("halbu"); $cbtrno = $ipg->kspay_get_value("cbtrno"); $cbauthno = $ipg->kspay_get_value("cbauthno"); if (!empty($msg1)) $msg1 = iconv("EUC-KR","UTF-8", $msg1); if (!empty($msg2)) $msg2 = iconv("EUC-KR","UTF-8", $msg2); if (!empty($authyn) && 1 == strlen($authyn)) { if ($authyn == "O") { $resultcd = "0000"; }else { $resultcd = trim($authno); } //$ipg->kspay_send_msg("3"); // 정상처리가 완료되었을 경우 호출합니다.(이 과정이 없으면 일시적으로 kspay_send_msg("1")을 호출하여 거래내역 조회가 가능합니다.) //DB연결 $dblink = SetConn($_conf_db["main_db"]); //회원의 경우 회원아이디로 로그인 전이라면 세션 아이디로 if($_SESSION[$_SITE["DOMAIN"]]["MEMBER"]["ID"]){ $tp = "1"; }else{ $tp = "2"; } $arrList = getPreOrderList($_SESSION[$_SITE["DOMAIN"]]["SESSIONID"], $_SESSION[$_SITE["DOMAIN"]]["MEMBER"]["ID"],$tp); //_POST 로 받는 주문번호가 기존에 주문된 주문번호인지 확인 if(checkVaildOrderNo(mysql_escape_string($ordno))==true){ jsMsg("이미 주문이 완료되었습니다."); } //_POST 로 받은 주문번호가 구매직전 장바구니에 있는지 확인 if($ordno != $arrList["list"][0]["order_no"]){ jsMsg("잘못된 주문 정보 입니다. 주문 장바구니에 해당 주문건이 없습니다."); } if(substr($result,0,1) == "6") { $ordergb = "1"; } else { $ordergb = "6"; } //주문정보 입력 $blnRS = setOrderInfo($_SESSION[$_SITE["DOMAIN"]]["SESSIONID"], $_SESSION[$_SITE["DOMAIN"]]["MEMBER"]["ID"], $tp, $arrList["list"][0]["order_no"], $ordergb); if($blnRS==true){ //KCP 결제후 DB 입력처리 완료 변수 설정 $bSucc = "true"; //주문자에게 메일발송 $arrInfo = getOrderInfo($_SESSION[$_SITE["DOMAIN"]]["MEMBER"]["ID"], $tp, mysql_escape_string($_REQUEST["order_no"])); $arrMailInfo = getMailConfig($ordergb); //sendMailShopInfo($arrInfo, $arrMailInfo); //주문자에게 메일발송 } //DB해제 SetDisConn($dblink); } } ?>