Skip to content

Commit

Permalink
Merge pull request #48 from nursultanturdaliev/patch-2
Browse files Browse the repository at this point in the history
Removed unnecessary code snippets.
  • Loading branch information
rikterbeek authored Jan 25, 2018
2 parents 7a32524 + 7974fd9 commit b19d2d1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Adyen/HttpClient/CurlClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ public function requestPost(\Adyen\Service $service, $requestUrl, $params)
'User-Agent: ' . $userAgent
);

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

// return the result
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

Expand All @@ -144,7 +146,6 @@ public function requestPost(\Adyen\Service $service, $requestUrl, $params)
} elseif (!$result) {
$errno = curl_errno($ch);
$message = curl_error($ch);
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);
$this->handleCurlError($requestUrl, $errno, $message, $logger);
Expand Down Expand Up @@ -179,7 +180,7 @@ public function requestPost(\Adyen\Service $service, $requestUrl, $params)
* @param $errno
* @param $message
* @param $logger
* @throws \Adyen\AdyenException
* @throws \Adyen\ConnectionException
*/
protected function handleCurlError($url, $errno, $message, $logger)
{
Expand Down Expand Up @@ -247,4 +248,4 @@ private function logRequest(\Psr\Log\LoggerInterface $logger, $requestUrl, $para
}
$logger->info('JSON Request to Adyen:' . json_encode($params));
}
}
}

0 comments on commit b19d2d1

Please sign in to comment.