Changeset 909 for pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php
- Timestamp:
- Apr 24, 2015 11:17:57 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php
r906 r909 177 177 178 178 if (trim($arySmsReturn[1]) == trim(lang('_SBG_MO_USER_REGISTER_VIP_FAIL_NOT_ENOUGH_MSG'))) { 179 $maxCharging = 50000;180 179 $amount = $packageData ['p_price']; 181 $count = $amount > $maxCharging ? ceil($amount/ _SBG_CHARGING_MAX_VALUE) : 1; 182 $value = 0; 183 for ($i = 1; $i <= $count; $i++) { 184 $value = $amount > _SBG_CHARGING_MAX_VALUE ? _SBG_CHARGING_MAX_VALUE : $amount; 185 $amount -= $value; 186 $result = $this->chargeRootAccountProcess($sentNumber, $value, $sentNumber.' paid for SBG'); 187 } 180 $result = $this->chargeRootAccountProcess($sentNumber, $amount, $sentNumber.' paid for SBG'); 188 181 189 182 if ($result == _SBG_CHARGING_SUCCESS) { … … 243 236 } 244 237 else if ($result == _SBG_CHARGING_FAIL_MORETHAN_LIMIT) { 245 /*$aryPatterns = array ('/:sendid:/');238 $aryPatterns = array ('/:sendid:/'); 246 239 $smsReturn = preg_replace($aryPatterns, array($sentNumber), lang('_SBG_MO_CHARGING_FAIL_MORETHAN_LIMIT_MSG')); 247 $smsReturn = _SBG_MO_PROCCESS_ERR.'|'.$smsReturn; */ 248 249 250 251 240 $smsReturn = _SBG_MO_PROCCESS_ERR.'|'.$smsReturn; 252 241 }else if ($result == _SBG_CHARGING_FAIL_NOT_VIETTEL || $result == _SBG_CHARGING_NUMBER_NOT_EXISTED || $result == _SBG_CHARGING_NUMBER_NOT_AVAILABLE) { 253 242 $smsReturn = _SBG_MO_PROCCESS_ERR.'|'.lang('_SBG_MO_CHARGING_FAIL_NOT_VIETTEL_MSG'); … … 265 254 } 266 255 break; 267 256 268 257 case _SBG_MO_PASSWORD_COLLABORATOR_SERVICE: 269 258 $smsReturn = $this->objCollaboratorModel->getPassword($sentNumber); 270 259 break; 271 260 272 261 case _SBG_MO_UNSUBSCRIBE_SERVICE: 273 262 case _SBG_MO_SYNTAX_ERR: … … 339 328 $username = $this->config->item('charging_username'); 340 329 $password = $this->config->item('charging_password'); 341 $action = 'http://tempuri.org/ processCharging';330 $action = 'http://tempuri.org/Charge'; 342 331 343 332 $aryParams = array( … … 355 344 $client->operation = $action; 356 345 $result = $client->send($xml, $action); 346 347 error_log(date('Y-m-d H:i:s').' -- DATA: '. var_export($xml, TRUE).' -- CASE: '. $case . "\n", 3, '/srv/www/sbg/log/chargeresult.log'); 348 error_log(date('Y-m-d H:i:s').' -- DATA: '. var_export($result, TRUE).' -- CASE: '. $case . "\n", 3, '/srv/www/sbg/log/chargeresult.log'); 349 357 350 if ($client->fault) { 358 351 return _SBG_CHARGING_FAIL;
Note: See TracChangeset
for help on using the changeset viewer.