Exemplo n.º 1
0
 function login_()
 {
     $Obj = new loginResponse();
     $RSAClass = new ClsCryptor();
     //Ham thuc hien lay public key cua EPAy tu file pem
     $RSAClass->GetpublicKeyFrompemFile("D:/xamp/htdocs/cyafun/application/controllers/nap_the/cyasoft_key/Epay_Public_key.pem");
     try {
         $EncrypedPass = $RSAClass->encrypt($this->m_Pass);
     } catch (Exception $ex) {
     }
     $Pass = base64_encode($EncrypedPass);
     //print_r($Pass);
     //$soapClient = new Soapclient("http://192.168.0.85:10001/CardChargingGW_0108/services/Services?wsdl");
     try {
         $result = $this->soapClient->login($this->m_UserName, $Pass, $this->m_PartnerID);
         // goi ham login de lay session id du lieu tra ve la mot mang voi cac thong tin message, sessionid,status,transid
         //print_r($result);
     } catch (Exception $ex) {
         echo "Xay ra loi khi thuc hien login: "******"D:/xamp/htdocs/cyafun/application/controllers/nap_the/cyasoft_key/kh0015_mykey.pem");
     try {
         $Session_Decryped = $RSAClass->decrypt(base64_decode($result->sessionid));
         $Obj->m_SessionID = $this->Hextobyte($Session_Decryped);
     } catch (Exception $ex) {
         echo "<br/><h1>Co loi khi thuc hien giai mai session:<h1/><br/>" . $ex;
     }
     //print_r($Obj->m_SessionID) ;
     $Obj->m_TransID = $result->transid;
     return $Obj;
 }
Exemplo n.º 2
0
 function login_()
 {
     $Obj = new loginResponse();
     $RSAClass = new ClsCryptor();
     //Ham thuc hien lay public key cua EPAy tu file pem
     $RSAClass->GetpublicKeyFrompemFile("Key/" . $this->m_root . "/Epay_Public_key.pem");
     try {
         $EncrypedPass = $RSAClass->encrypt($this->m_Pass);
     } catch (Exception $ex) {
     }
     $Pass = base64_encode($EncrypedPass);
     //$soapClient = new Soapclient("http:192.168.0.85:10001/CardChargingGW_0108/services/Services?wsdl");
     //$soapClient = new Soapclient("http://charging-test.megapay.net.vn:10001/CardChargingGW_V2.0/services/Services?wsdl");
     try {
         $result = $this->soapClient->login($this->m_UserName, $Pass, $this->m_PartnerID);
         // goi ham login de lay session id du lieu tra ve la mot mang voi cac thong tin message, sessionid,status,transid
         $this->soapClient->httpsocket = null;
         //print_r($result);
     } catch (Exception $ex) {
         echo "Xay ra loi khi thuc hien login: "******"Key/" . $this->m_root . "/private_key.pem");
     try {
         //echo "<br/>result->sessionid<br/>";var_dump($result->sessionid);
         $Session_Decryped = $RSAClass->decrypt(base64_decode($result->sessionid));
         // echo "<br/>decode->sessionid<br/>";var_dump(base64_decode($result->sessionid));
         //   echo "<br/>decryped->sessionid<br/>";var_dump($Session_Decryped);
         $Obj->m_SessionID = $this->Hextobyte($Session_Decryped);
     } catch (Exception $ex) {
         echo "<br/><h1>Co loi khi thuc hien giai mai session:<h1/><br/>" . $ex;
     }
     //print_r($Obj->m_SessionID) ;
     $Obj->m_TransID = $result->transid;
     return $Obj;
 }
Exemplo n.º 3
0
 function login_()
 {
     $Obj = new loginResponse();
     $RSAClass = new ClsCryptor();
     //Ham thuc hien lay public key cua EPAy tu file pem
     $RSAClass->GetpublicKeyFrompemFile(getcwd() . "/application/libraries/VNPT/Epay_Public_key.pem");
     try {
         $EncrypedPass = $RSAClass->encrypt($this->m_Pass);
     } catch (Exception $ex) {
     }
     $Pass = base64_encode($EncrypedPass);
     try {
         $result = $this->soapClient->login($this->m_UserName, $Pass, $this->m_PartnerID);
         // goi ham login de lay session id du lieu tra ve la mot mang voi cac thong tin message, sessionid,status,transid
     } catch (Exception $ex) {
         //echo "Xay ra loi khi thuc hien login: "******"/application/libraries/VNPT/partner_private_key.pem");
     try {
         $Session_Decryped = $RSAClass->decrypt(base64_decode($result->sessionid));
         $Obj->m_SessionID = $this->Hextobyte($Session_Decryped);
     } catch (Exception $ex) {
         //echo"<br/><h1>Co loi khi thuc hien giai mai session:<h1/><br/>".$ex;
     }
     //print_r($Obj->m_SessionID) ;
     $Obj->m_TransID = $result->transid;
     return $Obj;
 }