<?php
error_reporting(0);
include "../../../config/ht.php";
include_once("WxPayPubHelper.php");
$code=ubo(base64_decode($_GET[code]));
if (strpos($code, "|ubo|") !== false) {
$p= explode("|ubo|",$code); 
$ddh=$p[0];//提交的订单号
$money=$p[1];//提交的支付金额
$userid=$p[2];//提交的用户ID
$shipinid=$p[3];//提交的资源ID
$lx=$p[4];//
$ip=$p[5];//
$ddhto=$p[6];
$payid=$p[7];
}
//这里插入支付///------------------------------------------------------------统一配置
$ddmulu="../../../".date("Y-m-d")."ddh";
mkdir ($ddmulu);
$ddmulu2="../../../".date("Y-m-d",strtotime("-1 day"))."ddh";
del_dir($ddmulu2);
$ddhcj = $ddmulu."/".$ddh.".txt";
if (file_exists($ddhcj)) {
}else{
$ddhwb =$ddh."|ubo|".$money."|ubo|".$userid."|ubo|".$shipinid."|ubo|".$lx."|ubo|".$ip."|ubo|".$ddhto."|ubo|".$hzpaylist[id]."|ubo|".$_SERVER["HTTP_HOST"]."|ubo|".$paylx."|ubo|".$blx;
writefile($ddhcj,$ddhwb);
}
$ttp = json_encode(array("fee" => "$money", "ddh" =>"$ddh"));
$payurl='https://open.weixin.qq.com/connect/oauth2/authorize?appid='.WxPayConf_pub::APPID.'&redirect_uri='.urlencode(WxPayConf_pub::JS_API_CALL_URL).'&response_type=code&scope=snsapi_base&state='.$ttp.'&connect_redirect=1#wechat_redirect';
header ("location:$payurl");
?>