Skip to content

Commit

Permalink
나이스페이 주문정보 입력 오류시 결제 취소 코드 추가 및 불필요한 코드 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
thisgun committed Sep 4, 2024
1 parent 3474be1 commit 20eb993
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 25 deletions.
2 changes: 0 additions & 2 deletions mobile/shop/nicepay/nicepay_result.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
// 나이스페이 공통 설정
require_once(G5_MSHOP_PATH.'/settle_nicepay.inc.php');

if (function_exists('add_log')) add_log($_POST);

/*
****************************************************************************************
* <Authentication Result Parameter>
Expand Down
2 changes: 0 additions & 2 deletions mobile/shop/nicepay/return_url_result.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions mobile/shop/orderformupdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,10 @@
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;
Expand Down Expand Up @@ -756,6 +760,10 @@
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;
Expand Down
5 changes: 0 additions & 5 deletions shop/nicepay/cancel_process.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
'CharSet' => 'utf-8'
);

if (function_exists('add_log')) add_log($data);

/*
****************************************************************************************
* <Cancel Request>
Expand All @@ -46,9 +44,6 @@
$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();
Expand Down
2 changes: 0 additions & 2 deletions shop/nicepay/createsigndata.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
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) {
Expand Down
12 changes: 6 additions & 6 deletions shop/nicepay/escrow.register.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

include_once(G5_SHOP_PATH.'/settle_nicepay.inc.php');

if (!$escrow_numb) {
// 송장번호가 없으면 등록이 안된다.
return;
}

$mid = $default['de_nicepay_mid'];
$tid = $escrow_tno; // 거래 번호
$reqType = '03'; // 요청타입 (배송등록 03)
Expand Down Expand Up @@ -45,8 +50,6 @@

$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') {

Expand All @@ -71,7 +74,4 @@
$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'];
4 changes: 0 additions & 4 deletions shop/nicepay/nicepay_result.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
// 나이스페이 공통 설정
require_once(G5_SHOP_PATH.'/settle_nicepay.inc.php');

if (function_exists('add_log')) add_log($_POST);

/*
****************************************************************************************
* <Authentication Result Parameter>
Expand Down Expand Up @@ -113,8 +111,6 @@ function nicepay_res($key, $data, $default_val='') {
}

$respArr = json_decode($response, true);

if (function_exists('add_log')) add_log($respArr);

$ResultCode = nicepay_res('ResultCode', $respArr);
$ResultMsg = nicepay_res('ResultMsg', $respArr);
Expand Down
2 changes: 0 additions & 2 deletions shop/nicepay/taxsave_result.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@

$result = json_decode($response, true);

if (function_exists('add_log')) add_log($result, true, 'rr');

// 성공이면
if (isset($result['ResultCode']) && $result['ResultCode'] === '7001') {

Expand Down
8 changes: 8 additions & 0 deletions shop/orderformupdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,10 @@
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;
Expand Down Expand Up @@ -707,6 +711,10 @@
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;
Expand Down
2 changes: 0 additions & 2 deletions shop/settle_nicepay_common.php
Original file line number Diff line number Diff line change
@@ -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 로 수정

Expand Down

0 comments on commit 20eb993

Please sign in to comment.