|
2 | 2 |
|
3 | 3 | namespace Omnipay\WechatPay\Message; |
4 | 4 |
|
5 | | -use Guzzle\Http\Client; |
| 5 | +use GuzzleHttp\Client; |
6 | 6 | use Omnipay\Common\Exception\InvalidRequestException; |
7 | 7 | use Omnipay\Common\Message\ResponseInterface; |
8 | 8 | use Omnipay\WechatPay\Helper; |
@@ -240,17 +240,16 @@ public function setKeyPath($keyPath) |
240 | 240 | */ |
241 | 241 | public function sendData($data) |
242 | 242 | { |
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 | | - |
252 | 243 | $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(); |
254 | 253 | $responseData = Helper::xml2array($response); |
255 | 254 |
|
256 | 255 | return $this->response = new PromotionTransferResponse($this, $responseData); |
|
0 commit comments