Skip to content

Commit 07b714f

Browse files
authored
Merge pull request #88 from sunanzhi/master
2 parents acdea45 + af52cda commit 07b714f

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/Message/PromotionTransferRequest.php

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

33
namespace Omnipay\WechatPay\Message;
44

5-
use Guzzle\Http\Client;
5+
use GuzzleHttp\Client;
66
use Omnipay\Common\Exception\InvalidRequestException;
77
use Omnipay\Common\Message\ResponseInterface;
88
use Omnipay\WechatPay\Helper;
@@ -240,17 +240,16 @@ public function setKeyPath($keyPath)
240240
*/
241241
public function sendData($data)
242242
{
243-
$options = array(
244-
CURLOPT_SSL_VERIFYPEER => true,
245-
CURLOPT_SSL_VERIFYHOST => 2,
246-
CURLOPT_SSLCERTTYPE => 'PEM',
247-
CURLOPT_SSLKEYTYPE => 'PEM',
248-
CURLOPT_SSLCERT => $this->getCertPath(),
249-
CURLOPT_SSLKEY => $this->getKeyPath(),
250-
);
251-
252243
$body = Helper::array2xml($data);
253-
$response = $this->httpClient->request('POST', $this->endpoint, [], $body)->getBody();
244+
$client = new Client();
245+
246+
$options = [
247+
'body' => $body,
248+
'verify' => true,
249+
'cert' => $this->getCertPath(),
250+
'ssl_key' => $this->getKeyPath(),
251+
];
252+
$response = $client->request('POST', $this->endpoint, $options)->getBody();
254253
$responseData = Helper::xml2array($response);
255254

256255
return $this->response = new PromotionTransferResponse($this, $responseData);

0 commit comments

Comments
 (0)