/** * The actual CURL execution that communicates with Text2Pay API by HTTP * GET request. Here, the arguments prepared for the URL querystring will * be properly "stringfied" by the built-in {@link http_build_query()}, * in addition to the signature that is created by * {@link Text2PayApi_RequestBase::createSignature()} method. * * @return array object with all raw values returned from API. * * @throws Text2PayException In case the argument action was not properly * defined, or due to internet connectivity issues (CURL or HTTP errors). * * @throws Text2PayApiException For API response issues. * * @see Text2PayApi_RequestBase::createSignature() * * @uses curl_init() and related CURL functionalities for HTTP requests. * @uses http_build_query() to stringfy the arguments array * * @author Braga, Bruno <*****@*****.**> * @author Martens, Scott <*****@*****.**> * * @since 0.1 * */ private function apiPost() { $result = array(); $params = $this->args; // include the source if applicable $source = $this->apiConnection->getSource(); if (!empty($source)) { $params['source'] = $source; } // create our signature hash value $params['sig'] = Text2PayApi_RequestBase::createSignature($this->apiConnection->getApiKey(), $params); // manually build URL for debugging purposes $this->executedUrl = Text2PayApi_RequestBase::$url . '?' . http_build_query($params); // execute the request $this->rawData = Text2PayApi_Common::httpGet(Text2PayApi_RequestBase::$url, $params, $this->apiConnection->getUsername(), $this->apiConnection->getPassword()); return $this->rawData; }