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
69
70
|
<?php include("category/common.php"); include("./escrow_write.php");
// LG유플러스에서 받은 value $txtype = ""; // 결과구분(C=수령확인결과, R=구매취소요청, D=구매취소결과, N=NC처리결과 ) $mid=""; // 상점아이디 $tid=""; // LG유플러스에서 부여한 거래번호 $oid=""; // 상품번호 $ssn = ""; // 구매자주민번호 $ip = ""; // 구매자IP $mac = ""; // 구매자 mac $hashdata = ""; // LG유플러스 인증 데이터 $productid = ""; // 상품정보키 $resdate = ""; // 구매확인 요청일시 $resp = false; // 결과연동 성공여부
$txtype = get_param("txtype"); $mid = get_param("mid"); $tid = get_param("tid"); $oid = get_param("oid"); $ssn = get_param("ssn"); $ip = get_param("ip"); $mac = get_param("mac"); $hashdata = get_param("hashdata"); $productid = get_param("productid"); $resdate = get_param("resdate");
$mertkey = "8bf2cd526fe19625a9e627d0b1f13128"; //LG유플러스에서 발급한 상점키로 변경해 주시기 바랍니다.
$hashdata2 = md5($mid.$oid.$tid.$txtype.$productid.$ssn.$ip.$mac.$resdate.$mertkey); //
$reg_datetime = date("Y-m-d H:i:s",time());
$value = array( "txtype" => $txtype, "mid" => $mid, "tid" => $tid, "oid" => $oid, "ssn" => $ssn, "ip" => $ip, "mac" => $mac, "resdate" => $resdate, "hashdata" => $hashdata, "productid" => $productid, "reg_datetime" => $reg_datetime, "hashdata2" => $hashdata2 );
if ($hashdata2 == $hashdata) { //해쉬값 검증이 성공하면 $resp = write_success($value); } else { //해쉬값 검증이 실패이면 write_hasherr($value); }
$sql = "insert into mBoard_order_escow_res set oid = '{$oid}', txtype = '{$txtype}', mid = '{$mid}', tid = '{$tid}', ssn = '{$ssn}', ips = '{$ip}', mac = '{$mac}', hashdata = '{$hashdata}', productid = '{$productid}', resdate = '{$resdate}', resp = '{$resp}', hashdata2 = '{$hashdata2}', mertkey = '{$mertkey}' "; //echo $sql; mysql_query($sql);
if($resp){ //결과연동이 성공이면 echo "OK"; }else{ //결과연동이 실패이면 echo "FAIL"; //print_r($value); }
?>
|