Skip to content

Commit

Permalink
Merge pull request #3 from fortifi/pass-http-config
Browse files Browse the repository at this point in the history
pass context config into http config
  • Loading branch information
TomK authored Jun 28, 2019
2 parents 21d5159 + 139a534 commit 6599f7e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/PayPal/Core/PPAPIService.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ public function makeRequest($apiMethod, $request)
{

$this->apiMethod = $apiMethod;
$contextConfig = $this->apiContext->getConfig();

$httpConfig = new PPHttpConfig(null, PPHttpConfig::HTTP_POST);
$httpConfig = new PPHttpConfig(null, PPHttpConfig::HTTP_POST, $contextConfig);
if ($this->apiContext->getHttpHeaders() != null) {
$httpConfig->setHeaders($this->apiContext->getHttpHeaders());
}
Expand All @@ -66,7 +67,7 @@ public function makeRequest($apiMethod, $request)
$payload = $formatter->toString($request);

// Execute HTTP call
$connection = PPConnectionManager::getInstance()->getConnection($httpConfig, $this->apiContext->getConfig());
$connection = PPConnectionManager::getInstance()->getConnection($httpConfig, $contextConfig);
$this->logger->info("Request: $payload");
$response = $connection->execute($payload);
$this->logger->info("Response: $response");
Expand Down

0 comments on commit 6599f7e

Please sign in to comment.