Completed
Push — master ( 0fc305...2f7f6c )
by Alexey
06:05
created
system/modules/Money/appControllers/MerchantsController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
             'callback_method' => ''
22 22
                 ], null, [
23 23
             'description' => 'Тестовый платеж',
24
-            'success' => 'http://' . INJI_DOMAIN_NAME . '/',
25
-            'false' => 'http://' . INJI_DOMAIN_NAME . '/'
24
+            'success' => 'http://'.INJI_DOMAIN_NAME.'/',
25
+            'false' => 'http://'.INJI_DOMAIN_NAME.'/'
26 26
         ]);
27 27
     }
28 28
 
@@ -122,9 +122,9 @@  discard block
 block discarded – undo
122 122
             Tools::redirect('/', 'Валюта для этого способа оплаты не найдена', 'danger');
123 123
         }
124 124
         $merchantOptions = [
125
-            'description' => $pay->description ? '#' . $pay->id . ' ' . $pay->description : 'Оплата счета №' . $pay->id . ' на сайте: ' . idn_to_utf8(INJI_DOMAIN_NAME),
126
-            'success' => 'http://' . INJI_DOMAIN_NAME . '/',
127
-            'false' => 'http://' . INJI_DOMAIN_NAME . '/'
125
+            'description' => $pay->description ? '#'.$pay->id.' '.$pay->description : 'Оплата счета №'.$pay->id.' на сайте: '.idn_to_utf8(INJI_DOMAIN_NAME),
126
+            'success' => 'http://'.INJI_DOMAIN_NAME.'/',
127
+            'false' => 'http://'.INJI_DOMAIN_NAME.'/'
128 128
         ];
129 129
 
130 130
         $this->Money->goToMerchant($pay, $merchant, $method, $merchantOptions);
Please login to merge, or discard this patch.
system/modules/Money/appControllers/content/pays.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@
 block discarded – undo
17 17
             $pay->description,
18 18
             $pay->sum,
19 19
             $pay->currency->name(),
20
-            '<a href = "/money/merchants/pay/' . $pay->id . '" class="btn btn-success btn-sm">Оплатить</a>',
21
-            '<a href = "/money/merchants/cancelPay/' . $pay->id . '" class="btn btn-danger btn-sm">Отказаться</a>'
20
+            '<a href = "/money/merchants/pay/'.$pay->id.'" class="btn btn-success btn-sm">Оплатить</a>',
21
+            '<a href = "/money/merchants/cancelPay/'.$pay->id.'" class="btn btn-danger btn-sm">Отказаться</a>'
22 22
         ]);
23 23
     }
24 24
     $table->draw();
Please login to merge, or discard this patch.
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/Sums.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -61,21 +61,21 @@
 block discarded – undo
61 61
             if ($first) {
62 62
                 $first = false;
63 63
             } else {
64
-                $string.= '<br />';
64
+                $string .= '<br />';
65 65
             }
66
-            $string.= '<span style="white-space:nowrap;">';
67
-            $string.= number_format($sum, 2, '.', ' ');
66
+            $string .= '<span style="white-space:nowrap;">';
67
+            $string .= number_format($sum, 2, '.', ' ');
68 68
             if (\App::$cur->money) {
69 69
                 $currency = \Money\Currency::get($currency_id);
70 70
                 if ($currency) {
71
-                    $string.= ' ' . $currency->acronym();
71
+                    $string .= ' '.$currency->acronym();
72 72
                 } else {
73
-                    $string.= ' руб.';
73
+                    $string .= ' руб.';
74 74
                 }
75 75
             } else {
76
-                $string.= ' руб.';
76
+                $string .= ' руб.';
77 77
             }
78
-            $string.= '</span>';
78
+            $string .= '</span>';
79 79
         }
80 80
         return $string;
81 81
     }
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.