Code Duplication    Length = 20-20 lines in 2 locations

Controllers/Frontend/PaymentKlarna.php 2 locations

@@ 1008-1027 (lines=20) @@
1005
            $this->plugin->savePayment($this->plugin->getPayment()->getId());
1006
            Shopware()->Session()->sOrderVariables['sUserData'] = $this->getUserData();
1007
1008
            if ($order['status'] == 'checkout_complete') {
1009
                $this->plugin->klarnaLog(
1010
                    "Entering Shopware_Controllers_Frontend_PaymentKlarna::returnAction: " .
1011
                    "checkout_complete. Save oder if session values match.",
1012
                    3
1013
                );
1014
                if (Shopware()->Session()->offsetGet('KlarnaTransactionId') == null) {
1015
                    $this->plugin->klarnaLog(
1016
                        "Entering Shopware_Controllers_Frontend_PaymentKlarna::returnAction: " .
1017
                        "Session matches. Order will be saved",
1018
                        3
1019
                    );
1020
                    Shopware()->Session()->offsetSet('KlarnaTransactionId', $transactionId);
1021
                    $orderNumber = $this->saveOrder(
1022
                        $order['reservation'],
1023
                        $order['reference']
1024
                    );
1025
                    Shopware()->Session()->offsetSet('KlarnaTransactionId', null);
1026
                }
1027
            }
1028
1029
1030
            if (empty($orderNumber) && !empty($order['merchant_reference']['orderid1'])) {
@@ 1339-1358 (lines=20) @@
1336
        $this->plugin->savePayment($this->plugin->getPayment()->getId());
1337
        Shopware()->Session()->sOrderVariables['sUserData'] = $this->getUserData();
1338
1339
        if ($order['status'] == 'checkout_complete') {
1340
            $this->plugin->klarnaLog(
1341
                "Entering Shopware_Controllers_Frontend_PaymentKlarna::returnAction: " .
1342
                "checkout_complete. Save oder if session values match.",
1343
                3
1344
            );
1345
            if (Shopware()->Session()->offsetGet('KlarnaTransactionId') == null) {
1346
                $this->plugin->klarnaLog(
1347
                    "Entering Shopware_Controllers_Frontend_PaymentKlarna::returnAction: " .
1348
                    "Session matches. Order will be saved",
1349
                    3
1350
                );
1351
                Shopware()->Session()->offsetSet('KlarnaTransactionId', $transactionId);
1352
                $orderNumber = $this->saveOrder(
1353
                    $order['reservation'],
1354
                    $order['reference']
1355
                );
1356
                Shopware()->Session()->offsetSet('KlarnaTransactionId', null);
1357
            }
1358
        }
1359
1360
        if (empty($orderNumber) && !empty($order['merchant_reference']['orderid1'])) {
1361
            $orderNumber = $order['merchant_reference']['orderid1'];