refundquery.php
2.8 KB
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
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>微信支付样例-查退款单</title>
</head>
<?php
ini_set('date.timezone','Asia/Shanghai');
error_reporting(E_ERROR);
require_once "../lib/WxPay.Api.php";
require_once 'log.php';
//初始化日志
$logHandler= new CLogFileHandler("../logs/".date('Y-m-d').'.log');
$log = Log::Init($logHandler, 15);
function printf_info($data)
{
foreach($data as $key=>$value){
echo "<font color='#f00;'>$key</font> : $value <br/>";
}
}
if(isset($_REQUEST["transaction_id"]) && $_REQUEST["transaction_id"] != ""){
$transaction_id = $_REQUEST["transaction_id"];
$input = new WxPayRefundQuery();
$input->SetTransaction_id($transaction_id);
printf_info(WxPayApi::refundQuery($input));
}
if(isset($_REQUEST["out_trade_no"]) && $_REQUEST["out_trade_no"] != ""){
$out_trade_no = $_REQUEST["out_trade_no"];
$input = new WxPayRefundQuery();
$input->SetOut_trade_no($out_trade_no);
printf_info(WxPayApi::refundQuery($input));
exit();
}
if(isset($_REQUEST["out_refund_no"]) && $_REQUEST["out_refund_no"] != ""){
$out_refund_no = $_REQUEST["out_refund_no"];
$input = new WxPayRefundQuery();
$input->SetOut_refund_no($out_refund_no);
printf_info(WxPayApi::refundQuery($input));
exit();
}
if(isset($_REQUEST["refund_id"]) && $_REQUEST["refund_id"] != ""){
$refund_id = $_REQUEST["refund_id"];
$input = new WxPayRefundQuery();
$input->SetRefund_id($refund_id);
printf_info(WxPayApi::refundQuery($input));
exit();
}
?>
<body>
<form action="#" method="post">
<div style="margin-left:2%;color:#f00">微信订单号、商户订单号、微信订单号、微信退款单号选填至少一个,微信退款单号优先:</div><br/>
<div style="margin-left:2%;">微信订单号:</div><br/>
<input type="text" style="width:96%;height:35px;margin-left:2%;" name="transaction_id" /><br /><br />
<div style="margin-left:2%;">商户订单号:</div><br/>
<input type="text" style="width:96%;height:35px;margin-left:2%;" name="out_trade_no" /><br /><br />
<div style="margin-left:2%;">商户退款单号:</div><br/>
<input type="text" style="width:96%;height:35px;margin-left:2%;" name="out_refund_no" /><br /><br />
<div style="margin-left:2%;">微信退款单号:</div><br/>
<input type="text" style="width:96%;height:35px;margin-left:2%;" name="refund_id" /><br /><br />
<div align="center">
<input type="submit" value="查询" style="width:210px; height:50px; border-radius: 15px;background-color:#FE6714; border:0px #FE6714 solid; cursor: pointer; color:white; font-size:16px;" type="button" onclick="callpay()" />
</div>
</form>
</body>
</html>