コード例 #1
0
ファイル: Invoice.php プロジェクト: Carlos110988/Conekta-1
 public function pay()
 {
     $requestor = new Conekta_ApiRequestor($this->_apiKey);
     $url = $this->instanceUrl() . '/pay';
     list($response, $apiKey) = $requestor->request('post', $url);
     $this->refreshFrom($response, $apiKey);
     return $this;
 }
コード例 #2
0
ファイル: List.php プロジェクト: Carlos110988/Conekta-1
 public function retrieve($id, $params = null)
 {
     $requestor = new Conekta_ApiRequestor($this->_apiKey);
     $base = $this['url'];
     $id = Conekta_ApiRequestor::utf8($id);
     $extn = urlencode($id);
     list($response, $apiKey) = $requestor->request('get', "{$base}/{$extn}", $params);
     return Conekta_Util::convertToConektaObject($response, $apiKey);
 }
コード例 #3
0
ファイル: Card.php プロジェクト: Carlos110988/Conekta-1
 public function instanceUrl()
 {
     $id = $this['id'];
     $customer = $this['customer'];
     $class = get_class($this);
     if (!$id) {
         throw new Conekta_InvalidRequestError("Could not determine which URL to request: {$class} instance has invalid ID: {$id}", null);
     }
     $id = Conekta_ApiRequestor::utf8($id);
     $customer = Conekta_ApiRequestor::utf8($customer);
     $base = self::classUrl('Conekta_Customer');
     $customerExtn = urlencode($customer);
     $extn = urlencode($id);
     return "{$base}/{$customerExtn}/cards/{$extn}";
 }
コード例 #4
0
 protected function _scopedDelete($class, $params = null)
 {
     self::_validateCall('delete');
     $requestor = new Conekta_ApiRequestor($this->_apiKey);
     $url = $this->instanceUrl();
     list($response, $apiKey) = $requestor->request('delete', $url, $params);
     $this->refreshFrom($response, $apiKey);
     return $this;
 }
コード例 #5
0
ファイル: Customer.php プロジェクト: Carlos110988/Conekta-1
 public function deleteDiscount()
 {
     $requestor = new Conekta_ApiRequestor($this->_apiKey);
     $url = $this->instanceUrl() . '/discount';
     list($response, $apiKey) = $requestor->request('delete', $url);
     $this->refreshFrom(array('discount' => null), $apiKey, true);
 }