/home/mjc1/public_html/plugin/nicepay/lib/nicepay/validator/MerchantMessageDataValidator.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php

/**
 * 
 * @author kblee
 *
 */
class MerchantMessageDataValidator{
    
    
/**
     * 
     */
    
public function MerchantMessageDataValidator(){
        
    }
    
    
/**
     * 
     * @param $mdto
     */
    
public function validate($mdto){
        
// MID
        
if($mdto->getParameter(MID) == null || $mdto->getParameter(MID) == ""){
            if(
LogMode::isAppLogable()) {
                
$logJournal NicePayLogJournal::getInstance();
                
$logJournal->errorAppLog("MID ¹Ì¼³Á¤ ¿À·ùÀÔ´Ï´Ù.");
            }
            throw new 
ServiceException("V201","»óÁ¡ID ¹Ì¼³Á¤ ¿À·ùÀÔ´Ï´Ù.");
        }
        
        
// LicenseKey 
        
if($mdto->getParameter(MERCHANT_KEY) == null || $mdto->getParameter(MERCHANT_KEY) == ""){
            if(
LogMode::isAppLogable()){
                
$logJournal NicePayLogJournal::getInstance();
                
$logJournal->errorAppLog("LicenseKey ¹Ì¼³Á¤ ¿À·ùÀÔ´Ï´Ù.");
            }
            throw new 
ServiceException("V202","LicenseKey ¹Ì¼³Á¤ ¿À·ùÀÔ´Ï´Ù.");
        }
        
        
// MallIP
        /*
        if($mdto->getParameter(MALL_IP) == null || $mdto->getParameter(MALL_IP) == ""){
            if(LogMode::isAppLogable()){
                $logJournal = NicePayLogJournal::getInstance();
                $logJournal->errorAppLog("MallIP ¹Ì¼³Á¤ ¿À·ùÀÔ´Ï´Ù.");
            }
            throw new ServiceException("V205","MallIP ¹Ì¼³Á¤ ¿À·ùÀÔ´Ï´Ù.");
        }
        */
        
    
}
}
?>