Skip to content

Commit 7d7813e

Browse files
authored
Merge pull request #105 from sunanzhi/master
2 parents d4264f4 + 9d7b151 commit 7d7813e

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/Message/QueryTransferRequest.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Omnipay\WechatPay\Message;
44

5+
use GuzzleHttp\Client;
56
use Omnipay\Common\Exception\InvalidRequestException;
67
use Omnipay\Common\Message\ResponseInterface;
78
use Omnipay\WechatPay\Helper;
@@ -106,18 +107,16 @@ public function setKeyPath($keyPath)
106107
*/
107108
public function sendData($data)
108109
{
109-
$options = array(
110-
CURLOPT_SSL_VERIFYPEER => true,
111-
CURLOPT_SSL_VERIFYHOST => 2,
112-
CURLOPT_SSLCERTTYPE => 'PEM',
113-
CURLOPT_SSLKEYTYPE => 'PEM',
114-
CURLOPT_SSLCERT => $this->getCertPath(),
115-
CURLOPT_SSLKEY => $this->getKeyPath(),
116-
);
117-
118110
$body = Helper::array2xml($data);
119-
$request = $this->httpClient->request('POST', $this->endpoint, $options, $body);
120-
$response = $request->getBody();
111+
$client = new Client();
112+
113+
$options = [
114+
'body' => $body,
115+
'verify' => true,
116+
'cert' => $this->getCertPath(),
117+
'ssl_key' => $this->getKeyPath(),
118+
];
119+
$response = $client->request('POST', $this->endpoint, $options)->getBody();
121120
$responseData = Helper::xml2array($response);
122121

123122
return $this->response = new QueryTransferResponse($this, $responseData);

0 commit comments

Comments
 (0)