doPagePay

作者: 深度_1175 | 来源:发表于2018-08-07 18:23 被阅读0次
//支付
    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);
        }

相关文章

网友评论

      本文标题:doPagePay

      本文链接:https://www.haomeiwen.com/subject/cdgavftx.html