Ignore:
Timestamp:
Nov 14, 2014 10:05:19 PM (11 years ago)
Author:
namnd
Message:
 
Location:
pro-violet-viettel/sourcecode/application/modules/services
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/application/modules/services/controllers/sendmessage.php

    r517 r519  
    2121                $this->load->model('Services_model');
    2222                //$this->Services_model->cardPaidProcess($aryParams);
    23                 echo $this->Services_model->processMORequest('01662860000', strtoupper('Sbg vip 1'));
    24                
     23                echo $this->Services_model->processMORequest('01662860000', strtoupper('sbg DDT 0979947802 123456'));
    2524        }
    2625       
     
    106105                        echo '<p><b>Error: ' . $err . '</b></p>';
    107106                }
    108        
     107               
    109108                var_dump($result);
    110109               
     
    119118        public function topup ()
    120119        {
     120                $usID = $this->uri->segment(4);
    121121                $url = $this->config->item('topup_service_url');
    122122               
     
    129129                $password = 'sbg56ab77cdsgb';
    130130               
     131                $input = $this->input->post();
     132                $cardSerial = $input['card_serial'];
     133                $pinCard = $input['pin_card'];
     134               
    131135                $aryParams = array(
    132136                        'EWalletID' => 0,
    133                         'CardSerial' => '11111',
    134                         'PinCard' => 'eeeeeeeee'
    135                 );
    136                
     137                        'CardSerial' => $cardSerial,
     138                        'PinCard' => $pinCard,
     139                        'UserID' => $usID
     140                );
     141               
     142                $this->load->model('services_model');
     143                echo json_encode($this->services_model->cardPaidProcess($aryParams));
     144
    137145                $xml = $this->load->view('topup', $aryParams, true);
    138146                $client = new nusoap_client($url);
     
    143151                $result = $client->send($this->_xmlHeader.$xml, $operation);
    144152                $err = $client->getError();
    145                        
     153               
    146154                if ($client->fault) {
    147155                    echo "<h2>Fault loi:</h2><pre>";
     
    165173                echo "<h2>Response</h2>";
    166174                echo "<pre>" . htmlspecialchars($client->response, ENT_QUOTES) . "</pre>";
    167                                
     175               
    168176        }
    169177       
  • pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php

    r517 r519  
    167167                $client->operation = $action;
    168168               
    169                 $result = $client->send($xml, $operation);
     169                $result = $client->send($xml, $action);
    170170               
    171171                if ($client->fault) {
     
    174174               
    175175                $aryTopupResult = $result['TopUpResult'];
     176                $this->load->model('frontend/user_model', 'objUserModel');
     177               
     178                $userID = $aryCardInfo['UserID'];
     179                $paidType = 2;
     180                $amount = $aryTopupResult['TransactionAmount'];
     181                $paidTime = date('Y-m-d H:i:s');
     182               
     183                $user = $this->objUserModel->get_user_by_id($userID);
     184                $user['acc_balanced'] = $user['acc_balanced'] + $amount;
     185                $user['updated_time'] = date('Y-m-d H:i:s');
     186                if ($amount>0){
     187                        $this->objUserModel->updateUser($userID, $user);
     188                }
     189                $this->objUserModel->insertPaidlog($user['cellphone'], $user['cellphone'], $paidType, $amount, $paidTime);
    176190               
    177191                if ($aryTopupResult['Success'] == 'false') {
Note: See TracChangeset for help on using the changeset viewer.