static function getcouponSale($xml, $listno, $listid, $paytype = 'coupon', $bkntno)
 {
     $db = new DB_test();
     $Publiccls = new PublicClass();
     //初始化类实例
     $arr_xml = $Publiccls->xml_to_array($xml);
     $arr_channelinfo = $arr_xml['operation_request']['msgheader']['channelinfo'];
     $arr_body = $arr_xml['operation_request']['msgbody'];
     $authorid = $arr_channelinfo['authorid'];
     $couponid = trim($arr_body['couponid']);
     $paymoney = trim($arr_body['couponmoney']);
     $paycardid = trim($arr_body['paycardid']);
     $fucardno = trim($arr_body['creditcardno']);
     $fubank = trim(u2g($arr_body['creditbank']));
     $fucardman = trim(u2g($arr_body['creditcardman']));
     $fucardphone = trim(u2g($arr_body['creditcardphone']));
     $method = 'in';
     $method = u2g($method);
     $query1 = "insert into tb_agentpaymoneylist(\n\t\t\t\t\t\t\tfd_agpm_no\t\t\t,fd_agpm_paycardid\t\t,fd_agpm_authorid\t ,\n\t\t\t\t            fd_agpm_paydate\t    ,fd_agpm_shoucardno\t    ,fd_agpm_fucardno\t ,\n\t\t\t\t            fd_agpm_bkntno\t\t,fd_agpm_payrq          ,fd_agpm_paytype     ,\n\t\t\t\t            fd_agpm_current\t    ,fd_agpm_paymoney\t\t,fd_agpm_payfee\t\t ,\n\t\t\t\t            fd_agpm_money\t\t,fd_agpm_shoucardbank   ,fd_agpm_shoucardman ,\n\t\t\t\t            fd_agpm_shoucardmobile,fd_agpm_fucardbank\t,fd_agpm_fucardmobile,\n\t\t\t\t            fd_agpm_fucardman   ,fd_agpm_feebankid      ,fd_agpm_state       ,\n\t\t\t\t            fd_agpm_listid     , fd_agpm_listno         ,fd_agpm_method ,\n\t\t\t\t            fd_agpm_datetime     )values\n\t\t\t\t\t\t   ('{$listno}'\t\t,'{$paycardid}'\t,'{$authorid}'\t\t,\n\t\t\t\t\t\t   now()\t\t,'{$shoucardno}'\t,'{$fucardno}'\t\t,\n\t\t\t\t\t\t   '{$bkntno}'\t\t,'01'\t\t\t,'{$paytype}'\t\t\t,\n\t\t\t\t\t\t   '{$current}'\t\t,'{$paymoney}'\t,'{$payfee}'\t\t\t,\n\t\t\t\t\t\t   '{$paymoney}'\t\t\t,'{$shoucardbank}','{$shoucardman}'\t\t,\n\t\t\t\t\t\t   '{$shoucardmobile}','{$fucardbank}'\t,'{$fucardphone}'  \t,\n\t\t\t\t\t\t   '{$fucardman}'\t\t,'{$feebankid}'\t,'0'\t            ,\t\t\n\t\t\t\t\t\t   '{$listid}'\t\t,'{$listno}'\t    ,'{$method}'\t,now()        \t\t\t\n\t\t\t\t\t\t  )";
     $db->query($query1);
     $authorid = $authorid + 0;
     $file = "./" . date('Y-m-d') . "-paylist" . ".txt";
     $filehandle = fopen($file, "a");
     fwrite($filehandle, "\r\n======响应内容:\r\n" . $query1 . "\r\n\r\n\r\n\r\n<!--------------结束------------>\r\n\r\n\r\n");
     fclose($filehandle);
     return 1;
 }
 public function __construct()
 {
     $Publiccls = new PublicClass();
     //初始化类实例
     global $reqxmlcontext;
     $this->Arr_reqcontext = $Publiccls->xml_to_array($reqxmlcontext);
     // xml 转为 array
     $this->arr_header = $this->Arr_reqcontext['operation_request']['msgheader'];
     $this->arr_body = $this->Arr_reqcontext['operation_request']['msgbody'];
     $this->arr_channelinfo = $this->Arr_reqcontext['operation_request']['msgheader']['channelinfo'];
     $this->reqxmlcontext = $reqxmlcontext;
     $this->Publiccls = new PublicClass();
     //初始化类实例
     $this->ErrorReponse = new ErrorReponse();
 }
