Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
RequestSender.php
Go to the documentation of this file.
1 <?php
7 
11 
17 {
21  private $debuggerFactory;
22 
28  public function __construct(
29  DebuggerFactory $debuggerFactory
30  ) {
31  $this->debuggerFactory = $debuggerFactory;
32  }
33 
46  public function send(ZendClient $client, $storeId = null): \Zend_Http_Response
47  {
48  try {
49  $response = $client->request();
50 
51  $this->debuggerFactory->create($storeId)->success(
52  $client->getUri(true),
53  $client->getLastRequest(),
54  $response->getStatus() . ' ' . $response->getMessage(),
55  $response->getBody()
56  );
57 
58  return $response;
59  } catch (\Exception $e) {
60  $this->debuggerFactory->create($storeId)->failure(
61  $client->getUri(true),
62  $client->getLastRequest(),
63  $e
64  );
65 
66  throw new ApiCallException(
67  'Unable to process Signifyd API: ' . $e->getMessage(),
68  $e->getCode(),
69  $e,
70  $client->getLastRequest()
71  );
72  }
73  }
74 }
getUri($as_string=false)
Definition: Client.php:342
$response
Definition: 404.php:11