Completed
Push — master ( 6e0e1d...0afdc4 )
by Alexey
04:12
created
system/modules/Money/appControllers/MoneyController.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -22,23 +22,23 @@  discard block
 block discarded – undo
22 22
             $transfer->save();
23 23
 
24 24
             $wallets = $this->money->getUserWallets();
25
-            $text = 'Перевод средств для ' . $transfer->toUser->name();
25
+            $text = 'Перевод средств для '.$transfer->toUser->name();
26 26
             $wallets[$transfer->currency_id]->diff(-$transfer->amount, $text);
27
-            \App::$cur->users->AddUserActivity($transfer->user_id, 4, $text . '<br />' . (float) $transfer->amount . ' ' . $wallets[$transfer->currency_id]->currency->acronym());
27
+            \App::$cur->users->AddUserActivity($transfer->user_id, 4, $text.'<br />'.(float) $transfer->amount.' '.$wallets[$transfer->currency_id]->currency->acronym());
28 28
 
29 29
             $block = new Money\Wallet\Block();
30 30
             $block->wallet_id = $wallets[$transfer->currency_id]->id;
31 31
             $block->amount = $transfer->amount;
32
-            $block->comment = 'Заблокированно на перевод средств для ' . $transfer->toUser->name();
33
-            $block->data = 'Money\Transfer:' . $transfer->id;
32
+            $block->comment = 'Заблокированно на перевод средств для '.$transfer->toUser->name();
33
+            $block->data = 'Money\Transfer:'.$transfer->id;
34 34
             $block->save();
35 35
 
36
-            $from = 'noreply@' . INJI_DOMAIN_NAME;
36
+            $from = 'noreply@'.INJI_DOMAIN_NAME;
37 37
             $to = \Users\User::$cur->mail;
38 38
             $subject = 'Подтверждение перевода';
39
-            $text = 'Чтобы подтвержить перевод №' . $transfer->id . ' введите код <b>' . $transfer->code . '</b> на <a href = "http://' . INJI_DOMAIN_NAME . '/money/confirmTransfer/' . $transfer->id . '?code=' . $transfer->code . '">странице</a> перевода';
39
+            $text = 'Чтобы подтвержить перевод №'.$transfer->id.' введите код <b>'.$transfer->code.'</b> на <a href = "http://'.INJI_DOMAIN_NAME.'/money/confirmTransfer/'.$transfer->id.'?code='.$transfer->code.'">странице</a> перевода';
40 40
             Tools::sendMail($from, $to, $subject, $text);
41
-            Tools::redirect('/money/confirmTransfer/' . $transfer->id);
41
+            Tools::redirect('/money/confirmTransfer/'.$transfer->id);
42 42
         }
43 43
         $this->view->setTitle('Перевод средств');
44 44
         $this->view->page(['data' => compact('form')]);
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
                 Msg::add('Код не совпадает', 'danger');
56 56
             } else {
57 57
                 $transfer->complete = 1;
58
-                $block = Money\Wallet\Block::get('Money\Transfer:' . $transfer->id, 'data');
58
+                $block = Money\Wallet\Block::get('Money\Transfer:'.$transfer->id, 'data');
59 59
                 $block->delete();
60 60
                 $wallets = $this->money->getUserWallets($transfer->to_user_id);
61
-                $text = 'Перевод средств от ' . $transfer->user->name() . '.' . ($transfer->comment ? ' Комментарий:' . $transfer->comment : '');
61
+                $text = 'Перевод средств от '.$transfer->user->name().'.'.($transfer->comment ? ' Комментарий:'.$transfer->comment : '');
62 62
                 $wallets[$transfer->currency_id]->diff($transfer->amount, $text);
63
-                \App::$cur->users->AddUserActivity($transfer->to_user_id, 4, $text . '<br />' . (float) $transfer->amount . ' ' . $wallets[$transfer->currency_id]->currency->acronym());
63
+                \App::$cur->users->AddUserActivity($transfer->to_user_id, 4, $text.'<br />'.(float) $transfer->amount.' '.$wallets[$transfer->currency_id]->currency->acronym());
64 64
                 $transfer->save();
65 65
                 Tools::redirect('/users/cabinet', 'Перевод был успешно завершен', 'success');
66 66
             }
