First commit
This commit is contained in:
53
weixinpay/example/notify.php
Executable file
53
weixinpay/example/notify.php
Executable file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
ini_set('date.timezone','Asia/Shanghai');
|
||||
|
||||
error_reporting(E_ERROR);
|
||||
|
||||
|
||||
|
||||
require_once "../lib/WxPay.Api.php";
|
||||
|
||||
require_once '../lib/WxPay.Notify.php';
|
||||
|
||||
require_once 'log.php';
|
||||
|
||||
|
||||
|
||||
//初始化日志
|
||||
|
||||
$logHandler= new CLogFileHandler("../logs/".date('Y-m-d').'.log');
|
||||
|
||||
$log = Log::Init($logHandler, 15);
|
||||
|
||||
|
||||
|
||||
class PayNotifyCallBack extends WxPayNotify
|
||||
|
||||
{
|
||||
|
||||
//查询订单
|
||||
|
||||
public function Queryorder($transaction_id)
|
||||
|
||||
{
|
||||
|
||||
$input = new WxPayOrderQuery();
|
||||
|
||||
$input->SetTransaction_id($transaction_id);
|
||||
|
||||
$result = WxPayApi::orderQuery($input);
|
||||
|
||||
Log::DEBUG("query:" . json_encode($result));
|
||||
|
||||
if(array_key_exists("return_code", $result)
|
||||
|
||||
&& array_key_exists("result_code", $result)
|
||||
|
||||
&& $result["return_code"] == "SUCCESS"
|
||||
|
||||
&& $result["result_code"] == "SUCCESS")
|
||||
|
||||
{
|
||||
|
||||
return true;
|
||||
Reference in New Issue
Block a user