Code Duplication    Length = 6-11 lines in 2 locations

Controller/Paypal/Express.php 1 location

@@ 140-145 (lines=6) @@
137
        $oQuote = $this->checkoutSession->getQuote();
138
139
        if ($this->paymentHelper->isPayPalExpressActive() && $oQuote && $oQuote->hasItems()) {
140
            if ($this->loginNeededForExpressCheckout($oQuote)) {
141
                $this->messageManager->addNoticeMessage(__('Please sign in to check out.'));
142
143
                $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
144
                return $resultRedirect->setPath('customer/account/login');
145
            }
146
147
            $this->paypalPayment->setIsPayPalExpress(true);
148
            $aResponse = $this->genericRequest->sendRequest($oQuote, $this->paypalPayment);

Controller/Paypal/Returned.php 1 location

@@ 87-97 (lines=11) @@
84
    {
85
        $this->paypalPayment->setIsPayPalExpress(true);
86
        $sWorkorderId = $this->checkoutSession->getPayoneWorkorderId();
87
        if ($sWorkorderId) {
88
            try {
89
                $this->returnHandler->handlePayPalReturn($sWorkorderId);
90
91
                /** @var Redirect $resultRedirect */
92
                $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
93
                return $resultRedirect->setPath('payone/onepage/review');
94
            } catch (\Exception $e) {
95
                $this->messageManager->addExceptionMessage($e, __('An error occured during the PayPal Express transaction.'));
96
            }
97
        }
98
99
        /** @var Redirect $resultRedirect */
100
        $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);