Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Rock Zhang
9 years ago
Commit
8b785638603764f9b3cc930a3b22a24c99c4a6ad
1 parent
8f019b4b
修复微信扫码支付中类大小写导致错误的bug
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletions
library/WebPlugin/Pay/weixin/lib/WxPayApi.php
library/WebPlugin/Pay/weixin/lib/WxPayNotify.php
library/WebPlugin/Pay/weixin/lib/WxPayResults.php
library/WebPlugin/Pay/weixin/lib/WxPayApi.php
View file @
8b78563
<?php
namespace
WebPlugin\Pay\weixin\lib
;
use
WebPlugin\PhpLog
;
/**
*
...
...
@@ -11,6 +12,10 @@ namespace WebPlugin\Pay\weixin\lib;
*/
class
WxPayApi
{
// 向ERP提交订单状态有关接口调用日志和更新订单状态有关接口调用日志
const
ORDER_STATUS_LOG
=
'/Data/logs/pc_pay/order_status'
;
// 日志等级,2表示记录信息等级的日志
const
LOG_LEVEL
=
2
;
/**
*
...
...
@@ -409,8 +414,13 @@ class WxPayApi
*/
public
static
function
notify
(
$callback
,
&
$msg
)
{
// 初始化日志
$log
=
new
PhpLog
(
self
::
ORDER_STATUS_LOG
,
'PRC'
,
self
::
LOG_LEVEL
);
$log
->
LogInfo
(
'begin WxPayApi->notify'
);
//获取通知的数据
$xml
=
$GLOBALS
[
'HTTP_RAW_POST_DATA'
];
$log
->
LogInfo
(
var_export
(
$xml
));
//如果返回成功则验证签名
try
{
$result
=
WxPayResults
::
Init
(
$xml
);
...
...
@@ -418,6 +428,7 @@ class WxPayApi
$msg
=
$e
->
errorMessage
();
return
false
;
}
$log
->
LogInfo
(
var_export
(
$result
,
true
));
return
call_user_func
(
$callback
,
$result
);
}
...
...
library/WebPlugin/Pay/weixin/lib/WxPayNotify.php
View file @
8b78563
...
...
@@ -29,7 +29,7 @@ class WxPayNotify extends WxPayNotifyReply
$msg
=
"OK"
;
//当返回false的时候,表示notify中调用NotifyCallBack回调失败获取签名校验失败,此时直接回复失败
$result
=
Wx
p
ayApi
::
notify
(
array
(
$this
,
'NotifyCallBack'
),
$msg
);
$result
=
Wx
P
ayApi
::
notify
(
array
(
$this
,
'NotifyCallBack'
),
$msg
);
$log
->
LogInfo
(
var_export
(
$result
,
true
));
if
(
$result
==
false
)
{
$log
->
LogInfo
(
'===微信扫码支付Handle失败==='
);
...
...
@@ -70,13 +70,20 @@ class WxPayNotify extends WxPayNotifyReply
*/
final
public
function
NotifyCallBack
(
$data
)
{
// 初始化日志
$log
=
new
PhpLog
(
self
::
ORDER_STATUS_LOG
,
'PRC'
,
self
::
LOG_LEVEL
);
$log
->
LogInfo
(
'begin WxPayNotify->NotifyCallBack'
);
$log
->
LogInfo
(
var_export
(
$data
,
true
));
$msg
=
"OK"
;
$result
=
$this
->
NotifyProcess
(
$data
,
$msg
);
if
(
$result
==
true
)
{
$log
->
LogInfo
(
'===微信支付NotifyCallBack成功==='
);
$this
->
SetReturn_code
(
"SUCCESS"
);
$this
->
SetReturn_msg
(
"OK"
);
}
else
{
$log
->
LogInfo
(
'===微信支付NotifyCallBack失败==='
);
$this
->
SetReturn_code
(
"FAIL"
);
$this
->
SetReturn_msg
(
$msg
);
}
...
...
library/WebPlugin/Pay/weixin/lib/WxPayResults.php
View file @
8b78563
...
...
@@ -8,6 +8,7 @@
*/
namespace
WebPlugin\Pay\weixin\lib
;
use
WebPlugin\PhpLog
;
/**
*
...
...
@@ -17,6 +18,10 @@ namespace WebPlugin\Pay\weixin\lib;
*/
class
WxPayResults
extends
WxPayDataBase
{
// 向ERP提交订单状态有关接口调用日志和更新订单状态有关接口调用日志
const
ORDER_STATUS_LOG
=
'/Data/logs/pc_pay/order_status'
;
// 日志等级,2表示记录信息等级的日志
const
LOG_LEVEL
=
2
;
/**
*
...
...
@@ -80,6 +85,10 @@ class WxPayResults extends WxPayDataBase
*/
public
static
function
Init
(
$xml
)
{
// 初始化日志
$log
=
new
PhpLog
(
self
::
ORDER_STATUS_LOG
,
'PRC'
,
self
::
LOG_LEVEL
);
$log
->
LogInfo
(
'begin WxPayResults::notify'
);
$obj
=
new
self
();
$obj
->
FromXml
(
$xml
);
//fix bug 2015-06-29
...
...
Please
register
or
login
to post a comment