From 3dc5c19148f4b0cee41570b5f189bfc88d7d7fbc Mon Sep 17 00:00:00 2001 From: chicpro Date: Wed, 16 Sep 2015 12:01:54 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EB=AF=BC=EA=B0=90=EC=A0=95=EB=B3=B4=20=EA=B8=B0=EB=A1=9D?= =?UTF-8?q?=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shop/kakaopay/lgcns_CNSpay.php | 4 ++++ shop/kakaopay/lgcns_KMpay.php | 29 ++++++++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/shop/kakaopay/lgcns_CNSpay.php b/shop/kakaopay/lgcns_CNSpay.php index 455e37f18..80ebbf25f 100644 --- a/shop/kakaopay/lgcns_CNSpay.php +++ b/shop/kakaopay/lgcns_CNSpay.php @@ -395,9 +395,13 @@ } public function writeLog($strLogText) { $log_string = ""; + $exclude = array('MID', 'merchantEncKey', 'merchantHashKey', 'CancelPwd'); if (is_array($strLogText)) { $log_string = "[".date("Y/m/d H:i:s")."] \r\n"; foreach (array_keys($strLogText) as $key) { + if(in_array($key, $exclude)) + continue; + $log_string = $log_string." [".$key."] => ".$strLogText[$key]."\r\n"; } } else { diff --git a/shop/kakaopay/lgcns_KMpay.php b/shop/kakaopay/lgcns_KMpay.php index 490df1b8e..534b77603 100644 --- a/shop/kakaopay/lgcns_KMpay.php +++ b/shop/kakaopay/lgcns_KMpay.php @@ -16,7 +16,7 @@ } public function setPhpVersion($version) { $this->phpVersion = $version; - } + } public function parameterEncrypt($key, $plainText) { try { $encryptText = ""; @@ -141,6 +141,9 @@ if (is_array($strLogText)) { $log_string = "[".date("Y/m/d H:i:s")."] \r\n"; foreach (array_keys($strLogText) as $key) { + if($key == 'MERCHANT_ID') + continue; + $log_string = $log_string." [".$key."] => ".$strLogText[$key]."\r\n"; } } else { @@ -243,7 +246,7 @@ fclose($log_file); } } - + class KMPayDataValidator { public $resultValid = ""; public function KMPayDataValidator($value) { @@ -268,7 +271,7 @@ $amount = $this->getValueFromArray($value, "AMOUNT"); $currency = $this->getValueFromArray($value, "CURRENCY"); $returnUrl = $this->getValueFromArray($value, "RETURN_URL"); - + //추가정보 $cardMerchantNum = $this->getValueFromArray($value, "CARD_MERCHANT_NUM"); $supplyAmt = $this->getValueFromArray($value, "SUPPLY_AMT"); @@ -279,8 +282,8 @@ $certifiedFlag = $this->getValueFromArray($value, "CERTIFIED_FLAG"); $offerPeriodFlag = $this->getValueFromArray($value, "OFFER_PERIOD_FLAG"); $offerPeriod = $this->getValueFromArray($value, "OFFER_PERIOD"); - - + + if (strlen($certifiedFlag) == 0) { $certifiedFlag = "N"; } @@ -293,7 +296,7 @@ if (strlen($cancelTime) == 0) { $cancelTime = "1440"; } - + //필수 if (strlen($prType) == 0) { return "USER_ERROR_CODE,804,결제요청타입은 필수입력사항 입니다."; @@ -315,7 +318,7 @@ else if (strlen($merchantTxnNum) > 40) { return "USER_ERROR_CODE,824,가맹점 거래번호의 제한 길이가 초과 되었습니다."; } - + if (strlen($productName) == 0) { return "USER_ERROR_CODE,809,상품명은 필수입력사항 입니다."; } @@ -333,18 +336,18 @@ if (strlen($currency) == 0) { return "USER_ERROR_CODE,813,거래통화는 필수입력사항 입니다."; } - + if ($certifiedFlag == "CN") { //웹결제에서는 필수체크 안함 } else if (strlen($certifiedFlag) == 0) { return "USER_ERROR_CODE,830,결제승인결과전송URL은 필수입력사항 입니다."; } - + if (strlen($cardMerchantNum) > 0 && !is_numeric($cardMerchantNum)) { return "USER_ERROR_CODE,814,카드 가맹점 번호는 숫자형입니다."; } - + if (strlen($supplyAmt) > 0 && !is_numeric($supplyAmt)) { return "USER_ERROR_CODE,815,공급가액은 숫자형입니다."; } @@ -360,7 +363,7 @@ if (strlen($cancelTime) > 0 && !is_numeric($cancelTime)) { return "USER_ERROR_CODE,818,결제취소시간(분)은 숫자형입니다."; } - + if (strlen($fixedInt) == 0) { // 정상 } @@ -370,11 +373,11 @@ else if (!((0 <= intval($fixedInt) && intval($fixedInt) <= 24) || $fixedInt == "36")) { return "USER_ERROR_CODE,820,고정할부개월이 잘못되었습니다."; } - + if ($certifiedFlag != "N" && $certifiedFlag != "CN") { return "USER_ERROR_CODE,831,가맹점 인증 구분값은 N 혹은 CN 입니다"; } - + return ""; } }