A webhook message comes from the platform the app runs on and contains data, which can be used for various processes.
The instance of this class should be used, to verify content of the incoming message to make your platform more secure. In order to verify the incoming message, you have to know the secret, you configured on the webhook in the NextEvent App.
Example:
try {
$gate = WebhookMessage::current()->verify()->getModel(Gate::class);
// Do something...
}
catch (WebhookMessageException $exception) {
// Handle this
}
package |
Default |
---|
__call(string $name, array $args) : mixed
If the source of your model contains, e.g. a property named 'my_property',
you can call getMyProperty()
to retrieve it's value.
string
array
mixed
__construct(array $source)
Parse source data.
Throws |
|
---|
array
The source data as received from the API
current() : \NextEvent\PHPSDK\Model\WebhookMessage
get(string $var) : mixed
Should be used, if you expect the model to have custom properties which are not known/covered by the known getters
string
mixed
getEvent() : string
string
getHeaders() : array
array
getId() : string
string
getJSON() : array
Throws |
|
---|
array
getModel(string $className, $args = array()) : \NextEvent\PHPSDK\Model\NextEvent\PHPSDK\Model\Model
Throws |
|
---|
string
The full class name of the model to generate.
\NextEvent\PHPSDK\Model\NextEvent\PHPSDK\Model\Model
getPayload() : string
string
getSignature() : string
string
isValid() : boolean
boolean
serialize() : string
Implements Serializable interface
string
toArray() : array
array
toLogContext() : array
Implements the LogContextInterface interface
array
toString() : string
string
unserialize( $serialized)
Implements Serializable interface
verify(string $secret) : \NextEvent\PHPSDK\Model\NextEvent\PHPSDK\Model\WebhookMessage
Throws |
|
---|
string
\NextEvent\PHPSDK\Model\NextEvent\PHPSDK\Model\WebhookMessage