예제 #1
0
 /**
  * Get a single event
  *
  * Example URL: /events/:identity
  *
  * @param  string        $identity Unique identifier, beginning with "EV".
  * @param  string[mixed] $params   An associative array for any params
  * @return Event
  **/
 public function get($identity, $params = array())
 {
     $path = Util::subUrl('/events/:identity', array('identity' => $identity));
     if (isset($params['params'])) {
         $params['query'] = $params['params'];
         unset($params['params']);
     }
     $response = $this->api_client->get($path, $params);
     return $this->getResourceForResponse($response);
 }
 /**
  * Disable a creditor bank account
  *
  * Example URL: /creditor_bank_accounts/:identity/actions/disable
  *
  * @param  string        $identity Unique identifier, beginning with "BA".
  * @param  string[mixed] $params   An associative array for any params
  * @return CreditorBankAccount
  **/
 public function disable($identity, $params = array())
 {
     $path = Util::subUrl('/creditor_bank_accounts/:identity/actions/disable', array('identity' => $identity));
     if (isset($params['params'])) {
         $params['body'] = json_encode(array("data" => (object) $params['params']));
         unset($params['params']);
     }
     $response = $this->api_client->post($path, $params);
     return $this->getResourceForResponse($response);
 }
 /**
  * Update a customer
  *
  * Example URL: /customers/:identity
  *
  * @param  string        $identity Unique identifier, beginning with "CU".
  * @param  string[mixed] $params   An associative array for any params
  * @return Customer
  **/
 public function update($identity, $params = array())
 {
     $path = Util::subUrl('/customers/:identity', array('identity' => $identity));
     if (isset($params['params'])) {
         $params['body'] = json_encode(array($this->envelope_key => (object) $params['params']));
         unset($params['params']);
     }
     $response = $this->api_client->put($path, $params);
     return $this->getResourceForResponse($response);
 }
 /**
  * Complete a redirect flow
  *
  * Example URL: /redirect_flows/:identity/actions/complete
  *
  * @param  string        $identity Unique identifier, beginning with "RE".
  * @param  string[mixed] $params   An associative array for any params
  * @return RedirectFlow
  **/
 public function complete($identity, $params = array())
 {
     $path = Util::subUrl('/redirect_flows/:identity/actions/complete', array('identity' => $identity));
     if (isset($params['params'])) {
         $params['body'] = json_encode(array("data" => (object) $params['params']));
         unset($params['params']);
     }
     $response = $this->api_client->post($path, $params);
     return $this->getResourceForResponse($response);
 }