WebhooksService/TokenVerifier.phpView Source

Show: PublicProtectedPrivateinherited
Table of Contents
Package
Default  

\TokenVerifier

Package: Default

Constants

>VConstant  HASH_ALGORITHM = 'SHA256'
The encryption algorithm using for TokenVerifier

Properties

>VPropertyprivatenull $verifierToken = null
The verfier Token for Wehbook assigned by Intuit
Default valuenullDetails
Type
null

Methods

methodpublic__construct( $token) : void

Private TokenVerifier constructor.

Parameters
NameTypeDescription
$token
methodprivateencryptPayLoadBasedOnToken( $payLoad, null $hashAlgorithm = null) : string

Encrypt the payload based on hash algorithm and verifier Token

Parameters
NameTypeDescription
$payLoad
$hashAlgorithmnull
Returns
TypeDescription
string
methodpublicverifyPayLoad( $payLoad,  $sig, null $algo = null) : boolean

Using the token to encrypt payload and compare with sig

Parameters
NameTypeDescription
$payLoad

The payload to be verified

$sig

The signature retrieved from header

$algonull

The algo used to encrypt

Returns
TypeDescription
booleanTrue if same false otherwise
Documentation was generated by phpDocumentor 2.8.5.