Skip to content

Commit

Permalink
Merge branch 'vidhan/issue_73' of github.com:team-telnyx/telnyx-php i…
Browse files Browse the repository at this point in the history
…nto vidhan/issue_73
  • Loading branch information
vidhanbhonsle committed Nov 18, 2022
2 parents 7390ed4 + e7e71e5 commit 8165bd8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ApiOperations/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ protected static function _staticRequest($method, $url, $params, $options)
$opts = \Telnyx\Util\RequestOptions::parse($options);
$baseUrl = isset($opts->apiBase) ? $opts->apiBase : static::baseUrl();
$requestor = new \Telnyx\ApiRequestor($opts->apiKey, $baseUrl);

list($response, $opts->apiKey) = $requestor->request($method, $url, $params, $opts->headers);

$opts->discardNonPersistentHeaders();

return [$response, $opts];
}
}
1 change: 1 addition & 0 deletions lib/ApiOperations/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public static function update($id, $params = null, $opts = null)

list($response, $opts) = static::_staticRequest('patch', $url, $params, $opts);
$obj = \Telnyx\Util\Util::convertToTelnyxObject($response->json, $opts);

$obj->setLastResponse($response);
return $obj;
}
Expand Down
2 changes: 2 additions & 0 deletions lib/ApiRequestor.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ public function request($method, $url, $params = null, $headers = null)
$params = $params ?: [];
$headers = $headers ?: [];
list($rbody, $rcode, $rheaders, $myApiKey) = $this->_requestRaw($method, $url, $params, $headers);
print_r($rbody); die;
$json = $this->_interpretResponse($rbody, $rcode, $rheaders);

$resp = new ApiResponse($rbody, $rcode, $rheaders, $json);

return [$resp, $myApiKey];
Expand Down

0 comments on commit 8165bd8

Please sign in to comment.