Exemplo n.º 1
0
 public function retrieve($id, $params = null)
 {
     $requestor = new Pingpp_ApiRequestor($this->_apiKey);
     $base = $this['url'];
     $id = Pingpp_ApiRequestor::utf8($id);
     $extn = urlencode($id);
     list($response, $apiKey) = $requestor->request('get', "{$base}/{$extn}", $params);
     return Pingpp_Util::convertToPingppObject($response, $apiKey);
 }
Exemplo n.º 2
0
 /**
  * @returns string The full API URL for this API resource.
  */
 public function instanceUrl()
 {
     $id = $this['id'];
     $class = get_class($this);
     if (!$id) {
         $message = "Could not determine which URL to request: " . "{$class} instance has invalid ID: {$id}";
         throw new Pingpp_InvalidRequestError($message, null);
     }
     $id = Pingpp_ApiRequestor::utf8($id);
     $base = $this->_lsb('classUrl', $class);
     $extn = urlencode($id);
     return "{$base}/{$extn}";
 }
Exemplo n.º 3
0
 /**
  * @return string The API URL for this Pingpp refund.
  */
 public function instanceUrl()
 {
     $id = $this['id'];
     $charge = $this['charge'];
     if (!$id) {
         throw new Pingpp_InvalidRequestError("Could not determine which URL to request: " . "class instance has invalid ID: {$id}", null);
     }
     $id = Pingpp_ApiRequestor::utf8($id);
     $charge = Pingpp_ApiRequestor::utf8($charge);
     $base = self::classUrl('Pingpp_Charge');
     $chargeExtn = urlencode($charge);
     $extn = urlencode($id);
     return "{$base}/{$chargeExtn}/refunds/{$extn}";
 }