public function handle(Request $request, \Closure $next)
 {
     if ($request->getMethod() === "POST") {
         if ($this->validSignature($request) || $this->validShopId($request)) {
             return $next($request);
         }
     }
     $this->logger->hooksError($request->getContent(), $request);
     return new Response("", Response::HTTP_FORBIDDEN);
 }
示例#2
0
 public function testLogsToFile()
 {
     $monolog = new Logger("ROBIN");
     $monolog->pushHandler(new StreamHandler(__DIR__ . '/logs/robin.log'));
     $monolog->pushProcessor(new IntrospectionProcessor());
     $logger = new RobinLogger($monolog);
     $logger->sendError(new Orders(), 500, "Missing Data", ['blaat' => 'blaat']);
     $content = $this->getLog();
     $this->assertContains('blaat', $content);
     $this->deleteLog();
 }
示例#3
0
 /**
  * @param $customers
  * @param $exception
  * @param $customer
  */
 private function error($customers, RobinSendFailedException $exception, $customer)
 {
     $this->robinLogger->sendError($customers, $exception->getResponse()->getReasonPhrase(), $exception->getMessage(), $customer);
 }