resultRedirectFactory->create(); try { $data = $this->parser->parse( (string)$this->getRequest()->getContent(), (array)$this->getRequest()->getParams() ); $paymentResult = $this->processor->process($data, false); if ($paymentResult === Processor::FAILURE) { $this->messageManager->addErrorMessage( __('Klarna payment was not completed: %1', $data['payment_details']) ); } elseif ($paymentResult === Processor::PENDING) { $this->messageManager->addNoticeMessage( __('Your Klarna authorization is being confirmed. The order will update automatically.') ); } } catch (\Throwable $exception) { $this->logger->warning('Oceanpayment Klarna browser callback was rejected', [ 'exception' => $exception, ]); $this->messageManager->addErrorMessage( __('The Klarna payment result could not be verified. Please contact customer service if charged.') ); } return $result->setPath('checkout/onepage/success'); } }