/** * 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); }
/** * 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); }
/** * 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); }
/** * @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); }