previewtechs / google-pubsub-utility
Google Pub/Sub PHP push webhook receiver object mapper
dev-master
2017-04-26 21:49 UTC
Requires
- netresearch/jsonmapper: ^1.1
This package is auto-updated.
Last update: 2024-12-06 09:52:18 UTC
README
####Google Pub/Sub Web Hook Receiver
Usage
<?php require "vendor/autoload.php"; $mapper = new JsonMapper(); /** * @var $messageObject \Previewtechs\GooglePubSubUtility\WebHookReceiver\WebHook */ $messageObject = $mapper->map(json_decode($_POST), new \Previewtechs\GooglePubSubUtility\WebHookReceiver\WebHook()); var_dump($messageObject->getMessage()->getData()->getDecoded());