Code Duplication    Length = 6-12 lines in 2 locations

core/modules/shop/ShopTransactionController.php 2 locations

@@ 263-268 (lines=6) @@
260
                $this->updateFromCart($transaction);
261
                $session = new Ajde_Session('AC.Shop');
262
                $session->set('currentTransaction', $transaction->getPK());
263
                if (!$transaction->shipment_itemsqty > 0) {
264
                    return [
265
                        'success' => false,
266
                        'message' => trans('No items added to current order'),
267
                    ];
268
                }
269
270
                return [
271
                    'success' => true,
@@ 284-295 (lines=12) @@
281
        $transaction->payment_amount = $transaction->shipment_itemstotal + $transaction->shipment_cost;
282
283
        // Update current transaction
284
        if ($transaction->save()) {
285
            if (!$transaction->shipment_itemsqty > 0) {
286
                return [
287
                    'success' => false,
288
                    'message' => trans('No items added to current transaction'),
289
                ];
290
            }
291
292
            return [
293
                'success' => true,
294
            ];
295
        }
296
297
        // Everything else failed
298
        return [