@@ -92,12 +92,12 @@  discard block
 block discarded – undo
92 92
                 'currency_id' => $currency->id,
93 93
                 'sum' => (float) str_replace(',', '.', $_POST['amount']),
94 94
                 'type' => 'refill',
95
-                'description' => 'Пополнение баланса ' . $currency->name(),
95
+                'description' => 'Пополнение баланса '.$currency->name(),
96 96
                 'callback_module' => 'Money',
97 97
                 'callback_method' => 'refillPayRecive'
98 98
             ]);
99 99
             $pay->save();
100
-            Tools::redirect('/money/merchants/pay/' . $pay->id);
100
+            Tools::redirect('/money/merchants/pay/'.$pay->id);
101 101
         } else {
102 102
             $currencies = Money\Currency::getList(['where' => ['refill', 1], 'forSelect' => true]);
103 103
             $this->view->setTitle('Пополнение счета');
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
                 $error = true;
147 147
             }
148 148
             if (!$error) {
149
-                $wallets[$currency->id]->diff(-$amount, 'Обмен валюты на ' . $targetCurrency->name());
150
-                $wallets[$targetCurrency->id]->diff($amount * $rate->rate, 'Обмне валюты с ' . $currency->name());
149
+                $wallets[$currency->id]->diff(-$amount, 'Обмен валюты на '.$targetCurrency->name());
150
+                $wallets[$targetCurrency->id]->diff($amount * $rate->rate, 'Обмне валюты с '.$currency->name());
151 151
                 Tools::redirect('/users/cabinet', 'Обмен был успешно проведен');
152 152
             }
153 153
         }
@@ -163,21 +163,21 @@  discard block
 block discarded – undo
163 163
         }
164 164
         $wallet = Money\Wallet::get((int) $walletId);
165 165
         if (!$wallet || $wallet->user_id != \Users\User::$cur->id) {
166
-            Tools::redirect('/money/merchants/pay/' . $pay->id, 'Такой кошелек не найден');
166
+            Tools::redirect('/money/merchants/pay/'.$pay->id, 'Такой кошелек не найден');
167 167
         }
168 168
         if ($pay->currency_id != $wallet->currency_id) {
169 169
             $rate = \Money\Currency\ExchangeRate::get([['currency_id', $wallet->currency_id], ['target_currency_id', $pay->currency_id]]);
170 170
             if (!$rate) {
171
-                Tools::redirect('/money/merchants/pay/' . $pay->id, 'Нет возможности оплатить счет в валюте ' . $pay->currency->name() . ' валютой ' . $wallet->currency->name());
171
+                Tools::redirect('/money/merchants/pay/'.$pay->id, 'Нет возможности оплатить счет в валюте '.$pay->currency->name().' валютой '.$wallet->currency->name());
172 172
             }
173 173
             $sum = $pay->sum / $rate->rate;
174 174
         } else {
175 175
             $sum = $pay->sum;
176 176
         }
177 177
         if ($sum > $wallet->amount) {
178
-            Tools::redirect('/money/merchants/pay/' . $pay->id, 'На вашем счете недостаточно средств', 'danger');
178
+            Tools::redirect('/money/merchants/pay/'.$pay->id, 'На вашем счете недостаточно средств', 'danger');
179 179
         }
180
-        $wallet->diff(-$sum, 'Оплата счета №' . $payId);
180
+        $wallet->diff(-$sum, 'Оплата счета №'.$payId);
181 181
         $statuses = \Money\Pay\Status::getList(['key' => 'code']);
182 182
         if (!empty($statuses['success'])) {
183 183
             $pay->pay_status_id = $statuses['success']->id;
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         }
199 199
         $merchant = \Money\MerchantHelper\Primary::getMerchant();
