Completed
Push — master ( a88bdd...45402d )
by Alexey
05:20
created
system/modules/Money/objects/MerchantHelper/WalletOne.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
 
22 22
         function print_answer($result, $description)
23 23
         {
24
-            $print = "WMI_RESULT=" . strtoupper($result) . "&";
25
-            $print .= "WMI_DESCRIPTION=" . urlencode($description);
24
+            $print = "WMI_RESULT=".strtoupper($result)."&";
25
+            $print .= "WMI_DESCRIPTION=".urlencode($description);
26 26
             return $print;
27 27
         }
28 28
 
@@ -59,24 +59,24 @@  discard block
 block discarded – undo
59 59
 
60 60
         // Формирование подписи для сравнения ее с параметром WMI_SIGNATURE
61 61
 
62
-        $signature = base64_encode(pack("H*", md5($values . $skey)));
62
+        $signature = base64_encode(pack("H*", md5($values.$skey)));
63 63
 
64 64
         //Сравнение полученной подписи с подписью W1
65 65
 
66 66
         if (!empty($data["WMI_SIGNATURE"]) && $signature == $data["WMI_SIGNATURE"]) {
67 67
             if (strtoupper($data["WMI_ORDER_STATE"]) == "ACCEPTED") {
68 68
                 // вызываем функцию обработки в случае успеха
69
-                $result['callback'] = print_answer("Ok", "Заказ #" . $data["WMI_PAYMENT_NO"] . " оплачен!");
69
+                $result['callback'] = print_answer("Ok", "Заказ #".$data["WMI_PAYMENT_NO"]." оплачен!");
70 70
                 $result['payId'] = $data["WMI_PAYMENT_NO"];
71 71
                 $result['status'] = 'success';
72 72
                 return $result;
73 73
             } else {
74 74
                 // Случилось что-то странное, пришло неизвестное состояние заказа
75
-                $result['callback'] = print_answer("Retry", "Неверное состояние " . $data["WMI_ORDER_STATE"]);
75
+                $result['callback'] = print_answer("Retry", "Неверное состояние ".$data["WMI_ORDER_STATE"]);
76 76
             }
77 77
         } else {
78 78
             // Подпись не совпадает, возможно вы поменяли настройки интернет-магазина
79
-            $result['callback'] = print_answer("Retry", "Неверная подпись " . (!empty($data["WMI_SIGNATURE"]) ? $data["WMI_SIGNATURE"] : 'empty'));
79
+            $result['callback'] = print_answer("Retry", "Неверная подпись ".(!empty($data["WMI_SIGNATURE"]) ? $data["WMI_SIGNATURE"] : 'empty'));
80 80
         }
81 81
         return $result;
82 82
     }
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         $merchantCurrency = static::getMerchantCurrency($currency);
88 88
         
89 89
         if (!$description)
90
-            $description = "Оплата заказа на сайте " . idn_to_utf8(INJI_DOMAIN_NAME);
90
+            $description = "Оплата заказа на сайте ".idn_to_utf8(INJI_DOMAIN_NAME);
91 91
 
92 92
         //Секретный ключ интернет-магазина
93 93
         $key = $config['secret'];
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         $fields["WMI_PAYMENT_AMOUNT"] = number_format($amount, 0, '.', '');
100 100
         $fields["WMI_CURRENCY_ID"] = $merchantCurrency->code;
101 101
         $fields["WMI_PAYMENT_NO"] = $payId;
102
-        $fields["WMI_DESCRIPTION"] = "BASE64:" . base64_encode($description);
102
+        $fields["WMI_DESCRIPTION"] = "BASE64:".base64_encode($description);
103 103
         $fields["WMI_EXPIRED_DATE"] = "2019-12-31T23:59:59";
104 104
         $fields["WMI_SUCCESS_URL"] = $success;
105 105
         $fields["WMI_FAIL_URL"] = $false;
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         // вычисления отпечатка, сформированного выше сообщения,
136 136
         // по алгоритму MD5 и представление его в Base64
137 137
 
138
-        $signature = base64_encode(pack("H*", md5($fieldValues . $key)));
138
+        $signature = base64_encode(pack("H*", md5($fieldValues.$key)));
139 139
 
140 140
         //Добавление параметра WMI_SIGNATURE в словарь параметров формы
141 141
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 
156 156
           print "<input type=\"submit\"/></form>";
157 157
          */
