src/ChenPay/WxPay.php
public function getSyncKey()
    {
        try {
            $html = (new \GuzzleHttp\Client())
                ->request('POST', "https://" . $this->url . "/cgi-bin/mmwebwx-bin/webwxinit?r=695888609", [
                    'timeout' => 10,
                    'headers' => [
                        'Accept' => 'application/json, text/javascript',
                        'Accept-Encoding' => 'gzip, deflate, br',
                        'Accept-Language' => 'en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7',
                        'Connection' => 'keep-alive',
                        'Content-Length' => '295',
                        'Content-Type' => 'application/json;charset=UTF-8',
                        'Cookie' => $this->cookie,
                        'Host' => $this->url,
                        'Origin' => 'https://' . $this->url,
                        'Referer' => 'https://' . $this->url . '/',
                        'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'
                    ],
                    'body' => '{"BaseRequest":{"Uin":' . Cookie::getCookieName('wxuin', $this->cookie) .
                        ',"Sid":"' . Cookie::getCookieName('wxsid', $this->cookie) . '","Skey":' .
                        '"","DeviceID":"e453731506754000"}}'
                ])
                ->getBody();
            return json_decode($html->getContents(), true);
        } catch (GuzzleException $e) {
            throw new PayException('访问出错', 500);
        } catch (PayException $e) {
            throw new PayException($e->getMessage(), $e->getCode());
        } catch (\Exception $e) {
            throw new PayException('处理出错', 444);
        }
    }
public function getSyncKey()
    {
        try {
            $html = (new \GuzzleHttp\Client())
                ->request('POST', "https://" . $this->url . "/cgi-bin/mmwebwx-bin/webwxinit?r=695888609", [
                    'timeout' => 10,
                    'headers' => [
                        'Accept' => 'application/json, text/javascript',
                        'Accept-Encoding' => 'gzip, deflate, br',
                        'Accept-Language' => 'en-US,en;q=0.9,zh-CN;q=0.8,zh;q=0.7',
                        'Connection' => 'keep-alive',
                        'Content-Length' => '295',
                        'Content-Type' => 'application/json;charset=UTF-8',
                        'Cookie' => $this->cookie,
                        'Host' => $this->url,
                        'Origin' => 'https://' . $this->url,
                        'Referer' => 'https://' . $this->url . '/',
                        'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'
                    ],
                    'body' => '{"BaseRequest":{"Uin":' . Cookie::getCookieName('wxuin', $this->cookie) .
                        ',"Sid":"' . Cookie::getCookieName('wxsid', $this->cookie) . '","Skey":' .
                        '"","DeviceID":"e453731506754000"}}'
                ])
                ->getBody();
            return json_decode($html->getContents(), true);
        } catch (GuzzleException $e) {
            throw new PayException('访问出错', 500);
        } catch (PayException $e) {
            throw new PayException($e->getMessage(), $e->getCode());
        } catch (\Exception $e) {
            throw new PayException('处理出错', 444);
        }
    }
微信心跳包
@return $this
@throws PayException