亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

? ?? ??? ?? ?? Thinkphp? onethink? WeChat ?? ????? ??????.

Thinkphp? onethink? WeChat ?? ????? ??????.

Feb 21, 2017 pm 03:05 PM

? ???? Thinkphp? ??? ?? ?? ????? ?? ???? ???, ?? ?? ????

thinkPHP? ??? ?? ?? ????? ???? ??? ???? ?? ??? ??? ? ??. jssdk? ??? ?????. ??? ??? ????? ??? ????. ??? ??? ??? ?????.

//實現(xiàn)的Wxpay鉤子方法
    public function Wxpay($param){
      require './Addons/Wxpay/WxPayPubHelper/WxPayPubHelper.php';
      $jsApi = new \JsApi_pub(); 
       
      //=========步驟1:網(wǎng)頁授權(quán)獲取用戶openid============
      if (!isset($_GET['code']))
      {
        //觸發(fā)微信返回code碼
        $url = $jsApi->createOauthUrlForCode(\WxPayConf_pub::JS_API_CALL_URL.'/order_id/'.$param['order_id']);
        Header("Location: $url");
      }else
      {
        $order_id = $param['order_id'];
        $info = M('Order')->where('id='.$order_id)->find();
        if(empty($info) || $info['is_pay'] == 1){
          dump('該訂單不存在或已支付'.$order_id);
          exit();
        }
        $this->assign('info', $info);
        $a = $info['money'];
        $b = 100;
        $c = $a * $b;
         
        //獲取code碼,以獲取openid
        $code = $_GET['code'];
        $jsApi->setCode($code);
        $openid = $jsApi->getOpenId();
      }
       
      //=========步驟2:使用統(tǒng)一支付接口,獲取prepay_id============
      //使用統(tǒng)一支付接口
      $unifiedOrder = new \UnifiedOrder_pub();
       
      $unifiedOrder->setParameter("openid","$openid");//商品描述
      $unifiedOrder->setParameter("body","在線預訂");//商品描述
      //自定義訂單號,此處僅作舉例
      $timeStamp = time();
//       $out_trade_no = \WxPayConf_pub::APPID."$timeStamp";
      $out_trade_no = $info['ordersn'];
      $unifiedOrder->setParameter("out_trade_no", "$out_trade_no");//商戶訂單號
      $unifiedOrder->setParameter("total_fee", "$c");//總金額
      $unifiedOrder->setParameter("notify_url",\WxPayConf_pub::NOTIFY_URL.'/order_id/'.$param['order_id']);//通知地址
      $unifiedOrder->setParameter("trade_type","JSAPI");//交易類型
       
      $prepay_id = $unifiedOrder->getPrepayId();
      //=========步驟3:使用jsapi調(diào)起支付============
      $jsApi->setPrepayId($prepay_id);
      $jsApiParameters = $jsApi->getParameters();
      $this->assign('jsApiParameters', $jsApiParameters);
 
      $this->display('pay');
    }

? ??? ? ??? ?? ?????. ?? ??? PHP ????? ???? ??? ? ??? ??? ????.

Thinkphp ? onethink? WeChat ?? ???? ??? ??? ? ?? ??? ??? PHP ??? ????? ?????!

? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

??? ????
1597
29
PHP ????
1488
72
???