public static function ResponsetoApp($retcode, $msg_body) { global $req_token; // 授权码 global $au_token; // 动态码 global $req_version; // 版本号 global $req_bkenv; // 银联环境 global $req_time; global $api_name; global $api_name_func; global $reqcontext; global $authorid; global $authortruename; global $g_sdcrid; $arr_retmsg = array('0' => '成功', '500' => '执行代码错误', '600' => '客户端调用错误', '700' => '数据库出错', '900' => '引用延迟', '800' => '银行卡交易代码请求错误,请填写正确的银行卡信息', '400' => '商户权限不足', '300' => '停留时间太长,请重新登录!', '404' => '请求功能不存在', '505' => '用户信息已被异地篡改,请重新登录', '200' => '自定义错误', '100' => '商户权限不足'); if ($retcode != '200' && $retcode != '0' && $retcode != '300') { $retmsg = $arr_retmsg[$retcode]; } else { if ($retcode != '700' or $retcode != '800') { $retmsg = $msg_body['msgbody']['message']; } } if ($g_sdcrid >= '100') { $req_bkenv = '01'; //测试环境 } else { $req_bkenv = '00'; //正式环境 } $msg_header = array('msgheader' => array('au_token' => $au_token, 'req_token' => $req_token, 'req_bkenv' => $req_bkenv, 'retinfo' => array('rettype' => $retcode, 'retcode' => $retcode, 'retmsg' => $retmsg))); $Responsecontext['operation_response'] = array_merge($msg_header, $msg_body); $rqvalue = xml_encode($Responsecontext, 'utf-8'); //$returnval =""; $reqcry = TfbAuthRequest::getReqDatatype($reqcontext); //请求的数据流 $TfbAuthRequest = new TfbAuthRequest(); if ($reqcry == 'E') { $returnval = $TfbAuthRequest->desEncryptStr($rqvalue); } else { $returnval = $rqvalue; } $authorid = $authorid + 0; $file = "../../" . CONST_LOGDIR . "/" . date('md') . "-" . $authortruename . "log" . ".txt"; $filehandle = fopen($file, "a"); fwrite($filehandle, "\r\n======响应内容:\r\n" . $rqvalue . "\r\n\r\n" . $returnval . "\r\n\r\n<!--------------结束------------>\r\n\r\n\r\n"); fclose($filehandle); return $returnval; }
//$interface_id = $db->f(fd_interface_id); $interface_no = $db->f(fd_interface_no); $interface_name = $db->f(fd_interface_name); $interface_url = $db->f(fd_interface_apinamefunc); $apiname = g2u($db->f(fd_interface_demo)); } } $checkenc = "checked"; $checkdec = ""; switch ($action) { case "jisuan": if ($type == 'enc') { $checkenc = "checked"; $checkdec = ""; $TfbAuthRequest = new TfbAuthRequest(); $resultcontent = $TfbAuthRequest->desEncryptStr($TestCode); //echo var_dump($TestCode); } else { if ($type == 'dec') { //echo "dec"; $checkenc = ""; $checkdec = "checked"; $TfbAuthRequest = new TfbAuthRequest(); $apiname = $TfbAuthRequest->DesDecryptStr($resultcontent); } } $action = ""; break; } $query = "select * from web_test_interface where fd_interface_active = 1 order by fd_interface_sortorder,fd_interface_no asc"; $db->query($query);