public function ResetCache($cliente) { $vai = new MySQLDB(); $sql = "SELECT `cliente`.`idcliente`, `cliente`.`nome`, `cliente`.`site`, `cliente`.`logo`, `cliente`.`folder`, `gateway`.`email`, `gateway`.`token` FROM `cliente` \n\t\tINNER JOIN `gateway` ON `cliente`.`idcliente`=`gateway`.`cliente_idcliente` \n\t\tWHERE `cliente`.`idcliente` = {$cliente} AND `gateway`.`ativo`=1;"; $vai = new MySQLDB(); $result = $vai->ExecuteQuery($sql); $objeto = mysql_fetch_object($result); //------------verifica se gateway está ativo------------- if (!$objeto->folder) { $erro = "Por favor, cadastre o gateway antes de prosseguir."; header("Location: layout.php?vi=erro&ed={$cliente}&error={$erro}"); exit; } include "../../plugins/CreateXML/index.php"; $create = new CreateXML(); $criacao = $create->Create($objeto->idcliente, $objeto->nome, $objeto->site, $objeto->logo, $objeto->email, $objeto->token, $objeto->folder); if ($criacao == true) { header("Location: layout.php?vi=cache&ed={$cliente}"); } else { header("Location: layout.php?vi=errocache&ed={$cliente}"); } }
/** * 函数功能:原创调用适配 */ function remoteInvoke($service, $parameter) { // 合成XML $xdoc = new CreateXML($this->encoding); $xdoc->createRoot($service, $this->version); foreach ($parameter as $key => $val) { $xdoc->addNode($key, $val['type'], $val['value']); } // 加密 签名 $xstr = $xdoc->getString(); // echo "xstr: $xstr"; $req_sign = strtoupper(md5($xstr . $this->md5key)); $req_code = base64_encode($xstr); // 远程调用 //生成SOAP调用是的参数 $param = array('service' => $service, 'merchant' => $this->merchantid, 'encoding' => $this->encoding, 'type' => $this->type, 'code' => $req_code, 'sign' => $req_sign); // print_r($param); //调用网银提供的soap方法 $soap_client = new soapclientw($this->soap_url, true); $rs = $soap_client->call($this->soap_method, $param); //echo "-----------------------------<br/>\n"; //print_a('rs', $rs); // 处理返回值 $rtcode = $rs['string'][0]; $rtmsg = base64_decode($rs['string'][1]); //echo "code: $rtmsg<br\>\n"; if (strtoupper(md5($rtmsg . $this->md5key)) == $rs['string'][2]) { echo "return sign OK! <br>\n"; // 解码 echo $rtmsg; return xml2array($rtmsg); } else { echo "Chinabank Soap SIGN ERR! <br>\n"; return array('sname' => $service, 'result' => $this->MOTO_CLIENT_AUTH, 'error' => $this->MOTO_CLIENT_AUTH, '_error' => 'SING ERR'); } }