/** * Evalua que el cliente pueda autentificarse correctamente * * @param Client $client * @return \ComproPago\MgPayment\Model\Api\CompropagoSdk\Models\EvalAuthInfo * @throws \Exception */ public static function evalAuth(Client $client) { $response = Rest::get($client->getUri() . "users/auth/", $client->getFullAuth()); $info = Factory::evalAuthInfo($response); switch ($info->code) { case '200': return $info; default: throw new \Exception("CODE {$info->code}: " . $info->message, $info->code); } }
/** * @param $webhookId * @return Models\Webhook * @throws \Exception */ public function deleteWebhook($webhookId) { Validations::validateGateway($this->client); $response = Rest::delete($this->client->getUri() . "webhooks/stores/{$webhookId}/", $this->client->getFullAuth(), null, $this->headers); $obj = Factory::webhook($response); return $obj; }