ApiCallException.php 926 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Signifyd\Model\SignifydGateway;
  7. /**
  8. * Exception of interaction with Signifyd API
  9. */
  10. class ApiCallException extends GatewayException
  11. {
  12. /**
  13. * @var string
  14. */
  15. private $requestData;
  16. /**
  17. * ApiCallException constructor.
  18. * @param string $message
  19. * @param int $code
  20. * @param \Exception|null $previous
  21. * @param string $requestData in JSON format
  22. */
  23. public function __construct($message = '', $code = 0, \Exception $previous = null, $requestData = '')
  24. {
  25. $this->requestData = $requestData;
  26. parent::__construct($message, $code, $previous);
  27. }
  28. /**
  29. * Gets request data for unsuccessful request in JSON format
  30. * @return string
  31. */
  32. public function getRequestData()
  33. {
  34. return $this->requestData;
  35. }
  36. }