php富友表单提交接口对接

 

//此处是富友注册接口对接,采用表单的形式,pc和wap调用的是不同的接口

<?php


define('IN_ECS', true);

require(dirname(__FILE__) . '/includes/init.php');
require(ROOT_PATH . 'includes/lib_payment.php');
require(ROOT_PATH . 'includes/lib_order.php');
include_once(ROOT_PATH . 'includes/lib_common.php');

$user_name = $_SESSION['user_name'] ? $_SESSION['user_name'] : '';
$mobile_no = $user_name;

$mchnt_cd= '0001000F0394632';
$mchnt_txn_ssn = date('ymd').substr(time(),-5).substr(microtime(),2,5);
//证件类型
$certif_tp = 0;
//身份证号
$certif_id = $_GET['identity'];
//$login_id='13513613962';
$page_notify_url= 'http://jr.yhsx99.com/respcregister.php';
$back_notify_url= 'http://jr.yhsx99.com/respcregister.php';
$ver='0.44';
$private_key_path = "../modules/php_prkey.pem";
$data =$back_notify_url."|||".$certif_id."||||".$mchnt_cd."|".$mchnt_txn_ssn."|".$mobile_no."|". $page_notify_url."|||".$ver;

$signature = rsaSign($data, $private_key_path);




function rsaSign($data, $private_key_path) {

$priKey = file_get_contents($private_key_path);

$res = openssl_get_privatekey($priKey);

openssl_sign($data, $sign, $res);
openssl_free_key($res);
//base64编码
$sign = base64_encode($sign);

return $sign;
}


?>
<html>
<body>
<script type="text/javascript">
window.onload=function(){
if (window.history && window.history.pushState) {
window.onpopstate=function(){
window.history.pushState('forward', null, '#');
window.history.forward(1);
alert("请先完成注册,再进行其他操作!")
}
window.history.pushState('forward', null, '#');
window.history.forward(1); 
}
} 
</script>
<!-- .site-topbar END -->
<link rel="stylesheet" type="text/css" href="css/login.css"/>
<link rel="stylesheet" type="text/css" href="themes/xiaomi/css/user.css"/>
<link href="css/register.css?20150511" rel="stylesheet" type="text/css" />
<link href="css/found.css" rel="stylesheet" type="text/css" />
<div class="suc_content reg-account nojsp" style="width: 100%;">
<!-- {if $action eq 'login'} -->
<div id="list4_content" style="margin-top: -81px;margin-bottom:-114px;">
<div class="inner_tu">
<div class="inner clearfix">
<div class="denglu_part">
<h3>身份验证成功<br/>请开通富友金账户,开启理财之路!</h3>
<form name="form2" action="https://jzh.fuiou.com/webReg.action" method="post">
<input type="hidden" name="mchnt_txn_ssn" id="mchnt_txn_ssn" value="<?php echo $mchnt_txn_ssn;?>"/>
<input type="hidden" name="mchnt_cd" id="mchnt_cd" value="<?php echo $mchnt_cd;?>" />
<input type="hidden" name="certif_tp" id="certif_tp" value="<?php echo $certif_tp;?>"/>
<input type="hidden" name="certif_id" id="certif_id" value="<?php echo $certif_id;?>"/>
<input type="hidden" name="login_id" id="login_id" value="13074158986"/>
<input type="hidden" name="ver" id="ver" value="<?php echo $ver;?>"/>
<input type="hidden" name="mobile_no" id="mobile_no" value="<?php echo $mobile_no;?>"/>
<input type="hidden" name="page_notify_url" id="page_notify_url" value="<?php echo $page_notify_url;?>" />
<input type="hidden" name="back_notify_url" id="back_notify_url" value="<?php echo $back_notify_url;?>"/>
<input type="hidden" name="signature" id="signature" value="<?php echo $signature;?>" />

<div class="sub_login flt_l">

<input type="submit" class="no_bg" value="去注册>>" />
</div>
</div>
</div>
</form>
</div>
</div>

</div>
</div>


</body>
</html>

posted @ 2017-07-07 15:16  wuli梦梦  阅读(1188)  评论(0编辑  收藏  举报