Code Duplication    Length = 7-8 lines in 2 locations

system/modules/Money/Money.php 1 location

@@ 38-44 (lines=7) @@
35
            $pay = new Money\Pay($pay);
36
            $pay->save();
37
        }
38
        switch ($method['type']) {
39
            case 'transfer':
40
                $sum = $pay->sum / $method['transfer']->rate;
41
                break;
42
            default:
43
                $sum = $pay->sum;
44
        }
45
        $className = 'Money\MerchantHelper\\' . $objectName;
46
        return $className::goToMerchant($pay->id, $sum, $method['currency'], $merchantOptions['description'], $merchantOptions['success'], $merchantOptions['false']);
47
    }

system/modules/Money/objects/MerchantHelper.php 1 location

@@ 46-53 (lines=8) @@
43
    }
44
45
    public static function getFinalSum($pay, $method) {
46
        switch ($method['type']) {
47
            case 'transfer':
48
                $sum = $pay->sum / $method['transfer']->rate;
49
                break;
50
            default:
51
                $sum = $pay->sum;
52
                break;
53
        }
54
        return $sum;
55
    }
56