Skip to content

Commit

Permalink
wxpay
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethan committed Dec 25, 2018
1 parent b15990b commit ff935d1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Service/PayService.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,8 @@ public static function unifiedOrder($unified, $payKey)
*
* @throws WechatException
*/
public static function notify()
public static function notify($checkSign = true)
{
$config = self::getConfig();

$postStr = file_get_contents('php://input');

//$postStr = '<xml>
Expand Down Expand Up @@ -335,9 +333,17 @@ public static function notify()
}

$postArr = (array)$postObj;

//不验证签名,主要用于获取appid、mch_id
if (!$checkSign) {
return $postArr;
}

$signArr = $postArr;
unset($signArr['sign']);

$config = self::getConfig();

if (self::getSign($signArr, $config['key']) === $postArr['sign']) {

// $mch_id = $postObj->mch_id; //微信支付分配的商户号
Expand Down

0 comments on commit ff935d1

Please sign in to comment.