Skip to content

Commit

Permalink
Use explicit curl_setopt.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimehing committed May 22, 2024
1 parent 8df2a70 commit 7d7b1cc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ public function request($opts)
'Authorization: Basic '. base64_encode($this->apiKey . ':'),
]
);
$opts[\CURLOPT_CAINFO] = \Payrex\Payrex::getCACertificateBundlePath();
curl_setopt($ch, CURLOPT_CAINFO, \Payrex\Payrex::getCACertificateBundlePath());

if (!\Payrex\Payrex::getVerifySslCerts()) {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
}

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

Expand All @@ -45,10 +49,6 @@ public function request($opts)
curl_setopt($ch, CURLOPT_POST, 1);
}

if (!\Payrex\Payrex::getVerifySslCerts()) {
$opts[\CURLOPT_SSL_VERIFYPEER] = false;
}

$body = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
Expand Down

0 comments on commit 7d7b1cc

Please sign in to comment.