66 *
77 * @package MagnusBilling
88 * @author Adilson Leffa Magnus.
9- * @copyright Copyright (C) 2005 - 2021 MagnusSolution. All rights reserved.
9+ * @copyright Copyright (C) 2005 - 2023 MagnusSolution. All rights reserved.
1010 * ###################################
1111 *
1212 * This software is released under the terms of the GNU Lesser General Public License v2.1
@@ -26,7 +26,7 @@ public function run($args)
2626 define ('LOGFILE ' , 'protected/runtime/BDServicePid.log ' );
2727 define ('DEBUG ' , 0 );
2828
29- if (! defined ('PID ' )) {
29+ if ( ! defined ('PID ' )) {
3030 define ("PID " , "/var/run/magnus/BDServicePid.php " );
3131 }
3232
@@ -60,15 +60,15 @@ public function tanaSend()
6060
6161 foreach ($ modelSendCreditSummary as $ key => $ sendCredit ) {
6262 $ url = "http://takasend.org/ezzeapi/status?id= " . $ sendCredit ->id . "&user= " . $ userBD . "&key= " . $ keyBD . "" ;
63- if (! $ result = @file_get_contents ($ url , false )) {
63+ if ( ! $ result = @file_get_contents ($ url , false )) {
6464 $ result = '' ;
6565 }
6666 echo $ result . " $ sendCredit ->id \n" ;
6767 $ modelRefill = Refill::model ()->find ('invoice_number = :key AND id_user = :key1 ' ,
68- array (
68+ [
6969 ':key ' => $ sendCredit ->id ,
7070 ':key1 ' => $ sendCredit ->id_user ,
71- ) );
71+ ] );
7272
7373 if (preg_match ("/ERROR|CANCELLED/ " , strtoupper ($ result ))) {
7474
@@ -99,10 +99,10 @@ public function tanaSend()
9999 echo "is agent \n" ;
100100 $ id_agent = $ modelUser ->id_user ;
101101 $ modelRefillAgent = Refill::model ()->find ('invoice_number = :key AND id_user = :key1 ' ,
102- array (
102+ [
103103 ':key ' => $ sendCredit ->id ,
104104 ':key1 ' => $ id_agent ,
105- ) );
105+ ] );
106106
107107 if (isset ($ modelRefillAgent ->id )) {
108108 $ modelRefillAgent ->description = $ modelRefillAgent ->description . '. Status: ' . $ result [0 ] . '. Ref: ' . $ result [1 ];
@@ -148,10 +148,10 @@ public function tanaSend()
148148 echo "is agent \n" ;
149149 $ id_agent = $ modelUser ->id_user ;
150150 $ modelRefillAgent = Refill::model ()->find ('invoice_number = :key AND id_user = :key1 ' ,
151- array (
151+ [
152152 ':key ' => $ sendCredit ->id ,
153153 ':key1 ' => $ id_agent ,
154- ) );
154+ ] );
155155
156156 $ modelRefillAgent ->description = @$ modelRefillAgent ->description . '. Status: ' . $ result [0 ] . '. Ref: ' . $ result [1 ];
157157 $ modelRefillAgent ->payment = 1 ;
@@ -184,12 +184,12 @@ public function ezzeapi()
184184 $ BDService_url = $ config ['global ' ]['BDService_url ' ];
185185
186186 $ url = $ BDService_url . "/ezzeapi/balance?user= $ userBD&key= $ keyBD " ;
187- if (! $ result = @file_get_contents ($ url , false )) {
187+ if ( ! $ result = @file_get_contents ($ url , false )) {
188188 $ result = '' ;
189189 }
190190
191- Configuration::model ()->updateAll (array ( 'config_value ' => $ result) , 'config_key = :key ' ,
192- array ( ':key ' => 'BDService_credit_provider ' ) );
191+ Configuration::model ()->updateAll ([ 'config_value ' => $ result] , 'config_key = :key ' ,
192+ [ ':key ' => 'BDService_credit_provider ' ] );
193193
194194 $ modelSendCreditSummary = SendCreditSummary::model ()->findAll ('confirmed = 0 AND service != :key AND date > :key1 ' , [
195195 ':key ' => 'international ' ,
@@ -202,7 +202,7 @@ public function ezzeapi()
202202
203203 $ url = $ BDService_url . "/ezzeapi/status?id= " . $ idApi . "&user= " . $ userBD . "&key= " . $ keyBD ;
204204
205- if (! $ result = @file_get_contents ($ url , false )) {
205+ if ( ! $ result = @file_get_contents ($ url , false )) {
206206 $ result = '' ;
207207 }
208208
@@ -211,19 +211,19 @@ public function ezzeapi()
211211 if (preg_match ("/SUCCESS/ " , $ result )) {
212212
213213 $ modelRefill = Refill::model ()->find ('invoice_number = :key AND id_user = :key1 ' ,
214- array (
214+ [
215215 ':key ' => $ sendCredit ->id ,
216216 ':key1 ' => $ sendCredit ->id_user ,
217- ) );
217+ ] );
218218
219- if (! count ($ modelRefill )) {
219+ if ( ! count ($ modelRefill )) {
220220 continue ;
221221 }
222222 $ message = explode ("SUCCESS: " , $ result );
223223 User::model ()->updateByPk ($ sendCredit ->id_user ,
224- array (
224+ [
225225 'credit ' => new CDbExpression ('credit + ' . $ modelRefill ->credit ),
226- )
226+ ]
227227 );
228228
229229 $ modelRefill ->payment = 1 ;
@@ -238,15 +238,15 @@ public function ezzeapi()
238238 echo "\n\nIS A USER AGENT " . $ sendCredit ->idUser ->id_user ;
239239
240240 $ modelRefill = Refill::model ()->find ('invoice_number = :key AND id_user = :key1 ' ,
241- array (
241+ [
242242 ':key ' => $ sendCredit ->id ,
243243 ':key1 ' => $ sendCredit ->idUser ->id_user ,
244- ) );
244+ ] );
245245
246246 User::model ()->updateByPk ($ sendCredit ->idUser ->id_user ,
247- array (
247+ [
248248 'credit ' => new CDbExpression ('credit + ' . $ modelRefill ->credit ),
249- )
249+ ]
250250 );
251251
252252 $ modelRefill ->payment = 1 ;
@@ -259,7 +259,7 @@ public function ezzeapi()
259259 $ sendCredit ->confirmed = 3 ;
260260 $ sendCredit ->save ();
261261
262- $ modelRefill = Refill::model ()->find ('invoice_number = :key ' , array ( ':key ' => $ sendCredit ->id ) );
262+ $ modelRefill = Refill::model ()->find ('invoice_number = :key ' , [ ':key ' => $ sendCredit ->id ] );
263263 if (count ($ modelRefill )) {
264264 $ modelRefill ->description = $ modelRefill ->description . '. Ref: ' . $ result ;
265265 $ modelRefill ->save ();
0 commit comments