getEvent(); $hash = hash_hmac( 'sha256', $event->getEventTime() . $event->getEventType(), $api_key ); return $event->getEventHash() === $hash; } /** * Identifies the callback type, one of "account_callback" or * "app_callback". * * "app_callback" will always include a value for "reported_for_app_id" */ public static function getCallbackType( Model\EventCallbackRequest $event_callback ): string { $meta_data = $event_callback->getEvent()->getEventMetadata(); if (empty($meta_data) || empty($meta_data->getReportedForAppId())) { return self::EVENT_TYPE_ACCOUNT_CALLBACK; } return self::EVENT_TYPE_APP_CALLBACK; } }