@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | public static function itemName($item) |
40 | 40 | { |
41 | - return $item->pk() . '. ' . $item->name(); |
|
41 | + return $item->pk().'. '.$item->name(); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | public static $dataManagers = [ |
@@ -48,16 +48,16 @@ discard block |
||
48 | 48 | ], |
49 | 49 | 'name' => 'Переводы', |
50 | 50 | 'cols' => [ |
51 | - 'user_id', 'to_user_id', 'currency_id', 'amount', 'comment', 'complete', 'canceled','date_create' |
|
51 | + 'user_id', 'to_user_id', 'currency_id', 'amount', 'comment', 'complete', 'canceled', 'date_create' |
|
52 | 52 | ], |
53 | 53 | 'actions' => [ |
54 | 54 | 'Money\CancelTransfer', 'Money\CompleteTransfer' |
55 | 55 | ], |
56 | 56 | 'sortable' => [ |
57 | - 'user_id', 'to_user_id', 'currency_id', 'amount', 'comment', 'complete', 'canceled','date_create' |
|
57 | + 'user_id', 'to_user_id', 'currency_id', 'amount', 'comment', 'complete', 'canceled', 'date_create' |
|
58 | 58 | ], |
59 | 59 | 'filters' => [ |
60 | - 'user_id', 'to_user_id', 'currency_id', 'amount', 'comment', 'complete', 'canceled','date_create' |
|
60 | + 'user_id', 'to_user_id', 'currency_id', 'amount', 'comment', 'complete', 'canceled', 'date_create' |
|
61 | 61 | ] |
62 | 62 | ] |
63 | 63 | ]; |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | public function name() |
184 | 184 | { |
185 | - return 'Перевод на сумму ' . $this->amount . ' ' . $this->currency->name . ' от ' . $this->user->name() . ' для ' . $this->toUser->name(); |
|
185 | + return 'Перевод на сумму '.$this->amount.' '.$this->currency->name.' от '.$this->user->name().' для '.$this->toUser->name(); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | public function cancel() |
@@ -192,14 +192,14 @@ discard block |
||
192 | 192 | } |
193 | 193 | |
194 | 194 | $this->canceled = 1; |
195 | - $block = \Money\Wallet\Block::get('Money\Transfer:' . $this->id, 'data'); |
|
195 | + $block = \Money\Wallet\Block::get('Money\Transfer:'.$this->id, 'data'); |
|
196 | 196 | if ($block) { |
197 | 197 | $block->delete(); |
198 | 198 | } |
199 | 199 | $wallets = \App::$cur->money->getUserWallets($this->user_id); |
200 | 200 | $text = 'Отмена перевода средств'; |
201 | 201 | $wallets[$this->currency_id]->diff($this->amount, $text); |
202 | - \App::$cur->users->AddUserActivity($this->user_id, 4, $text . '<br />' . (float) $this->amount . ' ' . $wallets[$this->currency_id]->currency->acronym()); |
|
202 | + \App::$cur->users->AddUserActivity($this->user_id, 4, $text.'<br />'.(float) $this->amount.' '.$wallets[$this->currency_id]->currency->acronym()); |
|
203 | 203 | $this->save(); |
204 | 204 | return true; |
205 | 205 | } |
@@ -211,14 +211,14 @@ discard block |
||
211 | 211 | } |
212 | 212 | |
213 | 213 | $this->complete = 1; |
214 | - $block = \Money\Wallet\Block::get('Money\Transfer:' . $this->id, 'data'); |
|
214 | + $block = \Money\Wallet\Block::get('Money\Transfer:'.$this->id, 'data'); |
|
215 | 215 | if ($block) { |
216 | 216 | $block->delete(); |
217 | 217 | } |
218 | 218 | $wallets = \App::$cur->money->getUserWallets($this->to_user_id); |
219 | - $text = 'Перевод средств от ' . $this->user->name() . '.' . ($this->comment ? ' Комментарий:' . $this->comment : ''); |
|
219 | + $text = 'Перевод средств от '.$this->user->name().'.'.($this->comment ? ' Комментарий:'.$this->comment : ''); |
|
220 | 220 | $wallets[$this->currency_id]->diff($this->amount, $text); |
221 | - \App::$cur->users->AddUserActivity($this->to_user_id, 4, $text . '<br />' . (float) $this->amount . ' ' . $wallets[$this->currency_id]->currency->acronym()); |
|
221 | + \App::$cur->users->AddUserActivity($this->to_user_id, 4, $text.'<br />'.(float) $this->amount.' '.$wallets[$this->currency_id]->currency->acronym()); |
|
222 | 222 | $this->save(); |
223 | 223 | return true; |
224 | 224 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -return function ($step = NULL, $params = []) { |
|
3 | +return function($step = NULL, $params = []) { |
|
4 | 4 | |
5 | 5 | $currencies = [ |
6 | 6 | [ |
@@ -46,22 +46,22 @@ discard block |
||
46 | 46 | [ |
47 | 47 | 'name' => 'Wallet One', |
48 | 48 | 'object_name' => 'WalletOne', |
49 | - 'image_file_id' => App::$cur->Files->uploadFromUrl(__DIR__ . '/static/images/WalletOne.png') |
|
49 | + 'image_file_id' => App::$cur->Files->uploadFromUrl(__DIR__.'/static/images/WalletOne.png') |
|
50 | 50 | ], |
51 | 51 | [ |
52 | 52 | 'name' => 'Robokassa', |
53 | 53 | 'object_name' => 'Robokassa', |
54 | - 'image_file_id' => App::$cur->Files->uploadFromUrl(__DIR__ . '/static/images/Robokassa.png') |
|
54 | + 'image_file_id' => App::$cur->Files->uploadFromUrl(__DIR__.'/static/images/Robokassa.png') |
|
55 | 55 | ], |
56 | 56 | [ |
57 | 57 | 'name' => 'Payeer', |
58 | 58 | 'object_name' => 'Payeer', |
59 | - 'image_file_id' => App::$cur->Files->uploadFromUrl(__DIR__ . '/static/images/Payeer.png') |
|
59 | + 'image_file_id' => App::$cur->Files->uploadFromUrl(__DIR__.'/static/images/Payeer.png') |
|
60 | 60 | ], |
61 | 61 | [ |
62 | 62 | 'name' => 'PerfectMoney', |
63 | 63 | 'object_name' => 'PerfectMoney', |
64 | - 'image_file_id' => App::$cur->Files->uploadFromUrl(__DIR__ . '/static/images/PerfectMoney.png') |
|
64 | + 'image_file_id' => App::$cur->Files->uploadFromUrl(__DIR__.'/static/images/PerfectMoney.png') |
|
65 | 65 | ], |
66 | 66 | ]; |
67 | 67 | $merchantsConfig = [ |
@@ -21,8 +21,8 @@ discard block |
||
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 |
||
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); |
@@ -17,8 +17,8 @@ |
||
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(); |
@@ -22,23 +22,23 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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')]); |
@@ -38,7 +38,7 @@ |
||
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 | ]); |
@@ -43,7 +43,7 @@ |
||
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 | } |
@@ -49,7 +49,7 @@ |
||
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 | } |
@@ -43,7 +43,7 @@ |
||
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 | } |