/** * Consultar detalhes de um pagamento. * * @param $code * @param array $options * * @return ResponseInterface */ public function find($code, array $options = []) { $url = $this->interpolate($this->client->getApiUrl() . '/' . self::BASE_PATH . '/{code}', ['environment' => $this->client->getEnvironment(), 'version' => $this->client->getApiVersion(), 'resource' => self::RESOURCE, 'code' => $code]); $response = $this->client->get($url, $options); if (!$response->results()) { $response->setError('MXC3', 'Pagamento não encontrado'); } return $response; }
/** * Consultar detalhes de um cliente. * * @param $code * @param array $options * * @throws ClientException * * @return ResponseInterface */ public function find($code, array $options = []) { $url = $this->interpolate($this->client->getApiUrl() . '/' . self::BASE_PATH . '/{code}', ['environment' => $this->client->getEnvironment(), 'version' => $this->client->getApiVersion(), 'resource' => self::RESOURCE, 'code' => $code]); try { $find = $this->client->get($url, $options); } catch (ClientException $e) { $find = []; } return $find; }
/** * Listar todas as faturas de uma assinatura. * * @param $code * @param array $options * * @throws ClientException * * @return ResponseInterface */ public function invoices($code, array $options = []) { $url = $this->interpolate($this->client->getApiUrl() . '/' . self::BASE_PATH . '/{code}/invoices', ['environment' => $this->client->getEnvironment(), 'version' => $this->client->getApiVersion(), 'resource' => self::RESOURCE, 'code' => $code]); return $this->client->get($url, $options); }