Exemplo n.º 3
0
 function apiAutoken($xml)
 {
     global $req_token;
     // 授权码
     global $au_token;
     // 动态码
     global $req_version;
     // 版本号
     global $req_bkenv;
     // 银联环境
     global $req_time;
     global $api_name;
     global $api_name_func;
     global $authorid;
     global $arr_limitauthorid;
     $Publiccls = new PublicClass();
     //初始化类实例
     $arr_xml = $Publiccls->xml_to_array($xml);
     $api_name = $arr_xml['operation_request']['msgheader']['channelinfo']['api_name'];
     $api_name_func = $arr_xml['operation_request']['msgheader']['channelinfo']['api_name_func'];
     $req_token = $arr_xml['operation_request']['msgheader']['req_token'];
     $req_time = $arr_xml['operation_request']['msgheader']['req_time'];
     $au_token = $arr_xml['operation_request']['msgheader']['au_token'];
     $req_version = $arr_xml['operation_request']['msgheader']['req_version'];
     $req_bkenv = $arr_xml['operation_request']['msgheader']['req_bkenv'];
     $req_appenv = $arr_xml['operation_request']['msgheader']['req_appenv'];
     //1:安卓_phone 2:安卓_pad 3:iphone  4:ipad
     $req_appevn = $arr_xml['operation_request']['msgheader']['req_appevn'];
     //1:安卓_phone 2:安卓_pad 3:iphone  4:ipad
     $authorid = $arr_xml['operation_request']['msgheader']['channelinfo']['authorid'];
     $req_time = $arr_xml['operation_request']['msgheader']['req_time'];
     //$authorid = $arr_xml['operation_request']['msgheader']['channelinfo']['authorid'];
     // 需要开通-cai
     if (!in_array($authorid, $arr_limitauthorid)) {
         //return true;
     }
     $desreqtoken = $this->DesDecryptStr($req_token);
     //授权码解密
     $reqtokenss = $this->checkauthorexists($desreqtoken, $authorid);
     //授权码验证 授权码登录验证- 功能权限验证
     if ($api_name != 'ApiAuthorInfo' && $api_name != 'ApiAuthorReg' && $api_name != 'ApiAppInfo' && $api_name != 'ApiAuthorInfoV2' && $api_name != 'ApiSafeGuard') {
         $app_env = $this->getappnav($req_version, $req_appenv, $req_appevn);
     }
     if ($api_name != 'ApiAuthorInfo' && $api_name != 'ApiAuthorReg' && $api_name != 'ApiAppInfo' && $api_name != 'ApiAuthorInfoV2' && $api_name != 'ApiSafeGuard') {
         //$app_env = $this->getappnav($req_version,$req_appenv,$req_appevn);
         $checktokel = $this->AuToken->checkAuToken($au_token, $api_name_func);
     }
     $arr_checkloginMod = AuToken::checkLoginMod($api_name, $api_name_func);
     //检验登录接口还是非登录接口
     switch ($arr_checkloginMod['result']) {
         case 'success':
             //需要登录验证
             if (!$arr_checkloginMod['ischeck']) {
                 return true;
             }
             //注册用户直接返回true的功能
             if ($arr_checkloginMod['ischeck'] == '1') {
                 $desreqtoken = $this->DesDecryptStr($req_token);
                 //授权码解密
                 $reqtoken = $this->AuToken->checkReqToken($desreqtoken, $au_token, $api_name, $api_name_func, $authorid);
                 //授权码验证 授权码登录验证- 功能权限验证
                 return true;
             }
             break;
         default:
             //没找到相应的模块直接出错反馈
             $Error = array('result' => 'failure', 'retcode' => '404', 'retmsg' => '客户端调用错误');
             $returnvalue = $this->ErrorReponse->reponError($Error);
             break;
     }
 }
