//支付
public function doPagePay(){
global $_W, $_GPC;
include IA_ROOT.'/addons/zh_cjdianc/wxpay.php';
$res=pdo_get('cjdc_pay',array('uniacid'=>$_W['uniacid']));
$res2=pdo_get('cjdc_system',array('uniacid'=>$_W['uniacid']));
$appid=$res2['appid'];
$openid=$_GPC['openid'];//oQKgL0ZKHwzAY-KhiyEEAsakW5Zg
$mch_id=$res['mchid'];
$key=$res['wxkey'];
$out_trade_no = $mch_id. time();
$root=$_W['siteroot'];
if($_GPC['type']==2){
pdo_update('cjdc_czorder',array('code'=>$out_trade_no),array('id'=>$_GPC['order_id']));
}elseif($_GPC['type']==3){
pdo_update('cjdc_hyorder',array('code'=>$out_trade_no),array('id'=>$_GPC['order_id']));
}else{
pdo_update('cjdc_order',array('code'=>$out_trade_no),array('id'=>$_GPC['order_id']));
}
$total_fee =$_GPC['money'];
if(empty($total_fee)) //押金
{
$body = "订单付款";
$total_fee = floatval(99*100);
}else{
$body = "订单付款";
$total_fee = floatval($total_fee*100);
}
$weixinpay = new WeixinPay($appid,$openid,$mch_id,$key,$out_trade_no,$body,$total_fee,$root);
$return=$weixinpay->pay();
echo json_encode($return);
}
网友评论