Example #1
0
 public function index()
 {
     $this->initial_order();
     $res = $this->pay_model->get_merchant_data_by_pay_type($this->order['pay_type_id'], $this->order['method_id']);
     $source = array('SecurityToken' => $res['merchant_name'], 'BrandID' => $res['merchant_key2'], 'LanguageCode' => 'EN', 'MerchantTransactionID' => $this->order['order_sn'], 'TransactionValue' => $this->order['pay_amount'], 'MerchantCurrency' => $res['merchant_key3'], 'ConsumerID' => $this->order['pay_user_id'], 'URL_Success' => 'http://' . PAY_URL . '/ukash/url_success', 'URL_Fail' => 'http://' . PAY_URL . '/ukash/url_fail', 'URL_Notification' => 'http://' . PAY_URL . '/ukash/url_notification');
     $log_array = array('type' => 'Ukash GetUniquesactionParament', 'value' => $source);
     log_message('gash', json_encode($log_array) . "</br>");
     //$soap =  new SoapClient($this->staging_url.'?wsdl');
     $soap = new SoapClient($this->live_url . '?wsdl');
     $response = $soap->GetUniqueTransactionID($source);
     $xml_obj = simplexml_load_string($response->GetUniqueTransactionIDResult);
     $log_array = array('type' => 'Ukash GetUniqueTransactionIDResult', 'value' => $xml_obj);
     log_message('gash', json_encode($log_array) . "</br>");
     if ($xml_obj->errCode == 0) {
         if ($xml_obj->SecurityToken == $res['merchant_key']) {
             $update_order = array('order_sn' => $this->order['order_sn'], 'tradeseq' => "{$xml_obj->UTID}");
             //  tranform UTID to a string, otherwish error will occure in mysql
             $this->CI->pay_model->update_order_by_order_sn($update_order);
             $params = array('form_url' => 'https://direct.ukash.com/hosted/entry.aspx', 'UTID' => "{$xml_obj->UTID}");
             $this->load->view('/' . $this->index_lang['FOLDER'] . '/ukash_form.php', $params);
         }
     }
 }