Skip to content

Commit

Permalink
Added missing comment
Browse files Browse the repository at this point in the history
  • Loading branch information
daredloco committed Jan 22, 2024
1 parent 2c89b38 commit 9b2407f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Scripts/PagSeguro/RedirectCheckout3.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ public static function cancelTransaction(string $transactionCode){
throw new Exception('Method not implemented');
}

/**
* Compares the signature sent by a webhook
*
* @param string $token
* @param string $payload
* @param string $authenticityToken
* @return boolean
*/
public static function compareSignature(string $token, string $payload, string $authenticityToken):bool{
$calculatedToken = hash('sha256', $token.'-'.$payload);
return $calculatedToken == $authenticityToken;
Expand Down

0 comments on commit 9b2407f

Please sign in to comment.