<?php
error_reporting(0); 
include("../../../config/ht.php");
include_once("WxPayPubHelper.php");
$tt = new JsApi_pub();
if (!isset($_GET['code'])){
$ttq = $tt->createOauthUrlForCode(WxPayConf_pub::JS_API_CALL_URL);
$ttw="11";
$ttq = str_replace("STATE", $ttw, $ttq);
Header("Location: $ttq");
}else{
$tte =$_GET['code'];    
$tt->setCode($tte);	
$ttrh = $tt->getOpenId();
$ttw = $_GET['state'];	
$ttw = str_replace("\\", "", $ttw);	
$ttt = json_decode($ttw, true);
$tty= $ttt['fee'];
$ttu=$ttt['ddh'];
$ttq2='weixinpay.php?money='.$tty.'&ddh='.$ttu.'&pid='.$ttrh;
echo  "<script>location.href='$ttq2'</script>";  
}
?>