Exemplo n.º 1
0
 /**
  * @param string $url
  * @param array  $body
  * @return Transaction
  */
 protected function authCall($url = '', $body = array())
 {
     $headers = array('Authorization' => 'Basic ' . $this->getApiKey(), 'Content-Type' => 'application/x-www-form-urlencoded');
     $request = $this->client->requestFactory('POST', $url, null, $body, $headers);
     $uri = new Uri($this->apiUrl((string) $request->getUri(), array('addServer' => true)));
     return $this->client->send($request->withUri($uri));
 }
Exemplo n.º 2
0
 /**
  * Method sends the request (even externally created) to API server using client
  * @param RequestInterface $request
  * @param array            $options
  * @throws ApiException
  * @return ApiResponse
  */
 public function sendRequest(RequestInterface $request, $options = array())
 {
     return $this->_client->send($this->inflateRequest($request, $options));
 }