Beispiel #1
0
 /**
  * Simply executes the base class {@link Text2PayApi_RequestBase::execute()}
  * and returns a corresponding object to this request's purpose.
  *
  * @return Text2PayApi_getServiceDetails_Response object
  *
  * @see Text2PayApi_RequestBase
  * @see Text2PayApi_RequestBase::execute()
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.3
  *
  */
 public function execute()
 {
     // Execute all from base class
     $response = parent::execute();
     // Map the result in a proper response object
     return new Text2PayApi_getServiceDetails_Response($response);
 }
 /**
  * Simply executes the base class {@link Text2PayApi_RequestBase::execute()}
  * and returns a corresponding object to this request's purpose.
  *
  * @return Text2PayApi_initiateTransaction_Response object
  *
  * @see Text2PayApi_RequestBase
  * @see Text2PayApi_RequestBase::execute()
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.1
  *
  */
 public function execute()
 {
     // Execute all from base class
     $response = parent::execute();
     // Map the result in a proper response object
     return new Text2PayApi_initiateTransaction_Response($response);
 }
Beispiel #3
0
 /**
  * Simply executes the base class {@link Text2PayApi_RequestBase::execute()}
  * and returns a corresponding object to this request's purpose.
  *
  * @return Text2PayApi_validateMSISDN_Response object
  *
  * @see Text2PayApi_RequestBase
  * @see Text2PayApi_RequestBase::execute()
  *
  * @author Braga, Bruno <*****@*****.**>
  *
  * @since 0.1
  *
  */
 public function execute()
 {
     // Execute all from base class
     $response = parent::execute();
     // Map the result in a proper response object
     return new Text2PayApi_validateMSISDN_Response($response);
 }
Beispiel #4
0
 /**
  * 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;
 }