[更新]修改支付通知签名处理

This commit is contained in:
Anyon 2018-10-27 15:50:34 +08:00
parent 8cd19c0e19
commit 7438d3b708

View File

@ -95,9 +95,8 @@ class BasicPay
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));
@ -109,7 +108,7 @@ class BasicPay
* 转换短链接
* @param string $longUrl 需要转换的URL签名用原串传输需URLencode
* @return array
* @throws \WeChat\Exceptions\ExcInvalidResponseException
* @throws InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function shortUrl($longUrl)