Пример #1
0
 protected function doApiAction($action = '', $method = 'post')
 {
     $actionUrl = $this->getApiUrl() . '/' . $this->_id . '/' . $action;
     $httpAction = new Paymentwall_HttpAction($this, array('id' => $this->_id), array($this->getApiBaseHeader()));
     $this->setPropertiesFromResponse($method == 'get' ? $httpAction->get($actionUrl) : $httpAction->post($actionUrl));
     return $this;
 }
Пример #2
0
 /**
  * Make post request
  *
  * @param array $params
  * @param array $headers
  *
  * @return array
  */
 public function post($params = array(), $headers = array())
 {
     if (empty($params)) {
         return null;
     }
     $this->httpAction->setApiParams($params);
     $this->httpAction->setApiHeaders(array_merge(array($this->getApiBaseHeader()), $headers));
     return (array) $this->preparePropertiesFromResponse($this->httpAction->post($this->getApiUrl()));
 }