Exemplo n.º 1
0
 /**
  * Consultar detalhes de um pagamento
  *
  * @param $code
  * @param array $options
  * @throws ClientException
  * @return ResponseInterface
  */
 public function find($code, array $options = [])
 {
     $url = $this->interpolate(self::BASE_PATH . "/{code}", ['version' => $this->client->getApiVersion(), 'resource' => self::RESOURCE, 'code' => $code]);
     return $this->client->get($url, $options);
 }
Exemplo n.º 2
0
 /**
  * Criar regras de retentativas automáticas
  *
  * @param array $data
  * @param array $options
  * @throws ClientException
  * @return ResponseInterface
  */
 public function setPreferencesRetry(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);
 }
Exemplo n.º 3
0
 /**
  * Ativar ou desativar um plano
  *
  * @param $code
  * @param $status [activate, inactivate]
  * @param array $options
  * @throws ClientException
  * @return ResponseInterface
  */
 protected function toogleActive($code, $status, array $options = [])
 {
     $url = $this->interpolate(self::BASE_PATH . "/{code}/{status}", ['version' => $this->client->getApiVersion(), 'resource' => self::RESOURCE, 'code' => $code, 'status' => $status]);
     return $this->client->put($url, $options);
 }
Exemplo n.º 4
0
 /**
  * @param $code
  * @param array $data
  * @param array $options
  * @throws ClientException
  * @return ResponseInterface
  */
 public function updateBillingInfo($code, array $data, array $options = [])
 {
     $url = $this->interpolate(self::BASE_PATH . "/{code}/billing_infos", ['version' => $this->client->getApiVersion(), 'resource' => self::RESOURCE, 'code' => $code]);
     $options = array_merge($options, ['body' => json_encode($data)]);
     return $this->client->put($url, $options);
 }