Example #1
0
 /**
  * 支付方式
  * 1.money
  * 2.credits
  * 3.money+credits
  */
 private function payafter()
 {
     if (($this->Paymethod & 2) == 2) {
         $credits = $this->GoodsValues['credits_value'];
         if ($credits == 0) {
             $paymethod = $this->Orderinfo['paymethod'];
             $payprocess = $this->Orderinfo['payprocess'];
             $payprocess |= 2;
             if ($payprocess == $paymethod) {
                 $params['order_status'] = 25;
                 //支付完成
                 $params['pay_status'] = 2;
                 //支付完成
             }
             $params['payprocess'] = $payprocess;
             $re = $this->obj->update('order', $params, " where order_id='" . $_REQUEST['out_trade_no'] . "'");
             if ($payprocess == $paymethod) {
                 require_once CUR_CONF_PATH . 'lib/sms.class.php';
                 $sms = new sms($this->Orderinfo['order_id']);
                 $sms->sendsms();
             }
             return 1;
         }
         /**
                     if(!$credits)
                          $this -> errorOutput("NO_CREDITS_ENOUGH");
                     **/
         //1.Money 2.Credits 3.Credits+Money
         require ROOT_PATH . 'lib/class/members.class.php';
         $members = new members();
         $url = "http://" . $this->settings['App_payments']['host'] . "/" . $this->settings['App_payments']['dir'];
         $url .= "/callback_url.php?access_token=" . $this->user['token'];
         $extend = 'out_trade_no=' . $this->Orderinfo['order_id'];
         $callback = array('url' => $url, 'extend' => $extend);
         is_array($this->GoodsInfos) && ($appUniqueidArr = array_keys($this->GoodsInfos));
         $creditLogTitle = $this->input['creditLogTitle'] ? $this->input['creditLogTitle'] : ($this->settings['creditLogTitle'][$appUniqueidArr[0]] ? $this->settings['creditLogTitle'][$appUniqueidArr[0]] : '订单支付');
         $re = $members->consume_credits($this->user['user_id'], $credits, $this->Orderinfo['order_id'], 'payments', 'OrderUpdate', 'create', $this->order_title, $callback, $creditLogTitle);
         if (!$re['logid']) {
             $this->errorOutput("NO_CREDITS_ENOUGH");
         }
     }
     //end if
 }