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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
|
<?php include_once("./_common2.php"); ?>
<? include("./Page/common/buy_header.php"); ?>
<? $_POST = $_REQUEST;
$sql = "select * from mBoard_order where rOrdNo = '{$_POST['rOrdNo']}' "; $res = mysql_query($sql); $info = mysql_fetch_array($res); //print_r($info);
if($info['AuthTy']=='virtual'){ // 로그를 가져와서 정보를 활용한다.. $sql = "select post_json from xpay_log where oid = '{$_POST['rOrdNo']}' and p_type = 'note_url_R' "; $res = mysql_query($sql); $log_info = mysql_fetch_array($res); $post_json = json_decode($log_info['post_json']); } else { // 로그를 가져와서 정보를 활용한다.. $sql = "select post_json from xpay_log where oid = '{$_POST['rOrdNo']}' and p_type = 'pay_res' "; $res = mysql_query($sql); $log_info = mysql_fetch_array($res); $post_json = json_decode($log_info['post_json']); } foreach($post_json as $key => $val){ $json_array[$key] = $val; }
//_pr($json_array);
//echo "<pre>";print_r($json_array);echo "</pre>";
$txtdate = ($txtdate == "") ? date("Y-m-d", time()) : $txtdate; $AuthTy = trim( $info["AuthTy"] ); //결제형태 $LGD_MID = trim( $json_array["LGD_MID"] ); //상점ID $rOrdNo = trim( $_REQUEST["rOrdNo"] ); //주문번호 $ProdNm = trim( $info["rProdNm"] ); //상품명 $rApprNo = trim( $info["rApprNo"] ); //승인번호 $rAmt = trim( $info["rAmt"] ); //거래금액 $rSuccYn = trim( $info["rSuccYn"] ); //성공여부 $rResMsg = trim( $json_array["LGD_RESPMSG"] ); //실패사유 $rApprTm = trim( $json_array["LGD_PAYDATE"] ); //승인시각 $rCardNm = trim( $info["rCardNm"] ); //카드사명 $ICHE_OUTBANKNAME = trim( $info["ICHE_OUTBANKNAME"] ); //이체계좌은행명 $ICHE_OUTACCTNO = trim( $info["ICHE_OUTACCTNO"] ); //이체계좌번호 $ICHE_OUTBANKMASTER = trim( $info["ICHE_OUTBANKMASTER"] ); //이체계좌소유주 $ICHE_AMOUNT = trim( $info["ICHE_AMOUNT"] ); //이체금액 $ES_SENDNO = trim( $json_array["ES_SENDNO"] ); //에스크로 결제코드 $CST_PLATFORM = $json_array['CST_PLATFORM'];
if($rSuccYn == "y" || $rSuccYn == "Y") {
if(substr( $rOrdNo , 0 , 6 ) !== "Direct") { if( substr( $rOrdNo , 4,1 ) == "A" ) $code = "certi_num"; if( substr( $rOrdNo , 4,1 ) == "B" ) $code = "rent_num";
$rOrdNoArr = explode("-",$rOrdNo) ; $category_code = substr( $rOrdNoArr[3] , 0 ,6 );
$certiQry = " select $code from certinumManage WHERE category_code = '$category_code' "; $certiResult = @mysql_query($certiQry); $certiRow = @mysql_fetch_array($certiResult); } }
//영수증 출력용 모듈 $configPath = $_SERVER['DOCUMENT_ROOT']."/xpay/lgdacom"; require_once($_SERVER['DOCUMENT_ROOT']."/xpay/lgdacom/XPayClient.php"); $xpay = &new XPayClient($configPath, $CST_PLATFORM); $xpay->Init_TX($LGD_MID); $mertkey = $xpay->config[$LGD_MID];
$authdata = md5($LGD_MID.$rApprNo.$mertkey); ?>
<?if($CST_PLATFORM=='test'){?> <!--<script language="JavaScript" src="http://pgweb.uplus.co.kr:7085/WEB_SERVER/js/receipt_link.js"></script>--> <script language="JavaScript" src="https://pgweb.tosspayments.com:9091/WEB_SERVER/testadmin/js/receipt_link.js"></script> <?} else {?> <script language="JavaScript" src="https://pgweb.tosspayments.com/WEB_SERVER/js/receipt_link.js"></script> <?}?> <script language=javascript> ////////////////////////////////////////////////////// // 영수증 출력은 카드결제시에만 사용하실 수 있습니다. ////////////////////////////////////////////////////// function show_receipt(){
if("<?=$rSuccYn?>"== "y" && "<?=$AuthTy?>"=="card"){ showReceiptByTID('<?=$LGD_MID?>', '<?=$rApprNo?>', '<?=$authdata?>') } else { alert("해당하는 결제내역이 없습니다"); } } </script>
<!-- 새창으로 띄우는 스크립트(주소표시줄,도구막대 전부 없애기) 시작 --> <script LANGUAGE="JavaScript"> function submitForm( siteURL ) { var win = window.open( siteURL, '_self', 'status=0,toolbar=0,scrollbars=1,resizable=1' ); document.forms.search.action = siteURL; document.forms.search.target = '_self'; document.forms.search.submit();
} // --> </script> <!-- 새창으로 띄우는 스크립트(주소표시줄,도구막대 전부 없애기) 끝 -->
<div class="wrap">
<div class="contents"> <div class="asideMenu"> <? include("./Page/buy/leftNavi.html"); ?> </div><!-- //leftNavi -->
<div class="subContents"> <h1> <img src="./img/titlebar/buynow.jpg" alt="제품바로결제"> <p> <span class="home"><a href="intro.php">Home</a></span> <span class="depth">></span> <span class="depth1">제품구매</span> <span class="depth">></span> <span class="depth2">제품바로결제</span> </p> </h1>
<div class="section"> <div class="workflow"> <h3>결제완료페이지</h3> <div class="workflowMid" style="height:590px;">
<div class="ResultContents"> <? if($AuthTy == "card") $_img = "./img/buy/Order_01_card_top.jpg"; else $_img = "./img/buy/Order_01_Process_top.jpg"; ?> <h4><img src="<?=$_img;?>" alt="결제완료"></h4>
<form name="receipt"> <input type=hidden name=sRetailer_id value="<?=$rStoreId?>"><!--상점아이디--> <input type=hidden name=approve value="<?=$rApprNo?>"><!---승인번호--> <input type=hidden name=send_no value="<?=$rOrdNo?>"><!--주문번호--> </form>
<table class="orderResult"> <caption><img src="./img/buy/Order_Tpoint_01.jpg" alt="주문정보"></caption> <tr> <th width="130"><span class="dot"></span>주문번호</th> <td width="500"><?=$rOrdNo;?></td> </tr> <tr> <th><span class="dot"></span>주문상품</th> <td>
<? if($ProdNm=='[바로결제]'){ echo $ProdNm."<td>"; } else { echo $ProdNm."<td>"; } if(substr( $rOrdNo , 0 , 6 ) !== "Direct" ){ ?> <? if($AuthTy !== "virtual" || $ES_SENDNO == ""){ ?> </td> </tr> <tr> <th><span class="dot"></span>정품번호</th> <td><?=$certiRow[0];?></td> </tr> <? } ?> <? } ?> </table>
<table class="orderResult"> <caption><img src="./img/buy/Order_Tpoint_02.jpg" alt="결제정보"></caption> <tr> <th width="130"><span class="dot"></span>승인날짜</th> <td width="185"> <? if($AuthTy == "iche"){ if($rSuccYn == "y" || $rSuccYn == "Y"){ echo $txtdate; } else { echo "<font color='red'><b>결제실패:".$rResMsg."</b></font>"; }
} else { echo $rApprTm; } ?><!-- 이체는 오늘날자 카드는 승인날짜 --> </td>
<th width="130"><span class="dot"></span>결제금액</th> <td width="185"><?=number_format($rAmt);?> 원</td> </tr>
<? if($AuthTy == "virtual"){ //가상계좌 ?> <tr> <th><span class="dot"></span>입금은행</th> <td><?=$rCardNm?></td> <th><span class="dot"></span>계좌번호</th> <td><?=$ICHE_OUTACCTNO;?></td> </tr>
<? } ?>
<? if($AuthTy == "card"){ ?> <tr> <th><span class="dot"></span>승인번호</th> <td colspan="3"> <? if($rSuccYn == "y" || $rSuccYn == "Y") echo $rApprNo; else echo "<font color='red'><b>결제실패:".$rResMsg."</b></font>"; ?> </td> </tr> <? } ?> </table> <? if($AuthTy == "virtual"){ //가상계좌 ?> <p style='line-height:30px;'>※ 가상계좌(무통장)를 선택하셨습니다. 상단의 입금은행과 계좌번호로 결제금액을 입금해주시기 바랍니다.</p> <?}?>
<table class="orderResult"> <caption><img src="./img/buy/Order_Tpoint_03.jpg" alt="구입처"></caption> <tr> <th width="130"><span class="dot"></span>상호</th> <td width="500">엠제이소프트</td> </tr> <tr> <th><span class="dot"></span>전화번호</th> <td>1566-8680</td> </tr> <tr> <th><span class="dot"></span>홈페이지주소</th> <td>http://www.mjsoft.co/</td> </tr> </table>
<p class="orderResultText"> 고객님의 신용카드 청구서에는 결제하신 '엠제이소프트' 대신 이크레디트(주)로 표기됩니다.<br /> 배송 및 취소관련 문의는 구입처로 문의해주시기 바랍니다.<br />
<? if($AuthTy == "card"){ ?>
신용카드 결제내역 조회나 영수증 재출력을 원하실 경우 <a href="javascript:show_receipt();"><b><FONT COLOR="#FF3300">[영수증출력]</FONT></b></a>를 클릭해 주세요.<br>
<? } ?>
<br />감사합니다. </p> </div><!-- ResultContents -->
</div><!-- //workflowMid --> <div class="workflowBottom"></div> </div><!-- //workflow -->
<? function getCenter_cd($VIRTUAL_CENTERCD){ if($VIRTUAL_CENTERCD == "39"){ echo "경남은행"; }else if($VIRTUAL_CENTERCD == "34"){ echo "광주은행"; }else if($VIRTUAL_CENTERCD == "04"){ echo "국민은행"; }else if($VIRTUAL_CENTERCD == "11"){ echo "농협중앙회"; }else if($VIRTUAL_CENTERCD == "31"){ echo "대구은행"; }else if($VIRTUAL_CENTERCD == "32"){ echo "부산은행"; }else if($VIRTUAL_CENTERCD == "02"){ echo "산업은행"; }else if($VIRTUAL_CENTERCD == "45"){ echo "새마을금고"; }else if($VIRTUAL_CENTERCD == "07"){ echo "수협중앙회"; }else if($VIRTUAL_CENTERCD == "48"){ echo "신용협동조합"; }else if($VIRTUAL_CENTERCD == "26"){ echo "(구)신한은행"; }else if($VIRTUAL_CENTERCD == "05"){ echo "외환은행"; }else if($VIRTUAL_CENTERCD == "20"){ echo "우리은행"; }else if($VIRTUAL_CENTERCD == "71"){ echo "우체국"; }else if($VIRTUAL_CENTERCD == "37"){ echo "전북은행"; }else if($VIRTUAL_CENTERCD == "23"){ echo "제일은행"; }else if($VIRTUAL_CENTERCD == "35"){ echo "제주은행"; }else if($VIRTUAL_CENTERCD == "21"){ echo "(구)조흥은행"; }else if($VIRTUAL_CENTERCD == "03"){ echo "중소기업은행"; }else if($VIRTUAL_CENTERCD == "81"){ echo "하나은행"; }else if($VIRTUAL_CENTERCD == "88"){ echo "신한은행"; }else if($VIRTUAL_CENTERCD == "27"){ echo "한미은행"; } } ?>
</div><!-- //section -->
</div><!-- //subContents -->
</div><!-- //contents --> </div><!-- //wrap -->
<!-- 네이버로그분석 : 전환페이지 설정 --> <script type="text/javascript" src="//wcs.naver.net/wcslog.js"> </script> <script type="text/javascript"> var _nasa={}; _nasa["cnv"] = wcs.cnv("1", "<?=number_format($rAmt);?>"); // 전환유형, 전환가치 설정해야함. 설치매뉴얼 참고 </script>
<? include("./Page/common/footer.php"); ?>
|