나이스페이 주문정보 입력 오류시 결제 취소 코드 추가 및 불필요한 코드 제거

This commit is contained in:
thisgun
2024-09-04 12:55:05 +09:00
parent 3474be175d
commit 20eb993757
10 changed files with 22 additions and 25 deletions

View File

@ -4,8 +4,6 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 나이스페이 공통 설정
require_once(G5_MSHOP_PATH.'/settle_nicepay.inc.php');
if (function_exists('add_log')) add_log($_POST);
/*
****************************************************************************************
* <Authentication Result Parameter>

View File

@ -2,8 +2,6 @@
include_once('./_common.php');
include_once(G5_MSHOP_PATH.'/settle_nicepay.inc.php');
if (function_exists('add_log')) add_log($_POST);
$authResultCode = isset($_POST['AuthResultCode']) ? clean_xss_tags($_POST['AuthResultCode']) : ''; // authentication result code 0000:success
$authResultMsg = isset($_POST['AuthResultMsg']) ? clean_xss_tags($_POST['AuthResultMsg']) : ''; // authentication result message
$mid = isset($_POST['MID']) ? clean_xss_tags($_POST['MID']) : ''; // merchant id

View File

@ -698,6 +698,10 @@ if(! $result || ! (isset($exists_order['od_id']) && $od_id && $exists_order['od_
case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break;
case 'nicepay':
$cancelAmt = (int)$pg_price;
include G5_SHOP_PATH.'/nicepay/cancel_process.php';
break;
case 'KAKAOPAY':
$_REQUEST['TID'] = $tno;
$_REQUEST['Amt'] = $amount;
@ -756,6 +760,10 @@ if(!$result) {
case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break;
case 'nicepay':
$cancelAmt = (int)$pg_price;
include G5_SHOP_PATH.'/nicepay/cancel_process.php';
break;
case 'KAKAOPAY':
$_REQUEST['TID'] = $tno;
$_REQUEST['Amt'] = $amount;

View File

@ -36,8 +36,6 @@ try{
'CharSet' => 'utf-8'
);
if (function_exists('add_log')) add_log($data);
/*
****************************************************************************************
* <Cancel Request>
@ -46,9 +44,6 @@ try{
$response = nicepay_reqPost($data, "https://pg-api.nicepay.co.kr/webapi/cancel_process.jsp"); //Cancel API call
$result = json_decode($response, true);
if (function_exists('add_log')) add_log(array('1'=>1));
if (function_exists('add_log')) add_log($result, true, 'cc');
}catch(Exception $e){
$e->getMessage();

View File

@ -12,8 +12,6 @@ if (! ($default['de_pg_service'] == 'nicepay' && $orderNumber)){
die(json_encode(array('error'=>'올바른 방법으로 이용해 주십시오.')));
}
if (function_exists('add_log')) add_log($_POST, false, 'ajax');
$price = preg_replace('#[^0-9]#', '', $_POST['price']);
if (strlen($price) < 1) {

View File

@ -5,6 +5,11 @@ if($od['od_pg'] != 'nicepay') return;
include_once(G5_SHOP_PATH.'/settle_nicepay.inc.php');
if (!$escrow_numb) {
// 송장번호가 없으면 등록이 안된다.
return;
}
$mid = $default['de_nicepay_mid'];
$tid = $escrow_tno; // 거래 번호
$reqType = '03'; // 요청타입 (배송등록 03)
@ -45,8 +50,6 @@ $response = nicepay_reqPost($data, $escrowRequestURL);
$nice_result = json_decode($response, true);
if (function_exists('add_log')) add_log($nice_result, true, 'es');
// 성공이면
if (isset($nice_result['ResultCode']) && $nice_result['ResultCode'] === 'C000') {
@ -71,7 +74,4 @@ if (isset($nice_result['ResultCode']) && $nice_result['ResultCode'] === 'C000')
$resultCode = $nice_result['ResultCode']; // 결과코드 ("00"이면 지불 성공)
$resultMsg = $nice_result['ResultMsg']; // 결과내용 (지불결과에 대한 설명)
$dlv_date = $nice_result['ProcessDate'];
$dlv_time = $nice_result['ProcessTime'];
echo "에스크로배송";
exit;
$dlv_time = $nice_result['ProcessTime'];

View File

@ -4,8 +4,6 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 나이스페이 공통 설정
require_once(G5_SHOP_PATH.'/settle_nicepay.inc.php');
if (function_exists('add_log')) add_log($_POST);
/*
****************************************************************************************
* <Authentication Result Parameter>
@ -113,8 +111,6 @@ if($authResultCode === "0000"){
}
$respArr = json_decode($response, true);
if (function_exists('add_log')) add_log($respArr);
$ResultCode = nicepay_res('ResultCode', $respArr);
$ResultMsg = nicepay_res('ResultMsg', $respArr);

View File

@ -84,8 +84,6 @@ $response = nicepay_reqPost($data, "https://pg-api.nicepay.co.kr/webapi/cash_rec
$result = json_decode($response, true);
if (function_exists('add_log')) add_log($result, true, 'rr');
// 성공이면
if (isset($result['ResultCode']) && $result['ResultCode'] === '7001') {

View File

@ -652,6 +652,10 @@ if(! $result || ! (isset($exists_order['od_id']) && $od_id && $exists_order['od_
case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break;
case 'nicepay':
$cancelAmt = (int)$pg_price;
include G5_SHOP_PATH.'/nicepay/cancel_process.php';
break;
case 'KAKAOPAY':
$_REQUEST['TID'] = $tno;
$_REQUEST['Amt'] = $amount;
@ -707,6 +711,10 @@ if(!$result) {
case 'inicis':
include G5_SHOP_PATH.'/inicis/inipay_cancel.php';
break;
case 'nicepay':
$cancelAmt = (int)$pg_price;
include G5_SHOP_PATH.'/nicepay/cancel_process.php';
break;
case 'KAKAOPAY':
$_REQUEST['TID'] = $tno;
$_REQUEST['Amt'] = $amount;

View File

@ -1,8 +1,6 @@
<?php
include_once('./_common.php');
if (function_exists('add_log')) add_log($_POST, false, 'vv');
$NICEPAY_log_path = G5_DATA_PATH.'/log'; // 나이스페이 가상계좌 로그저장 경로
$NICEPAY_payLog = false; // 로그를 기록하려면 true 로 수정