Skip to content

Commit 2827bc8

Browse files
authored
Merge pull request #1 from lokielse/master
Sync
2 parents b43d121 + 07b714f commit 2827bc8

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
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);

src/Message/QueryRefundRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ public function setRefundId($refundId)
153153
*/
154154
public function sendData($data)
155155
{
156-
$request = $this->httpClient->post($this->endpoint)->setBody(Helper::array2xml($data));
157-
$response = $request->send()->getBody();
156+
$request = $this->httpClient->request('post', $this->endpoint, [], Helper::array2xml($data));
157+
$response = $request->getBody();
158158
$responseData = Helper::xml2array($response);
159159

160160
return $this->response = new QueryRefundResponse($this, $responseData);

0 commit comments

Comments
 (0)