Code Duplication    Length = 4-5 lines in 10 locations

application/modules/payment_method_2checkout/payment_method_2checkout.php 1 location

@@ 106-110 (lines=5) @@
103
        $price = $param->getDeliveryPrice() ? ($param->getTotalPrice() + $param->getDeliveryPrice()) : $param->getTotalPrice();
104
        $code = \Currency\Currency::create()->getMainCurrency()->getCode();
105
106
        if ($paySettings['merchant_currency']) {
107
            $arrPriceCode = $this->convert($price, $paySettings['merchant_currency']);
108
            $price = $arrPriceCode['price'];
109
            $code = $arrPriceCode['code'];
110
        }
111
112
        if ($paySettings['merchant_markup']) {
113
            $price = $this->markup($price, $paySettings['merchant_markup']);

application/modules/payment_method_interkassa/payment_method_interkassa.php 1 location

@@ 105-109 (lines=5) @@
102
        $price = $param->getDeliveryPrice() ? ($param->getTotalPrice() + $param->getDeliveryPrice()) : $param->getTotalPrice();
103
        $code = \Currency\Currency::create()->getMainCurrency()->getCode();
104
105
        if ($paySettings['merchant_currency']) {
106
            $arrPriceCode = $this->convert($price, $paySettings['merchant_currency']);
107
            $price = $arrPriceCode['price'];
108
            $code = $arrPriceCode['code'];
109
        }
110
111
        if ($paySettings['merchant_markup']) {
112
            $price = $this->markup($price, $paySettings['merchant_markup']);

application/modules/payment_method_liqpay/payment_method_liqpay.php 1 location

@@ 105-109 (lines=5) @@
102
        $price = $param->getDeliveryPrice() ? ($param->getTotalPrice() + $param->getDeliveryPrice()) : $param->getTotalPrice();
103
        $code = \Currency\Currency::create()->getMainCurrency()->getCode();
104
105
        if ($paySettings['merchant_currency']) {
106
            $arrPriceCode = $this->convert($price, $paySettings['merchant_currency']);
107
            $price = $arrPriceCode['price'];
108
            $code = $arrPriceCode['code'];
109
        }
110
111
        if ($paySettings['merchant_markup']) {
112
            $price = $this->markup($price, $paySettings['merchant_markup']);

application/modules/payment_method_oschadbank/payment_method_oschadbank.php 1 location

@@ 282-285 (lines=4) @@
279
        // ціна доставки
280
        $userData['sum'] = $_POST['price'];
281
282
        if ($userData['merchant_currency']) {
283
            $arrPriceCode = $this->convert($userData['sum'], $userData['merchant_currency']);
284
            $userData['sum'] = $arrPriceCode['price'];
285
        }
286
287
        if ($userData['merchant_markup']) {
288
            $userData['sum'] = $this->markup($userData['sum'], $userData['merchant_markup']);

application/modules/payment_method_paypal/payment_method_paypal.php 1 location

@@ 107-111 (lines=5) @@
104
        $price = $param->getDeliveryPrice() ? ($param->getTotalPrice() + $param->getDeliveryPrice()) : $param->getTotalPrice();
105
        $code = \Currency\Currency::create()->getMainCurrency()->getCode();
106
107
        if ($paySettings['merchant_currency']) {
108
            $arrPriceCode = $this->convert($price, $paySettings['merchant_currency']);
109
            $price = $arrPriceCode['price'];
110
            $code = $arrPriceCode['code'];
111
        }
112
113
        if ($paySettings['merchant_markup']) {
114
            $price = $this->markup($price, $paySettings['merchant_markup']);

application/modules/payment_method_robokassa/payment_method_robokassa.php 1 location

@@ 107-110 (lines=4) @@
104
        $inv_id = $param->getId();
105
        $out_summ = $price = $param->getDeliveryPrice() ? ($param->getTotalPrice() + $param->getDeliveryPrice()) : $param->getTotalPrice();
106
107
        if ($paySettings['merchant_currency']) {
108
            $arrPriceCode = $this->convert($out_summ, $paySettings['merchant_currency']);
109
            $out_summ = $arrPriceCode['price'];
110
        }
111
112
        if ($paySettings['merchant_markup']) {
113
            $out_summ = $this->markup($price, $paySettings['merchant_markup']);

application/modules/payment_method_sberbank/payment_method_sberbank.php 1 location

@@ 237-240 (lines=4) @@
234
235
        // Draw amount
236
        $amount = $_POST['price'];
237
        if ($data['merchant_currency']) {
238
            $arrPriceCode = $this->convert($amount, $data['merchant_currency']);
239
            $amount = $arrPriceCode['price'];
240
        }
241
242
        if ($data['merchant_markup']) {
243
            $amount = $this->markup($amount, $data['merchant_markup']);

application/modules/payment_method_yakassa/payment_method_yakassa.php 1 location

@@ 104-107 (lines=4) @@
101
        $descr = 'OrderId: ' . $param->id . '; Key: ' . $param->getKey();
102
        $price = $param->getDeliveryPrice() ? ($param->getTotalPrice() + $param->getDeliveryPrice()) : $param->getTotalPrice();
103
104
        if ($paySettings['merchant_currency']) {
105
            $arrPriceCode = $this->convert($price, $paySettings['merchant_currency']);
106
            $price = $arrPriceCode['price'];
107
        }
108
109
        if ($paySettings['merchant_markup']) {
110
            $price = $this->markup($price, $paySettings['merchant_markup']);

application/modules/payment_method_webmoney/payment_method_webmoney.php 1 location

@@ 104-108 (lines=5) @@
101
        $descr = 'OrderId: ' . $param->id . '; Key: ' . $param->getKey();
102
        $price = $param->getDeliveryPrice() ? ($param->getTotalPrice() + $param->getDeliveryPrice()) : $param->getTotalPrice();
103
        $code = \Currency\Currency::create()->getMainCurrency()->getCode();
104
        if ($paySettings['merchant_currency']) {
105
            $arrPriceCode = $this->convert($price, $paySettings['merchant_currency']);
106
            $price = $arrPriceCode['price'];
107
            $code = $arrPriceCode['code'];
108
        }
109
110
        if ($paySettings['merchant_markup']) {
111
            $price = $this->markup($price, $paySettings['merchant_markup']);

application/modules/payment_method_walletone/payment_method_walletone.php 1 location

@@ 118-122 (lines=5) @@
115
116
        $code = \Currency\Currency::create()->getMainCurrency()->getCode();
117
118
        if ($paySettings['merchant_currency']) {
119
            $arrPriceCode = $this->convert($price, $paySettings['merchant_currency']);
120
            $price = $arrPriceCode['price'];
121
            $code = $arrPriceCode['code'];
122
        }
123
124
        if ($paySettings['merchant_markup']) {
125
            $price = $this->markup($price, $paySettings['merchant_markup']);