WebhookMessage.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Signifyd\Model\SignifydGateway\Response;
  7. /**
  8. * Webhooks are messages sent by SIGNIFYD via HTTP POST to a url you configure on your
  9. * Notifications page in the SIGNIFYD settings.
  10. *
  11. * WebhookMessage messages are sent when certain events occur in the life of an investigation.
  12. * They allow your application to receive pushed updates about a case, rather than poll SIGNIFYD for status changes.
  13. *
  14. * @see https://www.signifyd.com/docs/api/#/reference/webhooks
  15. */
  16. class WebhookMessage
  17. {
  18. /**
  19. * Decoded webhook request body.
  20. *
  21. * @var array
  22. */
  23. private $data;
  24. /**
  25. * Event topic identifier.
  26. *
  27. * @var string
  28. */
  29. private $eventTopic;
  30. /**
  31. * @param array $data
  32. * @param string $eventTopic
  33. */
  34. public function __construct(
  35. array $data,
  36. $eventTopic
  37. ) {
  38. $this->data = $data;
  39. $this->eventTopic = $eventTopic;
  40. }
  41. /**
  42. * Returns decoded webhook request body.
  43. *
  44. * @return array
  45. */
  46. public function getData()
  47. {
  48. return $this->data;
  49. }
  50. /**
  51. * Returns event topic identifier.
  52. *
  53. * @return string
  54. */
  55. public function getEventTopic()
  56. {
  57. return $this->eventTopic;
  58. }
  59. }