158
-        \Tools::redirect('https://www.walletone.com/checkout/default.aspx?' . http_build_query($fields));
158
+        \Tools::redirect('https://www.walletone.com/checkout/default.aspx?'.http_build_query($fields));
159 159
     }
160 160
 
161 161
 }
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.
system/modules/Money/objects/MerchantHelper/Robokassa.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,9 +44,9 @@
 block discarded – undo
44 44
             'SignatureValue' => $hash
45 45
         ];
46 46
         if (empty($config['test'])) {
47
-            \Tools::redirect('https://auth.robokassa.ru/Merchant/Index.aspx?' . http_build_query($data));
47
+            \Tools::redirect('https://auth.robokassa.ru/Merchant/Index.aspx?'.http_build_query($data));
48 48
         } else {
49
-            \Tools::redirect('http://test.robokassa.ru/Index.aspx?' . http_build_query($data));
49
+            \Tools::redirect('http://test.robokassa.ru/Index.aspx?'.http_build_query($data));
50 50
         }
51 51
     }
52 52
 
Please login to merge, or discard this patch.
system/modules/Money/Money.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
             default:
46 46
                 $sum = $pay->sum;
47 47
         }
48
-        $className = 'Money\MerchantHelper\\' . $objectName;
48
+        $className = 'Money\MerchantHelper\\'.$objectName;
49 49
         return $className::goToMerchant($pay->id, $sum, $method['currency'], $merchantOptions['description'], $merchantOptions['success'], $merchantOptions['false']);
50 50
     }
51 51
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         if ($merchant) {
60 60
             $this->currentMerchant = $system;
61 61
         }
62
-        $className = 'Money\MerchantHelper\\' . $this->currentMerchant;
62
+        $className = 'Money\MerchantHelper\\'.$this->currentMerchant;
63 63
         $result = $className::reciver($data, $status);
64 64
         $result['pay'] = null;
65 65
         if (!empty($result['payId'])) {
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             if (empty($blocks[$block->wallet->currency_id])) {
103 103
                 $blocks[$block->wallet->currency_id] = $block->amount;
104 104
             } else {
105
-                $blocks[$block->wallet->currency_id]+= $block->amount;
105
+                $blocks[$block->wallet->currency_id] += $block->amount;
106 106
             }
107 107
         }
108 108
         return $blocks;
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
             return false;
172 172
         }
173 173
         $reward->checkBlocked();
174
-        $reward_count = \Money\Reward\Recive::getCount([ 'where' => [ 'reward_id', $reward_id]]);
174
+        $reward_count = \Money\Reward\Recive::getCount(['where' => ['reward_id', $reward_id]]);
175 175
         if ($reward_count >= $reward->quantity && $reward->quantity) {
176 176
             return false;
177 177
         }
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
                 $recives = \Money\Reward\Recive::getList(['where' => [['user_id', $user->id], ['reward_id', $reward->id]]]);
212 212
                 $amount = 0;
213 213
                 foreach ($recives as $recive) {
214
-                    $amount+=$recive->amount;
214
+                    $amount += $recive->amount;
215 215
                 }
