@@ -24,8 +24,9 @@ discard block |
||
24 | 24 | |
25 | 25 | $result['payId'] = $data["InvId"]; |
26 | 26 | |
27 | - if (strtolower($data['SignatureValue']) == $hashGenerated) |
|
28 | - $result['status'] = 'success'; |
|
27 | + if (strtolower($data['SignatureValue']) == $hashGenerated) { |
|
28 | + $result['status'] = 'success'; |
|
29 | + } |
|
29 | 30 | |
30 | 31 | return $result; |
31 | 32 | } |
@@ -43,7 +44,8 @@ discard block |
||
43 | 44 | ]; |
44 | 45 | if (empty($config['test'])) { |
45 | 46 | \Tools::redirect('https://auth.robokassa.ru/Merchant/Index.aspx?' . http_build_query($data)); |
46 | - } else { |
|
47 | + } |
|
48 | + else { |
|
47 | 49 | \Tools::redirect('http://test.robokassa.ru/Index.aspx?' . http_build_query($data)); |
48 | 50 | } |
49 | 51 | } |
@@ -2,7 +2,7 @@ |
||
2 | 2 | <?php |
3 | 3 | $blocked = App::$cur->money->getUserBlocks(); |
4 | 4 | $wallets = App::$cur->money->getUserWallets(); |
5 | -foreach ($wallets as $wallet) { |
|
5 | +foreach ($wallets as $wallet) { |
|
6 | 6 | ?> |
7 | 7 | <b><?= $wallet->showAmount(); ?></b> <?= $wallet->currency->acronym(); ?><br /> |
8 | 8 | <?php |
@@ -2,17 +2,18 @@ discard block |
||
2 | 2 | <?php |
3 | 3 | $currency_id = !empty($_GET['currency_id']) ? (int) $_GET['currency_id'] : 0; |
4 | 4 | $wallets = App::$cur->money->getUserWallets(); |
5 | -if ($currency_id && empty($wallets[$currency_id])) { |
|
5 | +if ($currency_id && empty($wallets[$currency_id])) { |
|
6 | 6 | Msg::add('У вас нет такого кошелька'); |
7 | 7 | Msg::show(); |
8 | 8 | return; |
9 | 9 | } |
10 | 10 | |
11 | -if ($currency_id) { |
|
11 | +if ($currency_id) { |
|
12 | 12 | $ids = $wallets[$currency_id]->id; |
13 | -} else { |
|
13 | +} |
|
14 | +else { |
|
14 | 15 | $ids = []; |
15 | - foreach ($wallets as $wallet) { |
|
16 | + foreach ($wallets as $wallet) { |
|
16 | 17 | $ids[] = $wallet->id; |
17 | 18 | } |
18 | 19 | $ids = implode(',', $ids); |
@@ -33,7 +34,7 @@ discard block |
||
33 | 34 | 'start' => $pages->params['start'], |
34 | 35 | 'limit' => $pages->params['limit'], |
35 | 36 | ]); |
36 | -foreach ($histories as $history) { |
|
37 | +foreach ($histories as $history) { |
|
37 | 38 | $amount = $history->amount; |
38 | 39 | $table->addRow([ |
39 | 40 | $history->id, |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <h3>Мои кошельки</h3> |
2 | 2 | <div class="row"> |
3 | 3 | <?php |
4 | - $blocked = App::$cur->money->getUserBlocks(); |
|
5 | - $wallets = App::$cur->money->getUserWallets(); |
|
6 | - $rates = Money\Currency\ExchangeRate::getList(); |
|
7 | - foreach ($wallets as $wallet) { |
|
8 | - ?> |
|
4 | + $blocked = App::$cur->money->getUserBlocks(); |
|
5 | + $wallets = App::$cur->money->getUserWallets(); |
|
6 | + $rates = Money\Currency\ExchangeRate::getList(); |
|
7 | + foreach ($wallets as $wallet) { |
|
8 | + ?> |
|
9 | 9 | <div class="col-sm-4"> |
10 | 10 | <h4><?= $wallet->currency->name(); ?></h4> |
11 | 11 | <b><?= $wallet->showAmount(); ?></b> <?= $wallet->currency->acronym(); ?><br /> |
@@ -12,8 +12,8 @@ discard block |
||
12 | 12 | <h3>Уровни начислений</h3> |
13 | 13 | <ul> |
14 | 14 | <?php |
15 | - foreach ($reward->levels(['order' => ['level', 'asc']]) as $level) { |
|
16 | - ?> |
|
15 | + foreach ($reward->levels(['order' => ['level', 'asc']]) as $level) { |
|
16 | + ?> |
|
17 | 17 | |
18 | 18 | <li><?= !$level->level ? 'Личный' : $level->level; ?>. <?= $types[$level->type]['viewer']($level); ?></li> |
19 | 19 | <?php |
@@ -34,14 +34,14 @@ discard block |
||
34 | 34 | <h4 class="<?= $complete ? 'text-success' : 'text-danger'; ?>"><?= $condition->name(); ?></h4> |
35 | 35 | <ul> |
36 | 36 | <?php |
37 | - foreach ($condition->items as $item) { |
|
38 | - $itemComplete = $item->checkComplete(); |
|
39 | - switch ($item->type) { |
|
40 | - case 'event': |
|
37 | + foreach ($condition->items as $item) { |
|
38 | + $itemComplete = $item->checkComplete(); |
|
39 | + switch ($item->type) { |
|
40 | + case 'event': |
|
41 | 41 | $name = \Events\Event::get($item->value, 'event')->name(); |
42 | - break; |
|
43 | - } |
|
44 | - ?> |
|
42 | + break; |
|
43 | + } |
|
44 | + ?> |
|
45 | 45 | <li> |
46 | 46 | <b class="<?= $itemComplete ? 'text-success' : 'text-danger'; ?>"><?= $name; ?> <?= $item->recivedCount(); ?></b>/<?= $item->count; ?> <br /> |
47 | 47 | </li> |
@@ -42,7 +42,7 @@ |
||
42 | 42 | 'manager' => [ |
43 | 43 | 'cols' => ['user:id', 'user_id', 'currency_id', 'amount'], |
44 | 44 | 'sortable' => ['user:id', 'user_id', 'currency_id', 'amount'], |
45 | - 'filters' => [ 'currency_id'], |
|
45 | + 'filters' => ['currency_id'], |
|
46 | 46 | ] |
47 | 47 | ]; |
48 | 48 |
@@ -81,7 +81,8 @@ |
||
81 | 81 | } |
82 | 82 | if ($complete) { |
83 | 83 | $usersCompleted[$block->wallet->user_id] = true; |
84 | - } else { |
|
84 | + } |
|
85 | + else { |
|
85 | 86 | $usersCompleted[$block->wallet->user_id] = false; |
86 | 87 | } |
87 | 88 | } |
@@ -87,7 +87,8 @@ |
||
87 | 87 | foreach ($this->currencies as $merchantCurrency) { |
88 | 88 | if ($merchantCurrency->currency_id == $pay->currency_id) { |
89 | 89 | $allowCurrencies[] = ['type' => 'primary', 'currency' => $merchantCurrency->currency]; |
90 | - } else { |
|
90 | + } |
|
91 | + else { |
|
91 | 92 | $transfer = Currency\ExchangeRate::get([['currency_id', $merchantCurrency->currency_id], ['target_currency_id', $pay->currency_id]]); |
92 | 93 | if ($transfer) { |
93 | 94 | $allowCurrencies[] = ['type' => 'transfer', 'currency' => $merchantCurrency->currency, 'transfer' => $transfer]; |
@@ -51,7 +51,8 @@ discard block |
||
51 | 51 | if (!empty($_POST['code'])) { |
52 | 52 | if ($transfer->code != $_POST['code']) { |
53 | 53 | Msg::add('Код не совпадает', 'danger'); |
54 | - } else { |
|
54 | + } |
|
55 | + else { |
|
55 | 56 | $transfer->complete = 1; |
56 | 57 | $block = Money\Wallet\Block::get('Money\Transfer:' . $transfer->id, 'data'); |
57 | 58 | $block->delete(); |
@@ -94,7 +95,8 @@ discard block |
||
94 | 95 | ]); |
95 | 96 | $pay->save(); |
96 | 97 | Tools::redirect('/money/merchants/pay/' . $pay->id); |
97 | - } else { |
|
98 | + } |
|
99 | + else { |
|
98 | 100 | $currencies = Money\Currency::getList(['where' => ['refill', 1], 'forSelect' => true]); |
99 | 101 | $this->view->setTitle('Пополнение счета'); |
100 | 102 | $this->view->page(['data' => compact('currencies')]); |
@@ -114,17 +116,20 @@ discard block |
||
114 | 116 | $where = []; |
115 | 117 | if ($currency) { |
116 | 118 | $where[] = ['currency_id', $currency->id]; |
117 | - } else { |
|
119 | + } |
|
120 | + else { |
|
118 | 121 | $where[] = ['currency_id', implode(',', array_keys($wallets)), 'IN']; |
119 | 122 | } |
120 | 123 | if ($targetCurrency) { |
121 | 124 | $where[] = ['target_currency_id', $targetCurrency->id]; |
122 | - } else { |
|
125 | + } |
|
126 | + else { |
|
123 | 127 | $where[] = ['target_currency_id', implode(',', array_keys($wallets)), 'IN']; |
124 | 128 | } |
125 | 129 | if ($where) { |
126 | 130 | $rates = Money\Currency\ExchangeRate::getList(['where' => $where]); |
127 | - } else { |
|
131 | + } |
|
132 | + else { |
|
128 | 133 | $rates = []; |
129 | 134 | } |
130 | 135 | if (!empty($_GET['exchange']) && $currency && $targetCurrency && !empty($rates[$_GET['exchange']['rate_id']])) { |
@@ -133,7 +138,8 @@ discard block |
||
133 | 138 | if (empty($_GET['exchange']['give']['amount']) || !(float) $_GET['exchange']['give']['amount']) { |
134 | 139 | Msg::add('Укажите сумму которую вы хотите отдать'); |
135 | 140 | $error = true; |
136 | - } else { |
|
141 | + } |
|
142 | + else { |
|
137 | 143 | $amount = (float) $_GET['exchange']['give']['amount']; |
138 | 144 | } |
139 | 145 | if (!empty($amount) && $amount > $wallets[$currency->id]->amount) { |
@@ -165,7 +171,8 @@ discard block |
||
165 | 171 | Tools::redirect('/money/merchants/pay/' . $pay->id, 'Нет возможности оплатить счет в валюте ' . $pay->currency->name() . ' валютой ' . $wallet->currency->name()); |
166 | 172 | } |
167 | 173 | $sum = $pay->sum / $rate->rate; |
168 | - } else { |
|
174 | + } |
|
175 | + else { |
|
169 | 176 | $sum = $pay->sum; |
170 | 177 | } |
171 | 178 | if ($sum > $wallet->amount) { |