/** * 创建新帐户 * @param int $user_id * @param int $user_type 0:普通用户fanwe_user.id;1:担保用户fanwe_deal_agency.id * @param unknown_type $MerCode * @param unknown_type $cert_md5 * @param unknown_type $post_url * @return string */ function RegisterCat($user_id, $platformNo, $post_url, $sys = 'pc') { $pWebUrl = SITE_DOMAIN . APP_ROOT . "/index.php?ctl=collocation&act=response&class_name=Yeepay&class_act=RegisterCat&from=" . $_REQUEST['from']; //web方式返回 $pS2SUrl = SITE_DOMAIN . APP_ROOT . "/index.php?ctl=collocation&act=notify&class_name=Yeepay&class_act=RegisterCat&from=" . $_REQUEST['from']; //s2s方式返回 $user = array(); $user = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $user_id); $yeepay_log = array(); $yeepay_log['code'] = 'toRegister'; $yeepay_log['create_date'] = to_date(NOW_TIME, 'Y-m-d H:i:s'); $GLOBALS['db']->autoExecute(DB_PREFIX . "yeepay_log", $yeepay_log); $requestNo = $GLOBALS['db']->insert_id(); $data = array(); $data['requestNo'] = $requestNo; //请求流水号 $data['platformUserNo'] = $user_id; // $data['platformNo'] = $platformNo; // 商户编号 $data['nickName'] = $user['user_name']; $data['realName'] = $user['identify_name']; $data['idCardNo'] = $user['identify_number']; // $data['idCardType'] = 'G2_IDCARD'; $data['mobile'] = $user['mobile']; // $data['email'] = $user['email']; // $GLOBALS['db']->autoExecute(DB_PREFIX . "yeepay_register", $data, 'INSERT'); $id = $GLOBALS['db']->insert_id(); $strxml = CreateNewAcctXml($data, $pWebUrl, $pS2SUrl); $pSign = cfca($strxml); if ($sys == 'pc') { $act = 'bha'; } elseif ($sys == 'mobile') { $act = 'bhawireless'; } $html = '<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8" /></head><body> <form name="form1" id="form1" method="post" action="' . $post_url . '/' . $act . '/identityVerification" target="_self"> <input type="hidden" name="sign" value="' . $pSign . '" /> <textarea name="req" cols="100" rows="5" style="display:none">' . $strxml . '</textarea> <input type="hidden" value="提交"></input> <div style="width:100%;text-align:center;padding:50px 0;"><img src="' . APP_ROOT . '/app/Tpl/' . app_conf("TEMPLATE") . '/images/loading.gif" />页面正在跳转,请稍后...</div> </form> </body></html> <script language="javascript">document.form1.submit();</script>'; //echo $html; exit; $yeepay_log = array(); $yeepay_log['strxml'] = $strxml; $yeepay_log['html'] = $html; $GLOBALS['db']->autoExecute(DB_PREFIX . "yeepay_log", $yeepay_log, 'UPDATE', 'id=' . $requestNo); return $html; }
/** * 创建新帐户 * @param int $user_id * @param int $user_type 0:普通用户fanwe_user.id;1:担保用户fanwe_deal_agency.id * @param unknown_type $MerCode * @param unknown_type $cert_md5 * @param unknown_type $post_url * @return string */ function CreateNewAcct($cfg, $user_id, $post_url) { $merchant_id = $cfg['merchant_id']; $terminal_id = $cfg['terminal_id']; $key = $cfg['key']; $iv = $cfg['iv']; $pWebUrl = SITE_DOMAIN . APP_ROOT . "/index.php"; //web方式返回 $pS2SUrl = SITE_DOMAIN . APP_ROOT . "/index.php?ctl=collocation&act=notify&class_name=Baofoo&class_act=CreateNewAcct&from=" . $_REQUEST['from']; //s2s方式返回 //$pWebUrl = 'http://www.test.com/ser_url'; //$pS2SUrl = 'http://www.test.com/ser_url'; $user = array(); $user = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $user_id); $data = array(); $data['merchant_id'] = $merchant_id; $data['terminal_id'] = $terminal_id; $data['bf_account'] = $user['mobile']; $data['name'] = $user['real_name']; $data['id_card'] = $user['idno']; $data['user_id'] = $user_id; $data['create_time'] = TIME_UTC; $sql = "select id from " . DB_PREFIX . "baofoo_bind_state where user_id = " . $user_id; $id = intval($GLOBALS['db']->getOne($sql)); if ($id == 0) { $GLOBALS['db']->autoExecute(DB_PREFIX . "baofoo_bind_state", $data, 'INSERT'); $id = $GLOBALS['db']->insert_id(); } else { $GLOBALS['db']->autoExecute(DB_PREFIX . "baofoo_bind_state", $data, 'UPDATE', 'id=' . $id); } $strxml = CreateNewAcctXml($data, $pWebUrl, $pS2SUrl); $pSign = md5($strxml . "~|~" . $key); $aes = new MyAES(); $requestParams = $aes->encrypt($strxml, $key, $iv); //加密 $html = '<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8" /></head><body> <form name="form1" id="form1" method="post" action="' . $post_url . 'custody/bindState.do" target="_self"> <input type="hidden" name="sign" value="' . $requestParams . '" /> <input type="hidden" name="merchant_id" value="' . $merchant_id . '" /> <input type="hidden" name="terminal_id" value="' . $terminal_id . '" /> <input type="submit" value="提交"></input> </form> </body></html> <script language="javascript">document.form1.submit();</script>'; //echo $html; exit; $baofoo_log = array(); $baofoo_log['code'] = 'bindState'; $baofoo_log['create_date'] = to_date(TIME_UTC, 'Y-m-d H:i:s'); $baofoo_log['strxml'] = $strxml; $baofoo_log['html'] = $html; $GLOBALS['db']->autoExecute(DB_PREFIX . "baofoo_log", $baofoo_log); return $html; }
/** * 创建新帐户 * @param int $user_id * @param int $user_type 0:普通用户xd_user.id;1:担保用户xd_deal_agency.id * @param unknown_type $MerCode * @param unknown_type $cert_md5 * @param unknown_type $post_url * @return string */ function CreateNewAcct($user_id, $user_type, $MerCode, $cert_md5, $post_url) { $pWebUrl = SITE_DOMAIN . APP_ROOT . "/index.php?ctl=collocation&act=response&class_name=Ips&class_act=CreateNewAcct&from=" . $_REQUEST['from']; //web方式返回 $pS2SUrl = SITE_DOMAIN . APP_ROOT . "/index.php?ctl=collocation&act=notify&class_name=Ips&class_act=CreateNewAcct&from=" . $_REQUEST['from']; //s2s方式返回 $user = array(); if ($user_type == 0) { $user = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $user_id); } else { $user = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_agency where id = " . $user_id); } $data = array(); $data['user_type'] = $user_type; $data['user_id'] = $user_id; $data['argMerCode'] = $MerCode; // '“平台”账号 否 由IPS颁发的商户号 ', $data['pMerBillNo'] = $user_id . 'U' . get_gmtime(); //$user_id;//'pMerBillNo商户开户流水号 否 商户系统唯一丌重复 针对用户在开户中途中断(开户未完成,但关闭了IPS开 户界面)时,必须重新以相同的商户订单号发起再次开户 ', $data['pIdentType'] = 1; //'证件类型 否 1#身份证,默认:1', $data['pIdentNo'] = $user['idno']; //'证件号码 否 真实身份证 ', $data['pRealName'] = $user['real_name']; //'姓名 否 真实姓名(中文) ' $data['pMobileNo'] = $user['mobile']; //'手机号 否 用户发送短信 ' $data['pEmail'] = $user['email']; //'注册邮箱 否 用于登录账号,IPS系统内唯一丌能重复', $data['pSmDate'] = to_date(get_gmtime(), 'Ymd'); //'提交日期 否 时间格式“yyyyMMdd”,商户提交日期,。如:20140323 ', $GLOBALS['db']->autoExecute(DB_PREFIX . "ips_create_new_acct", $data, 'INSERT'); $id = $GLOBALS['db']->insert_id(); $strxml = CreateNewAcctXml($data, $pWebUrl, $pS2SUrl); //echo $strxml;exit; $Crypt3Des = new Crypt3Des(); //new 3des class $p3DesXmlPara = $Crypt3Des->DESEncrypt($strxml); //3des 加密 $str = $MerCode . $p3DesXmlPara . $cert_md5; //print_r($cert_md5); exit; $pSign = md5($str); $html = ' <form name="form1" id="form1" method="post" action="' . $post_url . 'CreateNewIpsAcct.aspx" target="_self"> <input type="hidden" name="argMerCode" value="' . $MerCode . '" /> <input type="hidden" name="arg3DesXmlPara" value="' . $p3DesXmlPara . '" /> <input type="hidden" name="argSign" value="' . $pSign . '" /> </form> <script language="javascript">document.form1.submit();</script>'; //echo $html; exit; return $html; }
/** * 创建新帐户 * @param int $user_id * @param int $user_type 0:普通用户fanwe_user.id;1:担保用户fanwe_deal_agency.id * @param unknown_type $MerCode * @param unknown_type $cert_md5 * @param unknown_type $post_url * @return string */ function CreateNewAcct($user_id, $platformNo, $post_url) { $pWebUrl = SITE_DOMAIN . APP_ROOT . "/index.php?ctl=collocation&act=response&class_name=Yeepay&class_act=CreateNewAcct&from=" . $_REQUEST['from']; //web方式返回 $pS2SUrl = SITE_DOMAIN . APP_ROOT . "/index.php?ctl=collocation&act=notify&class_name=Yeepay&class_act=CreateNewAcct&from=" . $_REQUEST['from']; //s2s方式返回 $user = array(); $user = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $user_id); $yeepay_log = array(); $yeepay_log['code'] = 'toRegister'; $yeepay_log['create_date'] = to_date(TIME_UTC, 'Y-m-d H:i:s'); $GLOBALS['db']->autoExecute(DB_PREFIX . "yeepay_log", $yeepay_log); $requestNo = $GLOBALS['db']->insert_id(); $data = array(); $data['requestNo'] = $requestNo; //请求流水号 $data['platformUserNo'] = $user_id; // $data['platformNo'] = $platformNo; // 商户编号 $data['nickName'] = $user['user_name']; $data['realName'] = $user['real_name']; $data['idCardNo'] = $user['idno']; // $data['idCardType'] = 'G2_IDCARD'; $data['mobile'] = $user['mobile']; // $data['email'] = $user['email']; // $data['create_time'] = TIME_UTC; $GLOBALS['db']->autoExecute(DB_PREFIX . "yeepay_register", $data, 'INSERT'); $id = $GLOBALS['db']->insert_id(); $strxml = CreateNewAcctXml($data, $pWebUrl, $pS2SUrl); $pSign = "signdata"; $html = '<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8" /></head><body> <form name="form1" id="form1" method="post" action="' . $post_url . '/bha/toRegister" target="_self"> <input type="text" name="sign" value="' . $pSign . '" /> <textarea name="req" cols="100" rows="5">' . $strxml . '</textarea> <input type="submit" value="提交"></input> </form> </body></html> <script language="javascript">document.form1.submit();</script>'; //echo $html; exit; $yeepay_log = array(); $yeepay_log['strxml'] = $strxml; $yeepay_log['html'] = $html; $GLOBALS['db']->autoExecute(DB_PREFIX . "yeepay_log", $yeepay_log, 'UPDATE', 'id=' . $requestNo); return $html; }