216 216
                 if ($amount >= $reward->peruser) {
217 217
                     continue;
Please login to merge, or discard this patch.
system/modules/Db/objects/Mysql/Mysql.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@  discard block
 block discarded – undo
13 13
 
14 14
 class Mysql extends \Object
15 15
 {
16
-    public $config = [];       // настройки подключения выбраной базы
17
-    public $connect = FALSE;        // ярлык соединения с MySQL
18
-    public $encoding = 'utf-8';        // установленная кодировка
19
-    public $db_name = 'test';         // выбраная в данный момент база
20
-    public $table_prefix = 'inji_';   // префикс названий таблиц
16
+    public $config = []; // настройки подключения выбраной базы
17
+    public $connect = FALSE; // ярлык соединения с MySQL
18
+    public $encoding = 'utf-8'; // установленная кодировка
19
+    public $db_name = 'test'; // выбраная в данный момент база
20
+    public $table_prefix = 'inji_'; // префикс названий таблиц
21 21
     public $pdo = NULL;
22 22
     public $lastQuery = '';
23 23
     public $last_error = '';
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         $this->table_prefix = '';
72 72
 
73 73
         $query->where('TABLE_SCHEMA', $old_db);
74
-        $query->where('TABLE_NAME', $old_prefix . $table_name);
74
+        $query->where('TABLE_NAME', $old_prefix.$table_name);
75 75
         $result = $query->select('COLUMNS');
76 76
         $this->db_name = $old_db;
77 77
         $this->table_prefix = $old_prefix;
Please login to merge, or discard this patch.
system/modules/Db/objects/Mysql/Query.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -190,15 +190,15 @@  discard block
 block discarded – undo
190 190
                     $newValue = '';
191 191
                     foreach ($value as $item) {
192 192
                         if ($newValue) {
193
-                            $newValue.=',';
193
+                            $newValue .= ',';
194 194
                         }
195 195
                         if (is_string($item)) {
196
-                            $newValue .='"' . $item . '"';
196
+                            $newValue .= '"'.$item.'"';
197 197
                         } else {
198
-                            $newValue .=$item;
198
+                            $newValue .= $item;
199 199
                         }
200 200
                     }
201
-                    $value = '(' . $newValue . ')';
201
+                    $value = '('.$newValue.')';
202 202
                 } elseif (!preg_match('!\(!', $value) && !preg_match('![^0-9,\.\(\) ]!', $value))
203 203
                     $value = "({$value})";
204 204
                 elseif (preg_match('!\(!', $value) && preg_match('![^0-9,\.\(\) ]!', $value))
@@ -262,8 +262,8 @@  discard block
 block discarded – undo
262 262
 
263 263
         switch ($this->operation) {
264 264
             case 'SELECT':
265
-                $query .= ' ' . ($this->distinct ? 'DISTINCT' : '');
266
-                $query .= ' ' . (!$this->cols ? '*' : ((is_array($this->cols) ? implode(',', $this->cols) : $this->cols)));
265
+                $query .= ' '.($this->distinct ? 'DISTINCT' : '');
266
+                $query .= ' '.(!$this->cols ? '*' : ((is_array($this->cols) ? implode(',', $this->cols) : $this->cols)));
267 267
             case 'DELETE':
268 268
                 $query .= ' FROM';
269 269
                 break;
@@ -280,9 +280,9 @@  discard block
 block discarded – undo
280 280
                 $this->params = array_merge($this->params, array_values($this->cols));
281 281
                 $colsStr = '';
282 282
                 if ($this->cols) {
283
-                    $colsStr = '`' . implode('`,`', array_keys($this->cols)) . '`';
283
+                    $colsStr = '`'.implode('`,`', array_keys($this->cols)).'`';
284 284
                 }
285
-                $query .= ' (' . $colsStr . ') VALUES (' . rtrim(str_repeat('?,', count($this->cols)), ',') . ')';
285
+                $query .= ' ('.$colsStr.') VALUES ('.rtrim(str_repeat('?,', count($this->cols)), ',').')';
286 286
                 break;
287 287
             case 'CREATE TABLE':
288 288
                 $query .= " (";
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
                 }
295 295
                 $query = rtrim($query, ',');
296 296
                 if ($this->indexes) {
297
-                    $query .= ', ' . implode(',', $this->indexes);
297
+                    $query .= ', '.implode(',', $this->indexes);
298 298
                 }
299 299
                 $query .= ") ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_general_ci";
300 300
                 break;
@@ -309,23 +309,23 @@  discard block
 block discarded – undo
309 309
                     }
310 310
                 }
311 311
                 $update = implode(',', $updates);
312
-                $query .=" SET {$update}";
312
+                $query .= " SET {$update}";
313 313
             case 'SELECT':
314 314
             case 'DELETE':
315 315
                 $this->buildWhere($this->where);
316 316
                 if ($this->whereString) {
317
-                    $query .= ' ' . $this->whereString;
317
+                    $query .= ' '.$this->whereString;
318 318
                 }
319 319
                 break;
320 320
         }
321 321
         if ($this->group) {
322
-            $query .= ' GROUP BY ' . implode(',', $this->group);
322
+            $query .= ' GROUP BY '.implode(',', $this->group);
323 323
         }
324 324
         if ($this->order) {
325
-            $query .= ' ORDER BY ' . implode(',', $this->order);
325
+            $query .= ' ORDER BY '.implode(',', $this->order);
326 326
         }
327 327
         if ($this->limit) {
328
-            $query .= ' ' . $this->limit;
328
+            $query .= ' '.$this->limit;
329 329
         }
330 330
         return ['query' => $query, 'params' => $this->params];
331 331
     }
Please login to merge, or discard this patch.