Skip to content

Commit

Permalink
Created cancel and delete documents
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusgalasso committed Sep 18, 2020
1 parent 594f7e6 commit faa53c8
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/Clicksign.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,32 @@ public function createDocument(String $path, String $clicksignPath = null, $mime
return Http::post("$this->urlBase/api/v1/documents?access_token=$this->accessToken", $body);
}

/**
* @param $key
* @throws \Throwable
*/
public function cancelDocument($key)
{
$this->validateToken();
//Verify if parameters were passed
throw_if(!isset($key), 'Some parameters are unset');

return Http::patch("$this->urlBase/api/v1/documents/$key/cancel?access_token=$this->accessToken");
}

/**
* @param $key
* @throws \Throwable
*/
public function deleteDocument($key)
{
$this->validateToken();
//Verify if parameters were passed
throw_if(!isset($key), 'Some parameters are unset');

return Http::delete("$this->urlBase/api/v1/documents/$key?access_token=$this->accessToken");
}

/**
* @param String $email
* @param String $name
Expand Down

0 comments on commit faa53c8

Please sign in to comment.