Skip to content

Commit 5f4b6a1

Browse files
committed
添加支付通知签名验证
1 parent cba2049 commit 5f4b6a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Wechat/WechatPay.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@ public function getNotify() {
128128
$this->errMsg = 'Payment notification forbidden access.';
129129
return false;
130130
}
131-
if (empty($notifyInfo['sign']) || !($sign = $notifyInfo['sign'])) {
131+
if (empty($notifyInfo['sign'])) {
132132
Tools::log('Payment notification signature is missing.' . var_export($notifyInfo, true), 'ERR');
133133
$this->errCode = '403';
134134
$this->errMsg = 'Payment notification signature is missing.';
135135
return false;
136136
}
137137
$data = $notifyInfo;
138138
unset($data['sign']);
139-
if ($sign !== Tools::getPaySign($data, $this->partnerKey)) {
139+
if ($notifyInfo['sgin'] !== Tools::getPaySign($data, $this->partnerKey)) {
140140
Tools::log('Payment notification signature verification failed.' . var_export($notifyInfo, true), 'ERR');
141141
$this->errCode = '403';
142142
$this->errMsg = 'Payment signature verification failed.';

0 commit comments

Comments
 (0)