示例#1
0
 /**
  * @param string $service    service
  * @param array  $parameters parameters
  * @param string $endpoint   endpoint
  *
  * @return \SimpleXMLElement
  */
 public function call($service = null, array $parameters = array(), $endpoint = null)
 {
     if (null === $endpoint) {
         $endpoint = $this->metadata->getEndpoint();
     }
     $default = array('api_key' => $this->metadata->getApiKey(), 'format' => 'json');
     if ($service) {
         $default['method'] = $service;
     }
     $parameters = array_merge($default, $parameters);
     $parameters = array_filter($parameters, function ($value) {
         return null !== $value;
     });
     $parameters['api_sig'] = $this->buildSignature($parameters);
     $this->addOAuthParameters($endpoint, $parameters);
     return $this->http->post($endpoint, $parameters);
 }
示例#2
0
 /**
  * @param string $service    service
  * @param array  $parameters parameters
  * @param string $endpoint   endpoint
  *
  * @return \SimpleXMLElement
  */
 public function call($service = null, array $parameters = array(), $endpoint = null)
 {
     $parameters = $this->buildParams($service, $parameters, $endpoint);
     return $this->http->post($endpoint, $parameters);
 }