/** * Checks json-rpc request object for required parameters and makes POST request * @throws SkrillPsp_Exception * @return SkrillPsp_Response_Success|SkrillPsp_Response_Error|SkrillPsp_Response_ErrorLevel */ public function makeCall() { if (is_null($this->getMerchant())) { throw new SkrillPsp_Exception("You should set endpoint, merchantId, channelId and payment method"); } return SkrillPsp_Http::post($this->url, $this->encode($this->json)); }
/** * Checks json-rpc request object for required parameters and makes POST request * @throws SkrillPsp_Exception * @return object SkrillPsp_Response_Success|SkrillPsp_Response_Error|SkrillPsp_Response_ErrorLevel */ public function makeCall() { if (is_null($this->getMerchant())) { throw new SkrillPsp_Exception("You should set endpoint, merchantId, channelId and payment method"); } if (empty($this->token)) { unset($this->json['params'][$this->account]['token']); foreach ($this->json['params'][$this->account] as $key => $value) { if (empty($value)) { throw new SkrillPsp_Exception("{$key} is mandatory. Unless you provide valid token."); } } } return SkrillPsp_Http::post($this->url, $this->encode($this->json)); }