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