200 200
         if (!$merchant->active) {
201
-            Tools::redirect('/money/merchants/pay/' . $pay->id, 'Этот способ оплаты недоступен');
201
+            Tools::redirect('/money/merchants/pay/'.$pay->id, 'Этот способ оплаты недоступен');
202 202
         }
203 203
         $allowCurrencies = $merchant->allowCurrencies($pay);
204 204
         $method = [];
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
         if (!$method) {
212 212
             Tools::redirect('/', 'Валюта для этого способа оплаты не найдена', 'danger');
213 213
         }
214
-        $className = 'Money\MerchantHelper\\' . $merchant->object_name;
214
+        $className = 'Money\MerchantHelper\\'.$merchant->object_name;
215 215
         $sum = $className::getFinalSum($pay, $method);
216 216
         $this->view->setTitle('Прямая оплата');
217 217
         $this->view->page(['data' => compact('pay', 'sum', 'method')]);
Please login to merge, or discard this patch.
system/modules/Money/widgets/cabinet/walletHistory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
     $table->addRow([
39 39
         $history->id,
40 40
         $history->wallet->currency->name(),
41
-        '<span class = "' . ($amount > 0 ? "text-success" : 'text-danger') . '">' . $amount . '</span>',
41
+        '<span class = "'.($amount > 0 ? "text-success" : 'text-danger').'">'.$amount.'</span>',
42 42
         $history->comment,
43 43
         $history->date_create
44 44
     ]);
Please login to merge, or discard this patch.
system/modules/Money/objects/CompleteTransfer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
             $transfer->confirm();
44 44
         }
45 45
         $count = count($transfers);
46
-        return 'Завершено <b>' . $count . '</b> ' . \Tools::getNumEnding($count, ['перевод', 'перевода', 'переводов']);
46
+        return 'Завершено <b>'.$count.'</b> '.\Tools::getNumEnding($count, ['перевод', 'перевода', 'переводов']);
47 47
     }
48 48
 
49 49
 }
Please login to merge, or discard this patch.
system/modules/Money/objects/ClosePayBtn.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
             }
50 50
         }
51 51
         $count = count($pays);
52
-        return 'Оплачено <b>' . $count . '</b> ' . \Tools::getNumEnding($pays, ['счет', 'счета', 'счетов']);
52
+        return 'Оплачено <b>'.$count.'</b> '.\Tools::getNumEnding($pays, ['счет', 'счета', 'счетов']);
53 53
     }
54 54
 
55 55
 }
Please login to merge, or discard this patch.
system/modules/Money/objects/CancelTransfer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
             $transfer->cancel();
44 44
         }
45 45
         $count = count($transfers);
46
-        return 'Отменено <b>' . $count . '</b> ' . \Tools::getNumEnding($count, ['перевод', 'перевода', 'переводов']);
46
+        return 'Отменено <b>'.$count.'</b> '.\Tools::getNumEnding($count, ['перевод', 'перевода', 'переводов']);
47 47
     }
48 48
 
49 49
 }
Please login to merge, or discard this patch.
system/modules/Money/objects/MerchantHelper/Wallet.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
     public static function goToMerchant($payId, $amount, $currency, $description = '', $success = '/', $false = '/')
22 22
     {
23 23
         $wallets = \App::$cur->money->getUserWallets();
24
-        \Tools::redirect('/money/walletPay/' . $payId . '/' . $wallets[$currency->id]->id);
24
+        \Tools::redirect('/money/walletPay/'.$payId.'/'.$wallets[$currency->id]->id);
25 25
     }
26 26
 
27 27
 }
Please login to merge, or discard this patch.
system/modules/Money/objects/MerchantHelper/Primary.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,14 +20,14 @@
 block discarded – undo
20 20
 
21 21
     public static function goToMerchant($payId, $amount, $currency, $description = '', $success = '/', $false = '/')
