이니시스 pc웹 결제처리 수정
This commit is contained in:
@ -1,28 +0,0 @@
|
|||||||
<?php
|
|
||||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
|
||||||
|
|
||||||
$g5['title'] = 'KG 이니시스 결제';
|
|
||||||
$g5['body_script'] = ' onload="setPAYResult();"';
|
|
||||||
include_once(G5_PATH.'/head.sub.php');
|
|
||||||
|
|
||||||
$exclude = array();
|
|
||||||
|
|
||||||
echo '<form name="forderform" method="post" action="'.$order_action_url.'" autocomplete="off">'.PHP_EOL;
|
|
||||||
|
|
||||||
echo make_order_field($data, $exclude);
|
|
||||||
|
|
||||||
echo '</form>'.PHP_EOL;
|
|
||||||
?>
|
|
||||||
|
|
||||||
<div id="pay_working">
|
|
||||||
<span style="display:block; text-align:center;margin-top:120px"><img src="<?php echo G5_SHOP_URL; ?>/img/loading.gif" alt=""></span>
|
|
||||||
<span style="display:block; text-align:center;margin-top:10px; font-size:14px">주문완료 중입니다. 잠시만 기다려 주십시오.</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
function setPAYResult() {
|
|
||||||
setTimeout( function() {
|
|
||||||
document.forderform.submit();
|
|
||||||
}, 300);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
|
|
||||||
include_once(G5_SHOP_PATH.'/settle_inicis.inc.php');
|
|
||||||
|
|
||||||
$resultMap = get_session('resultMap');
|
|
||||||
|
|
||||||
if( strcmp('0000', $resultMap['resultCode']) == 0 ) {
|
|
||||||
//최종결제요청 결과 성공 DB처리
|
|
||||||
$tno = $resultMap['tid'];
|
|
||||||
$amount = $resultMap['TotPrice'];
|
|
||||||
$app_time = $resultMap['applDate'].$resultMap['applTime'];
|
|
||||||
$pay_method = $resultMap['payMethod'];
|
|
||||||
$pay_type = $PAY_METHOD[$pay_method];
|
|
||||||
$depositor = $resultMap['VACT_InputName'];
|
|
||||||
$commid = '';
|
|
||||||
$mobile_no = $resultMap['HPP_Num'];
|
|
||||||
$app_no = $resultMap['applNum'];
|
|
||||||
$card_name = $CARD_CODE[$resultMap['CARD_Code']];
|
|
||||||
switch($pay_type) {
|
|
||||||
case '계좌이체':
|
|
||||||
$bank_name = $BANK_CODE[$resultMap['ACCT_BankCode']];
|
|
||||||
if ($default['de_escrow_use'] == 1)
|
|
||||||
$escw_yn = 'Y';
|
|
||||||
break;
|
|
||||||
case '가상계좌':
|
|
||||||
$bankname = $BANK_CODE[$resultMap['VACT_BankCode']];
|
|
||||||
$account = $resultMap['VACT_Num'].' '.$resultMap['VACT_Name'];
|
|
||||||
$app_no = $resultMap['VACT_Num'];
|
|
||||||
if ($default['de_escrow_use'] == 1)
|
|
||||||
$escw_yn = 'Y';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
die($resultMap['resultMsg'].' 코드 : '.$resultMap['resultCode']);
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
@ -4,6 +4,8 @@ include_once(G5_SHOP_PATH.'/settle_inicis.inc.php');
|
|||||||
require_once(G5_SHOP_PATH.'/inicis/libs/HttpClient.php');
|
require_once(G5_SHOP_PATH.'/inicis/libs/HttpClient.php');
|
||||||
require_once(G5_SHOP_PATH.'/inicis/libs/json_lib.php');
|
require_once(G5_SHOP_PATH.'/inicis/libs/json_lib.php');
|
||||||
|
|
||||||
|
$inicis_pay_result = false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
//#############################
|
//#############################
|
||||||
@ -101,10 +103,8 @@ try {
|
|||||||
$data = unserialize(base64_decode($row['dt_data']));
|
$data = unserialize(base64_decode($row['dt_data']));
|
||||||
|
|
||||||
if(isset($data['pp_id']) && $data['pp_id']) {
|
if(isset($data['pp_id']) && $data['pp_id']) {
|
||||||
$order_action_url = G5_HTTPS_SHOP_URL.'/personalpayformupdate.php';
|
|
||||||
$page_return_url = G5_SHOP_URL.'/personalpayform.php?pp_id='.$data['pp_id'];
|
$page_return_url = G5_SHOP_URL.'/personalpayform.php?pp_id='.$data['pp_id'];
|
||||||
} else {
|
} else {
|
||||||
$order_action_url = G5_HTTPS_SHOP_URL.'/orderformupdate.php';
|
|
||||||
$page_return_url = G5_SHOP_URL.'/orderform.php';
|
$page_return_url = G5_SHOP_URL.'/orderform.php';
|
||||||
if($_SESSION['ss_direct'])
|
if($_SESSION['ss_direct'])
|
||||||
$page_return_url .= '?sw_direct=1';
|
$page_return_url .= '?sw_direct=1';
|
||||||
@ -118,11 +118,36 @@ try {
|
|||||||
처리중 에러 발생시 망취소를 한다.
|
처리중 에러 발생시 망취소를 한다.
|
||||||
* **************************************************************************** */
|
* **************************************************************************** */
|
||||||
|
|
||||||
// 결제결과 session에 저장
|
//최종결제요청 결과 성공 DB처리
|
||||||
set_session('resultMap', $resultMap);
|
$tno = $resultMap['tid'];
|
||||||
|
$amount = $resultMap['TotPrice'];
|
||||||
|
$app_time = $resultMap['applDate'].$resultMap['applTime'];
|
||||||
|
$pay_method = $resultMap['payMethod'];
|
||||||
|
$pay_type = $PAY_METHOD[$pay_method];
|
||||||
|
$depositor = $resultMap['VACT_InputName'];
|
||||||
|
$commid = '';
|
||||||
|
$mobile_no = $resultMap['HPP_Num'];
|
||||||
|
$app_no = $resultMap['applNum'];
|
||||||
|
$card_name = $CARD_CODE[$resultMap['CARD_Code']];
|
||||||
|
switch($pay_type) {
|
||||||
|
case '계좌이체':
|
||||||
|
$bank_name = $BANK_CODE[$resultMap['ACCT_BankCode']];
|
||||||
|
if ($default['de_escrow_use'] == 1)
|
||||||
|
$escw_yn = 'Y';
|
||||||
|
break;
|
||||||
|
case '가상계좌':
|
||||||
|
$bankname = $BANK_CODE[$resultMap['VACT_BankCode']];
|
||||||
|
$account = $resultMap['VACT_Num'].' '.$resultMap['VACT_Name'];
|
||||||
|
$app_no = $resultMap['VACT_Num'];
|
||||||
|
if ($default['de_escrow_use'] == 1)
|
||||||
|
$escw_yn = 'Y';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$inicis_pay_result = true;
|
||||||
|
|
||||||
require G5_SHOP_PATH.'/inicis/INIStdPayResult.php';
|
|
||||||
exit;
|
|
||||||
} else {
|
} else {
|
||||||
$s = '(오류코드:'.$resultMap['resultCode'].') '.$resultMap['resultMsg'];
|
$s = '(오류코드:'.$resultMap['resultCode'].') '.$resultMap['resultMsg'];
|
||||||
alert($s, $page_return_url);
|
alert($s, $page_return_url);
|
||||||
@ -178,4 +203,8 @@ try {
|
|||||||
$s = $e->getMessage() . ' (오류코드:' . $e->getCode() . ')';
|
$s = $e->getMessage() . ' (오류코드:' . $e->getCode() . ')';
|
||||||
echo $s;
|
echo $s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( !$inicis_pay_result ){
|
||||||
|
die("<br><br>결제 에러가 일어났습니다. 에러 이유는 위와 같습니다.");
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
80
shop/inicis/inistdpay_return.php
Normal file
80
shop/inicis/inistdpay_return.php
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
<?php
|
||||||
|
include_once('./_common.php');
|
||||||
|
include_once(G5_SHOP_PATH.'/settle_inicis.inc.php');
|
||||||
|
require_once(G5_SHOP_PATH.'/inicis/libs/HttpClient.php');
|
||||||
|
require_once(G5_SHOP_PATH.'/inicis/libs/json_lib.php');
|
||||||
|
|
||||||
|
@header("Progma:no-cache");
|
||||||
|
@header("Cache-Control:no-cache,must-revalidate");
|
||||||
|
|
||||||
|
$request_mid = isset($_POST['mid']) ? clean_xss_tags($_POST['mid']) : '';
|
||||||
|
|
||||||
|
if( ($request_mid != $default['de_inicis_mid']) ){
|
||||||
|
alert("요청된 mid 와 설정된 mid 가 틀립니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
$orderNumber = isset($_POST['orderNumber']) ? preg_replace("/[ #\&\+%@=\/\\\:;,\.'\"\^`~|\!\?\*$#<>()\[\]\{\}]/i", "", strip_tags($_POST['orderNumber'])) : 0;
|
||||||
|
$session_order_num = get_session('ss_order_inicis_id');
|
||||||
|
|
||||||
|
if( !$orderNumber ){
|
||||||
|
alert("주문번호가 없습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = " select * from {$g5['g5_shop_order_data_table']} where od_id = '$orderNumber' ";
|
||||||
|
$row = sql_fetch($sql);
|
||||||
|
|
||||||
|
if( empty($row) ){
|
||||||
|
alert("임시 주문정보가 저장되지 않았습니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
$data = unserialize(base64_decode($row['dt_data']));
|
||||||
|
|
||||||
|
$params = array();
|
||||||
|
$var_datas = array();
|
||||||
|
|
||||||
|
foreach($data as $key=>$value) {
|
||||||
|
if(is_array($value)) {
|
||||||
|
foreach($value as $k=>$v) {
|
||||||
|
$_POST[$key][$k] = $params[$key][$k] = clean_xss_tags(strip_tags($v));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$_POST[$key] = $params[$key] = clean_xss_tags(strip_tags($value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($data['pp_id']) && $data['pp_id']) { //개인결제
|
||||||
|
|
||||||
|
foreach($params as $key=>$value){
|
||||||
|
|
||||||
|
if( in_array($key, array('pp_name', 'pp_email', 'pp_hp', 'pp_settle_case')) ){
|
||||||
|
|
||||||
|
$var_datas[$key] = $value;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@extract($var_datas);
|
||||||
|
|
||||||
|
include_once(G5_SHOP_PATH.'/personalpayformupdate.php');
|
||||||
|
|
||||||
|
} else { //상점주문
|
||||||
|
|
||||||
|
foreach($params as $key=>$value){
|
||||||
|
|
||||||
|
if( in_array($key, array('od_price', 'od_name', 'od_tel', 'od_hp', 'od_email', 'od_memo', 'od_settle_case', 'max_temp_point', 'od_temp_point', 'od_bank_account', 'od_deposit_name', 'od_test', 'od_ip', 'od_zip', 'od_addr1', 'od_addr2', 'od_addr3', 'od_addr_jibeon', 'od_b_name', 'od_b_tel', 'od_b_hp', 'od_b_addr1', 'od_b_addr2', 'od_b_addr3', 'od_b_addr_jibeon', 'od_b_zip', 'od_send_cost', 'od_send_cost2', 'od_hope_date')) ){
|
||||||
|
|
||||||
|
$var_datas[$key] = $value;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@extract($var_datas);
|
||||||
|
|
||||||
|
$od_send_cost = (int) $_POST['od_send_cost'];
|
||||||
|
$od_send_cost2 = (int) $_POST['od_send_cost2'];
|
||||||
|
|
||||||
|
include_once(G5_SHOP_PATH.'/orderformupdate.php');
|
||||||
|
}
|
||||||
|
?>
|
||||||
@ -283,7 +283,7 @@ else if ($od_settle_case == "계좌이체")
|
|||||||
include G5_SHOP_PATH.'/lg/xpay_result.php';
|
include G5_SHOP_PATH.'/lg/xpay_result.php';
|
||||||
break;
|
break;
|
||||||
case 'inicis':
|
case 'inicis':
|
||||||
include G5_SHOP_PATH.'/inicis/inipay_result.php';
|
include G5_SHOP_PATH.'/inicis/inistdpay_result.php';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
include G5_SHOP_PATH.'/kcp/pp_ax_hub.php';
|
include G5_SHOP_PATH.'/kcp/pp_ax_hub.php';
|
||||||
@ -310,7 +310,7 @@ else if ($od_settle_case == "가상계좌")
|
|||||||
include G5_SHOP_PATH.'/lg/xpay_result.php';
|
include G5_SHOP_PATH.'/lg/xpay_result.php';
|
||||||
break;
|
break;
|
||||||
case 'inicis':
|
case 'inicis':
|
||||||
include G5_SHOP_PATH.'/inicis/inipay_result.php';
|
include G5_SHOP_PATH.'/inicis/inistdpay_result.php';
|
||||||
$od_app_no = $app_no;
|
$od_app_no = $app_no;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -335,7 +335,7 @@ else if ($od_settle_case == "휴대폰")
|
|||||||
include G5_SHOP_PATH.'/lg/xpay_result.php';
|
include G5_SHOP_PATH.'/lg/xpay_result.php';
|
||||||
break;
|
break;
|
||||||
case 'inicis':
|
case 'inicis':
|
||||||
include G5_SHOP_PATH.'/inicis/inipay_result.php';
|
include G5_SHOP_PATH.'/inicis/inistdpay_result.php';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
include G5_SHOP_PATH.'/kcp/pp_ax_hub.php';
|
include G5_SHOP_PATH.'/kcp/pp_ax_hub.php';
|
||||||
@ -359,7 +359,7 @@ else if ($od_settle_case == "신용카드")
|
|||||||
include G5_SHOP_PATH.'/lg/xpay_result.php';
|
include G5_SHOP_PATH.'/lg/xpay_result.php';
|
||||||
break;
|
break;
|
||||||
case 'inicis':
|
case 'inicis':
|
||||||
include G5_SHOP_PATH.'/inicis/inipay_result.php';
|
include G5_SHOP_PATH.'/inicis/inistdpay_result.php';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
include G5_SHOP_PATH.'/kcp/pp_ax_hub.php';
|
include G5_SHOP_PATH.'/kcp/pp_ax_hub.php';
|
||||||
@ -385,7 +385,7 @@ else if ($od_settle_case == "간편결제")
|
|||||||
include G5_SHOP_PATH.'/lg/xpay_result.php';
|
include G5_SHOP_PATH.'/lg/xpay_result.php';
|
||||||
break;
|
break;
|
||||||
case 'inicis':
|
case 'inicis':
|
||||||
include G5_SHOP_PATH.'/inicis/inipay_result.php';
|
include G5_SHOP_PATH.'/inicis/inistdpay_result.php';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
include G5_SHOP_PATH.'/kcp/pp_ax_hub.php';
|
include G5_SHOP_PATH.'/kcp/pp_ax_hub.php';
|
||||||
|
|||||||
@ -27,7 +27,7 @@ if ($pp_settle_case == "계좌이체")
|
|||||||
include G5_SHOP_PATH.'/lg/xpay_result.php';
|
include G5_SHOP_PATH.'/lg/xpay_result.php';
|
||||||
break;
|
break;
|
||||||
case 'inicis':
|
case 'inicis':
|
||||||
include G5_SHOP_PATH.'/inicis/inipay_result.php';
|
include G5_SHOP_PATH.'/inicis/inistdpay_result.php';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
include G5_SHOP_PATH.'/kcp/pp_ax_hub.php';
|
include G5_SHOP_PATH.'/kcp/pp_ax_hub.php';
|
||||||
@ -49,7 +49,7 @@ else if ($pp_settle_case == "가상계좌")
|
|||||||
include G5_SHOP_PATH.'/lg/xpay_result.php';
|
include G5_SHOP_PATH.'/lg/xpay_result.php';
|
||||||
break;
|
break;
|
||||||
case 'inicis':
|
case 'inicis':
|
||||||
include G5_SHOP_PATH.'/inicis/inipay_result.php';
|
include G5_SHOP_PATH.'/inicis/inistdpay_result.php';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
include G5_SHOP_PATH.'/kcp/pp_ax_hub.php';
|
include G5_SHOP_PATH.'/kcp/pp_ax_hub.php';
|
||||||
@ -71,7 +71,7 @@ else if ($pp_settle_case == "휴대폰")
|
|||||||
include G5_SHOP_PATH.'/lg/xpay_result.php';
|
include G5_SHOP_PATH.'/lg/xpay_result.php';
|
||||||
break;
|
break;
|
||||||
case 'inicis':
|
case 'inicis':
|
||||||
include G5_SHOP_PATH.'/inicis/inipay_result.php';
|
include G5_SHOP_PATH.'/inicis/inistdpay_result.php';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
include G5_SHOP_PATH.'/kcp/pp_ax_hub.php';
|
include G5_SHOP_PATH.'/kcp/pp_ax_hub.php';
|
||||||
@ -91,7 +91,7 @@ else if ($pp_settle_case == "신용카드")
|
|||||||
include G5_SHOP_PATH.'/lg/xpay_result.php';
|
include G5_SHOP_PATH.'/lg/xpay_result.php';
|
||||||
break;
|
break;
|
||||||
case 'inicis':
|
case 'inicis':
|
||||||
include G5_SHOP_PATH.'/inicis/inipay_result.php';
|
include G5_SHOP_PATH.'/inicis/inistdpay_result.php';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
include G5_SHOP_PATH.'/kcp/pp_ax_hub.php';
|
include G5_SHOP_PATH.'/kcp/pp_ax_hub.php';
|
||||||
|
|||||||
@ -35,7 +35,7 @@ else {
|
|||||||
/**************************
|
/**************************
|
||||||
* 1. 라이브러리 인클루드 *
|
* 1. 라이브러리 인클루드 *
|
||||||
**************************/
|
**************************/
|
||||||
require(G5_SHOP_PATH.'/inicis/libs/INILib.php');
|
require_once(G5_SHOP_PATH.'/inicis/libs/INILib.php');
|
||||||
require_once(G5_SHOP_PATH.'/inicis/libs/INIStdPayUtil.php');
|
require_once(G5_SHOP_PATH.'/inicis/libs/INIStdPayUtil.php');
|
||||||
require_once(G5_SHOP_PATH.'/inicis/libs/sha256.inc.php');
|
require_once(G5_SHOP_PATH.'/inicis/libs/sha256.inc.php');
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ $siteDomain = G5_SHOP_URL.'/inicis'; //가맹점 도메인 입력
|
|||||||
// Ex) returnURL이 http://localhost:8082/demo/INIpayStdSample/INIStdPayReturn.php 라면
|
// Ex) returnURL이 http://localhost:8082/demo/INIpayStdSample/INIStdPayReturn.php 라면
|
||||||
// http://localhost:8082/demo/INIpayStdSample 까지만 기입한다.
|
// http://localhost:8082/demo/INIpayStdSample 까지만 기입한다.
|
||||||
|
|
||||||
$returnUrl = $siteDomain.'/INIStdPayReturn.php';
|
$returnUrl = $siteDomain.'/inistdpay_return.php';
|
||||||
$closeUrl = $siteDomain.'/close.php';
|
$closeUrl = $siteDomain.'/close.php';
|
||||||
$popupUrl = $siteDomain.'/popup.php';
|
$popupUrl = $siteDomain.'/popup.php';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user