Code Duplication    Length = 20-20 lines in 2 locations

Controllers/Frontend/PaymentKlarna.php 2 locations

@@ 1098-1117 (lines=20) @@
1095
            $this->plugin->savePayment($this->plugin->getPayment()->getId());
1096
            Shopware()->Session()->sOrderVariables['sUserData'] = $this->getUserData();
1097
1098
            if ($order['status'] === 'checkout_complete') {
1099
                $this->plugin->klarnaLog(
1100
                    "Entering Shopware_Controllers_Frontend_PaymentKlarna::returnAction: " .
1101
                    "checkout_complete. Save oder if session values match.",
1102
                    3
1103
                );
1104
                if (Shopware()->Session()->offsetGet('KlarnaTransactionId') == null) {
1105
                    $this->plugin->klarnaLog(
1106
                        "Entering Shopware_Controllers_Frontend_PaymentKlarna::returnAction: " .
1107
                        "Session matches. Order will be saved",
1108
                        3
1109
                    );
1110
                    Shopware()->Session()->offsetSet('KlarnaTransactionId', $transactionId);
1111
                    $orderNumber = $this->saveOrder(
1112
                        $order['reservation'],
1113
                        $order['reference']
1114
                    );
1115
                    Shopware()->Session()->offsetSet('KlarnaTransactionId', null);
1116
                }
1117
            }
1118
1119
1120
            if (empty($orderNumber) && !empty($order['merchant_reference']['orderid1'])) {
@@ 1429-1448 (lines=20) @@
1426
        $this->plugin->savePayment($this->plugin->getPayment()->getId());
1427
        Shopware()->Session()->sOrderVariables['sUserData'] = $this->getUserData();
1428
1429
        if ($order['status'] == 'checkout_complete') {
1430
            $this->plugin->klarnaLog(
1431
                "Entering Shopware_Controllers_Frontend_PaymentKlarna::pushAction: " .
1432
                "checkout_complete. Save oder if session values match.",
1433
                3
1434
            );
1435
            if (Shopware()->Session()->offsetGet('KlarnaTransactionId') == null) {
1436
                $this->plugin->klarnaLog(
1437
                    "Entering Shopware_Controllers_Frontend_PaymentKlarna::pushAction: " .
1438
                    "Session matches. Order will be saved",
1439
                    3
1440
                );
1441
                Shopware()->Session()->offsetSet('KlarnaTransactionId', $transactionId);
1442
                $orderNumber = $this->saveOrder(
1443
                    $order['reservation'],
1444
                    $order['reference']
1445
                );
1446
                Shopware()->Session()->offsetSet('KlarnaTransactionId', null);
1447
            }
1448
        }
1449
1450
        if (empty($orderNumber) && !empty($order['merchant_reference']['orderid1'])) {
1451
            $orderNumber = $order['merchant_reference']['orderid1'];