PHP Class EventHomes\Api\Webhooks\MandrillWebhookController

Inheritance: extends Illuminate\Routing\Controller
ファイルを表示 Open project: eventhomes/laravel-mandrillhooks

Public Methods

Method Description
generateSignature ( string $webhook_key, string $url, array $params ) https://mandrill.zendesk.com/hc/en-us/articles/205583257-How-to-Authenticate-Webhook-Requests Generates a base64-encoded signature for a Mandrill webhook request.
handleWebHook ( Illuminate\Http\Request $request ) : Response Handle the Mandrill webhook and call method if available

Private Methods

Method Description
getJsonPayloadFromRequest ( $request ) : array Pull the Mandrill payload from the json
validateSignature ( Illuminate\Http\Request $request ) : boolean Validates the signature of a mandrill request if key is set

Method Details

generateSignature() public method

https://mandrill.zendesk.com/hc/en-us/articles/205583257-How-to-Authenticate-Webhook-Requests Generates a base64-encoded signature for a Mandrill webhook request.
public generateSignature ( string $webhook_key, string $url, array $params )
$webhook_key string the webhook's authentication key
$url string the webhook url
$params array the request's POST parameters

handleWebHook() public method

Handle the Mandrill webhook and call method if available
public handleWebHook ( Illuminate\Http\Request $request ) : Response
$request Illuminate\Http\Request
return Symfony\Component\HttpFoundation\Response