$value){
echo "$key : $value
";
}
}
if (!empty($_GET['orderid']) && $_GET['orderid'] !=='false'){
$orderno=$_GET['orderid'];
}else{
echo "";
exit;
}
$notify = new NativePay();
//模式二
/**
* 流程:
* 1、调用统一下单,取得code_url,生成二维码
* 2、用户扫描二维码,进行支付
* 3、支付完成之后,微信服务器会通知支付成功
* 4、在支付成功通知中需要查单确认是否真正支付成功(见:notify.php)
*/
$url="http://xmwxc.zhizhuchuxing.cn/fx/order_detail.php?orderno=".$orderno;
$result=http_request($url);
$orderDetail=json_decode($result,true);
// die;
if($orderDetail['order_status']==146){
$successurl="http://xmwxc.zhizhuchuxing.cn/fx/order_detail.php?orderno=".$orderno;
Header("Location: $successurl");
exit;
}
$money=1;//(int)$orderDetail['order_price'];
//var_dump($money);die;
if ($money == 0){
$successurl="http://xmwxc.zhizhuchuxing.cn/fx/order_detail.php?orderno=".$orderno;
Header("Location: $successurl");
exit;
}
$name=$orderDetail['prod_name'];
$reurl=dirname("http://xmwxc.zhizhuchuxing.cn/wechat/WxPay/realpay/success_notify_fx.php");
//var_dump($result);die;
$SetBody=$name.": ".$orderno;
$input = new WxPayUnifiedOrder();
$input->SetBody($SetBody);
$input->SetAttach("xi");
$SetOut_trade_no=$orderno."-".date("ymdHis");
$input->SetOut_trade_no($SetOut_trade_no);
$input->SetTotal_fee($money);
$input->SetTime_start(date("YmdHis"));
$input->SetTime_expire(date("YmdHis", time() + 600));
$input->SetGoods_tag("代金券");
$input->SetNotify_url($reurl);
$SetTrade_type="NATIVE";
$input->SetTrade_type("$SetTrade_type");
$input->SetProduct_id($orderno);
$result = $notify->GetPayUrl($input);
$url2 = $result["code_url"];
//ile_put_contents('native.log', $url2);
?>