|
|
<?php
|
|
|
|
|
|
namespace WebPlugin\Pay\weixin\lib;
|
|
|
use WebPlugin\PhpLog;
|
|
|
|
|
|
/**
|
|
|
*
|
...
|
...
|
@@ -10,6 +11,10 @@ namespace WebPlugin\Pay\weixin\lib; |
|
|
*/
|
|
|
class WxPayNotify extends WxPayNotifyReply
|
|
|
{
|
|
|
// 向ERP提交订单状态有关接口调用日志和更新订单状态有关接口调用日志
|
|
|
const ORDER_STATUS_LOG = '/Data/logs/pc_pay/order_status';
|
|
|
// 日志等级,2表示记录信息等级的日志
|
|
|
const LOG_LEVEL = 2;
|
|
|
|
|
|
/**
|
|
|
*
|
...
|
...
|
@@ -18,15 +23,22 @@ class WxPayNotify extends WxPayNotifyReply |
|
|
*/
|
|
|
final public function Handle($needSign = true)
|
|
|
{
|
|
|
// 初始化日志
|
|
|
$log = new PhpLog(self::ORDER_STATUS_LOG, 'PRC', self::LOG_LEVEL);
|
|
|
$log->LogInfo('begin WxPayNotify->Handle');
|
|
|
|
|
|
$msg = "OK";
|
|
|
//当返回false的时候,表示notify中调用NotifyCallBack回调失败获取签名校验失败,此时直接回复失败
|
|
|
$result = WxpayApi::notify(array($this, 'NotifyCallBack'), $msg);
|
|
|
$log->LogInfo(var_export($result, true));
|
|
|
if ($result == false) {
|
|
|
$log->LogInfo('===微信扫码支付Handle失败===');
|
|
|
$this->SetReturn_code("FAIL");
|
|
|
$this->SetReturn_msg($msg);
|
|
|
$this->ReplyNotify(false);
|
|
|
return;
|
|
|
} else {
|
|
|
$log->LogInfo('===微信扫码支付Handle成功===');
|
|
|
//该分支在成功回调到NotifyCallBack方法,处理完成之后流程
|
|
|
$this->SetReturn_code("SUCCESS");
|
|
|
$this->SetReturn_msg("OK");
|
...
|
...
|
|