Code Duplication    Length = 5-5 lines in 2 locations

Controllers/Backend/PaymentKlarna.php 2 locations

@@ 123-127 (lines=5) @@
120
        $service = $this->getService($order);
121
        $detailStatus = $this->modelManager->find('\Shopware\Models\Order\DetailStatus', 3);
122
        $paymentStatus = $this->plugin->Config()->get('activateStatusId');
123
        if (!empty($paymentStatus)) {
124
            $paymentStatus = $this->modelManager->find('\Shopware\Models\Order\Status', $paymentStatus);
125
        } else {
126
            $paymentStatus = null;
127
        }
128
129
        /** @var Shopware\Models\Order\Detail $position */
130
        foreach ($order->getDetails() as $position) {
@@ 247-251 (lines=5) @@
244
        $service = $this->getService($order);
245
        $detailStatus = $this->modelManager->find('\Shopware\Models\Order\DetailStatus', 2);
246
        $paymentStatus = $this->plugin->Config()->get('cancelStatusId');
247
        if (!empty($paymentStatus)) {
248
            $paymentStatus = $this->modelManager->find('\Shopware\Models\Order\Status', $paymentStatus);
249
        } else {
250
            $paymentStatus = null;
251
        }
252
253
        try {
254
            /** @var Shopware\Models\Order\Detail $position */