Error 400 Bad Request

POST https://firstaustria.webon.at/api/_action/paypal/webhook/execute?sw-token=jD5vwJvXvCIWY6VRgxemihUhgBkr8yyr

Exceptions

An error occurred during execution of webhook

Symfony\Component\HttpKernel\Exception\ BadRequestHttpException

Show exception properties
0 of 0
Symfony\Component\HttpKernel\Exception\BadRequestHttpException {#2213 â–¼ -statusCode: 400 -headers: [] }
  1. } catch (WebhookHandlerNotFoundException $exception) {
  2. $this->logger->info(\sprintf('[PayPal Webhook] %s', $exception->getMessage()), $logContext);
  3. } catch (WebhookException $webhookException) {
  4. $this->logger->error(\sprintf('[PayPal Webhook] %s', $webhookException->getMessage()), $logContext);
  5. throw new BadRequestHttpException('An error occurred during execution of webhook');
  6. } catch (\Exception $e) {
  7. if ($e instanceof PayPalApiException && $e->is(PayPalApiException::ERROR_CODE_RESOURCE_NOT_FOUND)) {
  8. $this->logger->warning(\sprintf('[PayPal Webhook] %s', $e->getMessage()), $logContext);
  9. return;
WebhookController->tryToExecuteWebhook() in custom/plugins/SwagPayPal/src/Webhook/WebhookController.php (line 145)
  1. {
  2. $token = $this->getShopwareToken($request);
  3. $this->validateShopwareToken($token, $context);
  4. $webhook = $this->createWebhookFromPostData($request);
  5. $this->tryToExecuteWebhook($context, $webhook);
  6. return new Response();
  7. }
  8. /**
in vendor/symfony/http-kernel/HttpKernel.php -> executeWebhook (line 183)
  1. $this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
  2. $controller = $event->getController();
  3. $arguments = $event->getArguments();
  4. // call controller
  5. $response = $controller(...$arguments);
  6. // view
  7. if (!$response instanceof Response) {
  8. $event = new ViewEvent($this, $request, $type, $response, $event);
  9. $this->dispatcher->dispatch($event, KernelEvents::VIEW);
  1. $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  2. $this->requestStack->push($request);
  3. $response = null;
  4. try {
  5. return $response = $this->handleRaw($request, $type);
  6. } catch (\Throwable $e) {
  7. if ($e instanceof \Error && !$this->handleAllThrowables) {
  8. throw $e;
  9. }
  1. $this->dispatcher->dispatch($event);
  2. return $event->getResponse();
  3. }
  4. return parent::handle($request, $type, $catch);
  5. }
  6. }
  1. if (!IpUtils::checkIp('127.0.0.1', $trustedProxies)) {
  2. Request::setTrustedProxies(array_merge($trustedProxies, ['127.0.0.1']), Request::getTrustedHeaderSet());
  3. }
  4. try {
  5. return $kernel->handle($request, $type, $catch);
  6. } finally {
  7. // restore global state
  8. Request::setTrustedProxies($trustedProxies, $trustedHeaderSet);
  9. }
  10. }
  1. protected function forward(Request $request, bool $catch = false, ?Response $entry = null): Response
  2. {
  3. $this->surrogate?->addSurrogateCapability($request);
  4. // always a "master" request (as the real master request can be in cache)
  5. $response = SubRequestHandler::handle($this->kernel, $request, HttpKernelInterface::MAIN_REQUEST, $catch);
  6. /*
  7. * Support stale-if-error given on Responses or as a config option.
  8. * RFC 7234 summarizes in Section 4.2.4 (but also mentions with the individual
  9. * Cache-Control directives) that
  1. */
  2. protected function pass(Request $request, bool $catch = false): Response
  3. {
  4. $this->record($request, 'pass');
  5. return $this->forward($request, $catch);
  6. }
  7. /**
  8. * Invalidates non-safe methods (like POST, PUT, and DELETE).
  9. *
  1. *
  2. * @see RFC2616 13.10
  3. */
  4. protected function invalidate(Request $request, bool $catch = false): Response
  5. {
  6. $response = $this->pass($request, $catch);
  7. // invalidate only when the response is successful
  8. if ($response->isSuccessful() || $response->isRedirect()) {
  9. try {
  10. $this->store->invalidate($request);
  1. }
  2. $this->traces[$this->getTraceKey($request)] = [];
  3. if (!$request->isMethodSafe()) {
  4. $response = $this->invalidate($request, $catch);
  5. } elseif ($request->headers->has('expect') || !$request->isMethodCacheable()) {
  6. $response = $this->pass($request, $catch);
  7. } elseif ($this->options['allow_reload'] && $request->isNoCache()) {
  8. /*
  9. If allow_reload is configured and the client requests "Cache-Control: no-cache",
  1. // only handle main request inside http cache, because ESI tags are also interpreted as main request.
  2. // sub requests are requests, which are forwarded to the kernel inside the php stack
  3. // https://github.com/symfony/symfony/issues/51648#issuecomment-1717846894
  4. if ($type === HttpKernelInterface::MAIN_REQUEST) {
  5. $response = parent::handle($request, $type, $catch);
  6. } elseif ($request->attributes->has('_sw_esi')) {
  7. $response = parent::handle($request, $type, $catch);
  8. } else {
  9. $response = $this->getKernel()->handle($request, $type, $catch);
  10. }
in vendor/shopware/core/Kernel.php -> handle (line 156)
  1. {
  2. if (!$this->booted) {
  3. $this->boot();
  4. }
  5. return $this->getHttpKernel()->handle($request, $type, $catch);
  6. }
  7. public function boot(): void
  8. {
  9. if ($this->booted === true) {
  1. ) {
  2. }
  3. public function run(): int
  4. {
  5. $response = $this->kernel->handle($this->request);
  6. if (Kernel::VERSION_ID >= 60400) {
  7. $response->send(false);
  8. if (\function_exists('fastcgi_finish_request') && !$this->debug) {
in vendor/autoload_runtime.php -> run (line 29)
  1. $app = $app(...$args);
  2. exit(
  3. $runtime
  4. ->getRunner($app)
  5. ->run()
  6. );
require_once('/home/webon-firstaustria/htdocs/firstaustria.webon.at/shop/vendor/autoload_runtime.php') in public/index.php (line 10)
  1. use Shopware\Core\Installer\InstallerKernel;
  2. use Shopware\Core\Framework\Adapter\Kernel\KernelFactory;
  3. $_SERVER['SCRIPT_FILENAME'] = __FILE__;
  4. require_once __DIR__ . '/../vendor/autoload_runtime.php';
  5. if (!file_exists(__DIR__ . '/../.env') && !file_exists(__DIR__ . '/../.env.dist') && !file_exists(__DIR__ . '/../.env.local.php')) {
  6. $_SERVER['APP_RUNTIME_OPTIONS']['disable_dotenv'] = true;
  7. }