22 22
     {
23
-        \Tools::redirect('/money/primaryPay/' . $payId . '/' . $currency->id);
23
+        \Tools::redirect('/money/primaryPay/'.$payId.'/'.$currency->id);
24 24
     }
25 25
 
26 26
     public static function getFinalSum($pay, $method)
27 27
     {
28 28
         $sum = parent::getFinalSum($pay, $method);
29 29
         if ($pay->data && $cart = \Ecommerce\Cart::get($pay->data)) {
30
-            $extra = '0.' . (strlen((string) $cart->id) > 1 ? substr((string) $cart->id, -2) : $cart->id);
30
+            $extra = '0.'.(strlen((string) $cart->id) > 1 ? substr((string) $cart->id, -2) : $cart->id);
31 31
         } else {
32 32
             $extra = 0;
33 33
         }
Please login to merge, or discard this patch.
system/modules/Money/objects/MerchantHelper/Payeer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             $data['m_key']
35 35
         );
36 36
         $data['m_sign'] = strtoupper(hash('sha256', implode(':', $arHash)));
37
-        \Tools::redirect('http://payeer.com/merchant/?' . http_build_query($data));
37
+        \Tools::redirect('http://payeer.com/merchant/?'.http_build_query($data));
38 38
     }
39 39
 
40 40
     public static function reciver($data, $status)
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
                 $m_key);
58 58
             $sign_hash = strtoupper(hash('sha256', implode(':', $arHash)));
59 59
             if ($_POST['m_sign'] == $sign_hash && $_POST['m_status'] == 'success') {
60
-                $result['callback'] = $_POST['m_orderid'] . '|success';
60
+                $result['callback'] = $_POST['m_orderid'].'|success';
61 61
                 $result['payId'] = $data["m_orderid"];
62 62
                 $result['status'] = 'success';
63 63
             } else {
64
-                $result['callback'] = $_POST['m_orderid'] . '|error';
64
+                $result['callback'] = $_POST['m_orderid'].'|error';
65 65
             }
66 66
         }
67 67
 
Please login to merge, or discard this patch.
system/modules/Money/objects/MerchantHelper/PerfectMoney.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         $request['PAYMENT_AMOUNT'] = $amount;
26 26
         $request['PAYMENT_UNITS'] = $merchantCurrency->code;
27 27
         $request['SUGGESTED_MEMO'] = $description;
28
-        $request['STATUS_URL'] = 'http://' . INJI_DOMAIN_NAME . '/money/merchants/reciver/PerfectMoney';
28
+        $request['STATUS_URL'] = 'http://'.INJI_DOMAIN_NAME.'/money/merchants/reciver/PerfectMoney';
29 29
         $request['PAYMENT_URL'] = $success;
30 30
         $request['NOPAYMENT_URL'] = $false;
31 31
         $request['PAYMENT_METHOD'] = 'PerfectMoney account';
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
 
51 51
         $config = static::getConfig();
52 52
 
53
-        $string = $_POST['PAYMENT_ID'] . ':' . $_POST['PAYEE_ACCOUNT'] . ':' .
54
-                $_POST['PAYMENT_AMOUNT'] . ':' . $_POST['PAYMENT_UNITS'] . ':' .
55
-                $_POST['PAYMENT_BATCH_NUM'] . ':' .
56
-                $_POST['PAYER_ACCOUNT'] . ':' . strtoupper(md5($config['secret'])) . ':' .
53
+        $string = $_POST['PAYMENT_ID'].':'.$_POST['PAYEE_ACCOUNT'].':'.
54
+                $_POST['PAYMENT_AMOUNT'].':'.$_POST['PAYMENT_UNITS'].':'.
55
+                $_POST['PAYMENT_BATCH_NUM'].':'.
56
+                $_POST['PAYER_ACCOUNT'].':'.strtoupper(md5($config['secret'])).':'.
57 57
                 $_POST['TIMESTAMPGMT'];
58 58
 
59 59
         $hash = strtoupper(md5($string));
Please login to merge, or discard this patch.