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); }
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(); }
/** * @param $customers * @param $exception * @param $customer */ private function error($customers, RobinSendFailedException $exception, $customer) { $this->robinLogger->sendError($customers, $exception->getResponse()->getReasonPhrase(), $exception->getMessage(), $customer); }