/home/mjc1/public_html/nice/ajax_get_hash.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
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
session_start
();
include(
"../manage/category/Ordercommon.php");

// CHARSET 변경 : euc-kr -> utf-8
function iconv_utf8($str){    return iconv('euc-kr''utf-8'$str); }
// CHARSET 변경 : utf-8 -> euc-kr
function iconv_euckr($str){ return iconv('utf-8''euc-kr'$str); }

function 
array_utf8($info){
    
$newinfo null;
    foreach(
$info as $key => $val){
        if(
is_array($val)){
            
$ninfo null;
            foreach(
$val as $k => $v){
                
$ninfo[$k] = stripslashes(iconv_utf8($v));
            }
            
$newinfo[$key] = $ninfo;
        } else {
            
$newinfo[$key] = stripslashes(iconv_utf8($val));
        }
    }
    return 
$newinfo;
}

function 
array_euckr($info){
    
$newinfo null;
    foreach(
$info as $key => $val){
        if(
is_array($val)){
            
$ninfo null;
            foreach(
$val as $k => $v){
                
$ninfo[$k] = stripslashes(iconv_euckr($v));
            }
            
$newinfo[$key] = $ninfo;
        } else {
            
$newinfo[$key] = stripslashes(iconv_euckr($val));
        }
    }
    return 
$newinfo;
}

$_POST array_euckr($_POST);
@
extract($_POST);

$merchantKey "tw1EOlWp+7E6ezOifjEbmBfFfEuzjEex/WeQRXuqMJArF696mq4byEi+bFaiWrWNhMoHNP+RXdOupN5AvnNJmg==";
$orihash $SignData;
$hashString bin2hex(hash('sha256'$EdiDate.$MID.$Amt.$merchantKeytrue));

$sql "insert into xpay_log set
            p_type='pay_req', mid = '
$LGD_MID', oid = '$LGD_OID', amount = '$LGD_AMOUNT',
            buyer = '
$LGD_BUYER', prodinfo = '$LGD_PRODUCTINFO', timestamp = '$LGD_TIMESTAMP', pay_type= '$LGD_CUSTOM_USABLEPAY',
            lgdhash = '
$LGD_HASHDATA', hash_ori = '$hash_ori', resmsg = '', rescode = '', tid = '',
            authnum = '', res_json = '
$json'
     "
;
//mysql_query($sql);

/*$post = $_POST;
$post['SignData'] = $hashString;
$_SESSION['PAYREQ_MAP'] = $post;*/

echo "<?php xml version='1.0' encoding='utf-8'?><output>";
echo 
"<isok>Y</isok>";
echo 
"<hashori>".$orihash."</hashori>";
echo 
"<hashmd>".$hashString."</hashmd>";
echo 
"<msg>".$msg."</msg>";
echo 
"</output>";

?>