/**
  * Criar um cliente.
  *
  * @param array $data
  * @param bool  $new_vault
  * @param array $options
  *
  * @throws ClientException
  *
  * @return ResponseInterface
  */
 public function create(array $data, $new_vault = false, array $options = [])
 {
     $url = $this->interpolate($this->client->getApiUrl() . '/' . self::BASE_PATH . '?new_vault={new_vault}', ['environment' => $this->client->getEnvironment(), 'version' => $this->client->getApiVersion(), 'resource' => self::RESOURCE, 'new_vault' => $new_vault === true ? 'true' : 'false']);
     $options = array_merge($options, ['body' => json_encode($data)]);
     return $this->client->post($url, $options);
 }
示例#2
0
 /**
  * Criar um plano.
  *
  * @param array $data
  * @param array $options
  *
  * @throws ClientException
  *
  * @return ResponseInterface
  */
 public function create(array $data, array $options = [])
 {
     $url = $this->interpolate($this->client->getApiUrl() . '/' . self::BASE_PATH, ['environment' => $this->client->getEnvironment(), 'version' => $this->client->getApiVersion(), 'resource' => self::RESOURCE]);
     $options = array_merge($options, ['body' => json_encode($data)]);
     return $this->client->post($url, $options);
 }