Exemplo n.º 4
0
require "../include/common.inc.php";
require "../class/tfbrequest.class.php";
require "../class/tfbslotcard.class.php";
require "../class/tfbxmlResponse.class.php";
include_once "../third_api/kuaidi.class.php";
include_once "../third_api/mssale.class.php";
$arr_limitauthorid = array('82', '102');
error_reporting(E_ERROR);
$reqcontext = file_get_contents("php://input");
$TfbAuthRequest = new TfbAuthRequest();
$Publiccls = new PublicClass();
//初始化类实例
set_error_handler('my_error_handler');
$reqxmlcontext = $TfbAuthRequest->getReqContext($reqcontext);
//解密并获得请求数据
$arr_xml = $Publiccls->xml_to_array($reqxmlcontext);
$authorid = $arr_xml['operation_request']['msgheader']['channelinfo']['authorid'];
$arr_authorinfo = AuToken::getauthorusername($authorid);
$authortruename = $arr_authorinfo['username'];
$file = "../../" . CONST_LOGDIR . "/" . date('md') . "-" . $authortruename . "log" . ".txt";
$filehandle = fopen($file, "a");
$now = date('Y-m-d H:i:s');
fwrite($filehandle, $now . "\r\n======请求内容:\r\n" . $reqcontext . "\r\n\r\n" . $reqxmlcontext);
fclose($filehandle);
$apiAutoken = $TfbAuthRequest->apiAutoken($reqxmlcontext);
//授权码等信息验证
if ($apiAutoken && $api_name && $api_name_func) {
    spl_autoload_register(array('Loader', 'loadClass'));
    $classname = $api_name;
    $ApiClass = new $classname();
    $returnvalue = $ApiClass->{$api_name_func}();
Exemplo n.º 5
0
function readAuthorupicinfo($uploadpictype, $authorid)
{
    global $picurl, $g_propic;
    $dbfile = new DB_file();
    $Publiccls = new PublicClass();
    //初始化类实例
    $query = "select * from tb_upload_scategoty\n\t\t\tleft join tb_upload_fcategory  on fd_scat_fcatid=fd_fcat_id \n\t\t\twhere fd_scat_id='{$uploadpictype}'";
    $dbfile->query($query);
    if ($dbfile->nf()) {
        $dbfile->next_record();
        $ffoldername = g2u($dbfile->f(fd_fcat_foldername));
        $sfoldername = g2u($dbfile->f(fd_scat_foldername));
    }
    $arr_uplaod = getupload($uploadpictype, $authorid);
    //echo var_dump($arr_uplaod);
    $arr_message['picid'] = $arr_uplaod[0]['pic'];
    $arr_message['picpath'] = $arr_uplaod[1]['picpath'];
    $thumrul = str_replace("../", "", $arr_message['picpath']);
    if (@eregi('http', $thumrul)) {
        $arr_message['picpath'] = $thumrul;
    } else {
        $arr_message['picpath'] = $g_propic . $thumrul;
    }
    $arr_message['uploadpictype'] = g2u($uploadpictype);
    $arr_message['uploadmethod'] = $arr_message['picid'] ? "modi" : "new";
    $arr_message['uploadurl'] = $picurl . 'mobilepaypic/';
    $pictype = '格式:jpg|bmp|gif';
    $pictype = $pictype;
    $uplaodmessage = "<msgchild>";
    $uplaodmessage .= "<picid>" . $arr_message['picid'] . "</picid>";
    $uplaodmessage .= "<pictype>" . $pictype . "</pictype>";
    $uplaodmessage .= "<picpath>" . $arr_message['picpath'] . "</picpath>";
    $uplaodmessage .= "<uploadpictype>" . $arr_message['uploadpictype'] . "</uploadpictype>";
    $uplaodmessage .= "<uploadurl>" . $arr_message['uploadurl'] . "</uploadurl>";
    $uplaodmessage .= "<uploadmethod>" . $arr_message['uploadmethod'] . "</uploadmethod>";
    $uplaodmessage .= "</msgchild>";
    $arr_xml = $Publiccls->xml_to_array($uplaodmessage);
    return $arr_xml;
}
Exemplo n.º 6
0
 static function getrechargeSale($xml, $listno, $listid, $paytype = 'recharge', $bkntno, $arr_feeinfo)
 {
     $db = new DB_test();
     $Publiccls = new PublicClass();
     //初始化类实例
     $arr_xml = $Publiccls->xml_to_array($xml);
     $arr_channelinfo = $arr_xml['operation_request']['msgheader']['channelinfo'];
     $arr_body = $arr_xml['operation_request']['msgbody'];
     $paycardid = trim(GetPayCalcuInfo::readpaycardid($arr_body['paycardid']));
     $authorid = trim($arr_channelinfo['authorid']);
     //操作者
     $paydate = trim(date("Y-m-d"));
     //交易日期
     $fucardbank = u2g(trim($arr_body['bankname']));
     //银行名
     $paymoney = trim($arr_body['paymoney'] + 0);
     //交易摘要
     $fucardno = trim($arr_body['cardno']);
     //银行号
     $banktype = trim($arr_body['banktype']);
     //银行号
     $fucardphone = trim($arr_body['cardmobile']);
     //银行号
     $fucardman = u2g(trim($arr_body['cardman']));
     //银行号
     $arrivedate = $arr_feeinfo['arrivedate'];
     $paydate = $arr_feeinfo['paydate'];
     $bkmoney = $arr_feeinfo['bkmoney'];
     $payfeedirct = $arr_feeinfo['payfeedirct'];
     $bkordernumber = $arr_feeinfo['bkordernumber'];
     $sdcrid = $arr_feeinfo['sdcrid'];
     $sdcrpayfeemoney = $arr_feeinfo['sdcrpayfeemoney'];
     $payfee = $arr_feeinfo['feemoney'];
     $paymoney = $arr_feeinfo['paymoney'];
     $money = round($paymoney + $payfee, 2);
     $method = 'in';
     $method = u2g($method);
     $paytype = 'recharge';
     $query1 = "insert into tb_agentpaymoneylist(\n\t\t\t\t\tfd_agpm_no\t\t\t,fd_agpm_paycardid\t\t,fd_agpm_authorid\t ,\n\t\t\t\t\tfd_agpm_paydate\t    ,fd_agpm_shoucardno\t    ,fd_agpm_fucardno\t ,\n\t\t\t\t\tfd_agpm_bkntno\t\t,fd_agpm_payrq          ,fd_agpm_paytype     ,\n\t\t\t\t\tfd_agpm_current\t    ,fd_agpm_paymoney\t\t,fd_agpm_payfee\t\t ,\n\t\t\t\t\tfd_agpm_money\t\t,fd_agpm_shoucardbank   ,fd_agpm_shoucardman ,\n\t\t\t\t\tfd_agpm_shoucardmobile,fd_agpm_fucardbank\t,fd_agpm_fucardmobile,\n\t\t\t\t\tfd_agpm_fucardman   ,fd_agpm_feebankid      ,fd_agpm_state       ,\n\t\t\t\t\tfd_agpm_listid      ,fd_agpm_listno         ,fd_agpm_method      ,\n\t\t\t\t\tfd_agpm_datetime    ,fd_agpm_payfeedirct    ,fd_agpm_arrivedate  ," . "fd_agpm_bkordernumber,fd_agpm_bkmoney ,fd_agpm_sdcrid      ," . "fd_agpm_sdcrpayfeemoney)values\n\t\t\t\t\t('{$listno}'\t\t,'{$paycardid}'\t,'{$authorid}'\t\t,\n\t\t\t\t\tnow()\t\t,'{$shoucardno}'\t,'{$fucardno}'\t\t,\n\t\t\t\t\t'{$bkntno}'\t\t,'01'\t\t\t,'{$paytype}'\t\t\t,\n\t\t\t\t\t'{$current}'\t\t,'{$paymoney}'\t,'{$payfee}'\t\t\t,\n\t\t\t\t\t'{$paymoney}'\t\t\t,'{$shoucardbank}','{$shoucardman}'\t\t,\n\t\t\t\t\t'{$shoucardmobile}','{$fucardbank}'\t,'{$fucardphone}'  \t,\n\t\t\t\t\t'{$fucardman}'\t\t,'{$feebankid}'\t,'0'\t            ,\t\t\n\t\t\t\t\t'{$listid}'\t\t,'{$listno}'\t    ,'{$method}'\t,now()  ," . "'{$payfeedirct}'   ,'{$arrivedate}'  , '{$bkordernumber}'  , " . "'{$bkmoney}'   ,'{$sdcrid}' ,'{$sdcrpayfeemoney}'   \t\t\t)";
     $db->query($query1);
     return 1;
 }
Exemplo n.º 7
0
<?php

header('Content-Type:text/html;charset=utf-8');
require "../include/common.inc.php";
$db = new DB_test();
error_reporting(E_ERROR);
//error_reporting(E_ERROR| E_WARNING| E_PARSE);
$Publiccls = new PublicClass();
//初始化类实例
$xmlcontent = $_POST['xmlcontent'];
$getAndroidcontent = $xmlcontent;
//$getAndroidcontent = (str_replace("\\", "", $getAndroidcontent));
$arr_xml = $Publiccls->xml_to_array($getAndroidcontent);
//示例的做法
//set_error_handler ( 'my_error_handler' );
$api_name = $arr_xml['operation_request']['msgheader']['channelinfo']['api_name'];
$api_name_func = $arr_xml['operation_request']['msgheader']['channelinfo']['api_name_func'];
$param = $getAndroidcontent;
//echo $xmlcontent;exit;
$xmlcontent = u2g($xmlcontent);
if ($api_name) {
    $query = "update web_test_interface set fd_interface_demo = '{$xmlcontent}' where fd_interface_apinamefunc= '{$api_name_func}' and fd_interface_apiname = '{$api_name}'";
    $db->query($query);
    //echo $query;exit;
    $arr_message = array("result" => "success", "message" => "保存成功!");
    $arr_msg['msgbody']['result'] = $arr_message['result'];
    $arr_msg['msgbody']['message'] = $arr_message['message'];
    //echo $query;exit;
    $returnvalue = array('operation_response' => array('msgheader' => array('req_seq' => '21', 'req_token' => $au_token, 'req_bkenv' => $req_bkenv, 'retinfo' => array('rettype' => '0', 'retcode' => '0', 'retmsg' => '成功')), "msgbody" => $arr_msg['msgbody']));
}
echo xml_encode($returnvalue, 'utf-8');