First commit
This commit is contained in:
73
weixinpay/example/refundquery.php
Executable file
73
weixinpay/example/refundquery.php
Executable file
@@ -0,0 +1,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();
|
||||
Reference in New Issue
Block a user