Example #1
0
 /**
  * @param $endPoint
  * @param Collection $data
  * @return \Psr\Http\Message\ResponseInterface
  * @throws RobinSendFailedException
  */
 private function post($endPoint, Collection $data)
 {
     try {
         return $this->client->post($endPoint, ['json' => $data->toArray()]);
     } catch (ClientException $exception) {
         $sendFailedException = new RobinSendFailedException();
         $sendFailedException->setResponse($exception->getResponse());
         throw $sendFailedException;
     }
 }
Example #2
0
 /**
  * @param $customers
  * @param $exception
  * @param $customer
  */
 private function error($customers, RobinSendFailedException $exception, $customer)
 {
     $this->robinLogger->sendError($customers, $exception->getResponse()->getReasonPhrase(), $exception->getMessage(), $customer);
 }