/home/mjc1/public_html/plugin/nicepay/lib/nicepay/validator/CommonMessageValidator.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
54
55
<?php
/**
 * 
 * @author kblee
 *
 */
class CommonMessageValidator{
    
    
/**
     * 
     */
    
public function CommonMessageValidator(){
        
    }
    
    
/**
     * 
     * @param $mdto
     */
    
public function validate($mdto){
    
        
// ¾Ïȣȭ Ç÷¡±× ¼³Á¤ Ã¼Å©
        
if($mdto->getParameter(ENC_FLAG) == null || $mdto->getParameter(ENC_FLAG) == ""){
            if(
LogMode::isAppLogable()){
                
$logJournal NicePayLogJournal::getInstance();
                
$logJournal->errorAppLog("¾Ïȣȭ Ç÷¡±×°¡ ¼³Á¤µÇÁö ¾Ê¾Ò½À´Ï´Ù. N ¶Ç´Â S·Î ¼³Á¤µÇ¾î¾ß ÇÕ´Ï´Ù.");
            }
            throw new 
ServiceException("V101","¾Ïȣȭ Ç÷¡±× ¹Ì¼³Á¤ ¿À·ùÀÔ´Ï´Ù.");
        }
        
        
// ¼­ºñ½º±¸ºÐüũ
        
if($mdto->getParameter(SERVICE_MODE) == null || $mdto->getParameter(SERVICE_MODE) == ""){
            if(
LogMode::isAppLogable()){
                
$logJournal NicePayLogJournal::getInstance();
                
$logJournal->errorAppLog("¼­ºñ½º¸ðµå°¡ ¼³Á¤µÇÁö ¾Ê¾Ò½À´Ï´Ù.");
            }
            throw new 
ServiceException("V102","¼­ºñ½º¸ðµå¸¦ ¼³Á¤ÇÏÁö ¾Ê¾Ò½À´Ï´Ù.");
        }
        
        
// ¼­ºñ½º±¸ºÐ¿¡ µû¸¥ ÁöºÒ¼ö´Ü Ã¼Å©
        
if(PAY_SERVICE_CODE == $mdto->getParameter(SERVICE_MODE)){
            if(
$mdto->getParameter(PAY_METHOD) == null || $mdto->getParameter(PAY_METHOD) == ""){
                if(
LogMode::isAppLogable()){
                    
$logJournal NicePayLogJournal::getInstance();
                    
$logJournal->errorAppLog("ÁöºÒ¼ö´ÜÀÌ ¼³Á¤µÇÁö ¾Ê¾Ò½À´Ï´Ù. °áÁ¦½ÂÀΠ¼­ºñ½ºÀÏ °æ¿ì BANK, CARD, VBANK, CELLPHONE ÀÌ Áß Çϳª¸¦ ¼³Á¤ÇؾߠÇÕ´Ï´Ù.");
                }
                throw new 
ServiceException("V103","ÁöºÒ¼ö´ÜÀ» ¼³Á¤ÇÏÁö ¾Ê¾Ò½À´Ï´Ù.");
            }
        }
        
        
    }
}

?>