Skip to content

Commit

Permalink
[更新]修改支付通知签名处理
Browse files Browse the repository at this point in the history
  • Loading branch information
zoujingli committed Oct 27, 2018
1 parent 8cd19c0 commit 7438d3b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions WeChat/Contracts/BasicPay.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ public function getNotify()
public function getPaySign(array $data, $signType = 'MD5', $buff = '')
{
ksort($data);
foreach ($data as $k => $v) {
$buff .= "{$k}={$v}&";
}
if (isset($data['sign'])) unset($data['sign']);
foreach ($data as $k => $v) $buff .= "{$k}={$v}&";
$buff .= ("key=" . $this->config->get('mch_key'));
if (strtoupper($signType) === 'MD5') {
return strtoupper(md5($buff));
Expand All @@ -109,7 +108,7 @@ public function getPaySign(array $data, $signType = 'MD5', $buff = '')
* 转换短链接
* @param string $longUrl 需要转换的URL,签名用原串,传输需URLencode
* @return array
* @throws \WeChat\Exceptions\ExcInvalidResponseException
* @throws InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function shortUrl($longUrl)
Expand Down

0 comments on commit 7438d3b

Please sign in to comment.