查询订单
@param array $params
@return array|mixed|object
@throws Exception
551625
public function QPayOrderQuery($params = array()){
        /*        //入参
                $params = array();
                $params["out_trade_no"] = "20160512161914_BBC";
                $params["sub_mch_id"] = "1900005911";*/
        if (empty($params["out_trade_no"])){
            throw new Exception('商户订单号参数不能缺少' ,'OUT_TRADE_NO_MUST_INPUT');
        }
        if (empty($params["sub_mch_id"])){
            throw new Exception('sub_mch_id不能缺少' ,'FEE_TYPE');
        }

        //api调用
        $qpayApi = new QpayMchAPI('https://qpay.qq.com/cgi-bin/pay/qpay_order_query.cgi', null, 10);
        $qpayApi->setMchId('1490434181');
        $qpayApi->setMchKey('8525638f86969d1de5c51ad0494f4f13');
        $ret = $qpayApi->reqQpay($params);
        return QpayMchUtil::xmlToArray($ret);
    }
135775
private function apiGet($url, $params)
    {
        $url = $url . (strpos($url, '?') === false ? '?' : '') . http_build_query($params);

        try {
            $response = $this->httpClient->request('GET', $url, [
                'headers' => [
                    'user-key' => $this->igdbKey,
                    'Accept' => 'application/json'
                ]
            ]);
        } catch (RequestException $exception) {
            if ($response = $exception->getResponse()) {
                throw new \Exception($exception);
            }
            throw new \Exception($exception);
        } catch (Exception $exception) {
            throw new \Exception($exception);
        }

        return $response->getBody();
    }
1195154
public function execute(array $params = [])
    {
        $this->formatSqlByParams($params);
        $result = $this->connection->query($this->sql);
        if ($result === false) {
            throw new MysqlException('Mysql execute error，connectError=' . $this->connection->connect_error . ' error=' . $this->connection->error);
        }

        $this->pushSqlToStack($this->sql);

        return $result;
    }
1080192
private static function getParamObject(array $params) {
        $obj              = new stdClass;
        $obj->paramData   = array();
        $obj->paramIsFile = array();
        foreach ($params as $key => $value) {
            if (strpos($key, '@') === 0) {
                $obj->paramData[substr($key, 1)]   = self::safeGetContents($key, $value);
                $obj->paramIsFile[substr($key, 1)] = true;
            } elseif (strpos($key, '#') === 0) {
                $obj->paramData[substr($key, 1)]   = $value;
                $obj->paramIsFile[substr($key, 1)] = true;
            } else {
                $obj->paramData[$key]   = $value;
                $obj->paramIsFile[$key] = false;
            }
        }
        return $obj;
    }
211149
public function pay($method, array $params)
    {
        $method = get_class($this) . '\\' . Str::uFirst($method) . 'Gateway';
        if (!class_exists($method)) {
            throw new \Exception('支付方式类[' . $method . ']不存在');
        }
        $app = new $method($params);
        return $app->pay();
    }
87992
public function fetchRequestToken(array $params = [])
    {
        $this->setAccessToken(null);
        $defaultParams = [
            'oauth_consumer_key' => $this->consumerKey,
            'oauth_callback' => $this->getReturnUrl(),
            //'xoauth_displayname' => Yii::$app->name,
        ];
        if (!empty($this->scope)) {
            $defaultParams['scope'] = $this->scope;
        }

        $request = $this->createRequest()
            ->setMethod($this->requestTokenMethod)
            ->setUrl($this->requestTokenUrl)
            ->setData(array_merge($defaultParams, $params));

        $this->signRequest($request);

        $response = $this->sendRequest($request);

        $token = $this->createToken([
            'params' => $response
        ]);
        $this->setState('requestToken', $token);

        return $token;
    }
838347
public function get($params = null)
    {
        $curlHandle = $this->prepareGet($params);
        return $this->curlGetResponse($curlHandle);
    }
330921
public function createOrder(Array $params)
    {
        $createOrderRequest = $this->getRequestParam('CreateOrderRequestParam', $params, $this->config, $this->sign);

        $result = $this->executeRequest($createOrderRequest);

        if ($result['return_code'] != "SUCCESS") {
            return $this->error($result['return_msg'], $result);
        }
        if (!$this->sign->verifySign($result, $this->config['key'])) {
            return $this->error("验证微信的签名失败", $result);
        }
        if ($result['result_code'] != 'SUCCESS') {
            $message = "err_code＝{$result['err_code']}, err_code_des＝{$result['err_code_des']}";
            return $this->error($message, $result);
        }

        return $this->responseCreateOrder($result);
    }
340016
protected function getHeader(array $params)
	{
		// Prepare the function's header
		$header = "/**\n";
		foreach ($params as $paramName => $paramType)
		{
			$header .= '* @param {' . $paramType . '} ' . $paramName . "\n";
		}
		$header .= "*/\n";

		return $header;
	}
1320992
public function create(array $params = [])
    {
        return $this->executeRequest(
            RequestMethodEnum::POST,
            ResourceMethodEnum::CREATE,
            $params,
            null
        );
    }
67075
protected function call(array $params)
    {
        $defaultParams = [
            'key'        => $this->apiKey,
            'format'     => 'json',
            'apiVersion' => self::VERSION,
        ];

        $params = array_merge($defaultParams, $params);

        $url = sprintf('%s?%s', self::ENDPOINT, http_build_query($params));

        $response = $this->adapter->get($url);

        $result = json_decode($response->getBody()->getContents(), true);

        if ($result['result'] == 'ERR') {
            throw new ApiException($result['message'], $result['code']);
        }

        return $result;
    }
1260808
public function bind(array $params)
    {
        foreach ($params as $key => $value) {
            $this->addParam($value, $key);
        }
        return $this;
    }
1100114
public function loadObject($params=array()) {

		$this->openConnection();
		
		$obj = NULL;
		
		try {
			
			$stat = $this->handler->prepare($this->query);
			$stat->execute((array)$params);
			$obj = $stat->fetch(\PDO::FETCH_OBJ);
			
			// logger
			$this->logParamQuery($this->query, (bool)$obj, $params);

		} catch (\PDOException $e) {

			$this->handleException($e, $params);
		
		}
		
		$stat->closeCursor();

		return $obj;
		
	}
825347
public function QPayMicroPay($params = array()){
      //入参q
/*      $params["out_trade_no"] = "20160512161914_BBC" . "A";
      $params["sub_mch_id"] = "1900005911";
      $params["body"] = "body_test_中文";
      $params["device_info"] = "WP00000001";
      $params["fee_type"] = "CNY";
      $params["notify_url"] = "https://10.222.146.71:80/success.xml";
      $params["spbill_create_ip"] = "127.0.0.1";
      $params["total_fee"] = "1";
      $params["trade_type"] = "MICROPAY";
      $params["auth_code"] = "910728310408849937";*/
//      if (empty($params["out_trade_no"])){
//          throw new Exception('商户订单号参数不能缺少' ,'OUT_TRADE_NO_MUST_INPUT');
//      }
//      if (empty($params["fee_type"])){
//          throw new Exception('货币类型不能缺少' ,'FEE_TYPE');
//      }
//      if (empty($params["total_fee"])){
//          throw new Exception('订单金额不能缺少' ,'TOTAL_FEE');
//      }
//      if (empty($params["spbill_create_ip"])){
//          throw new Exception('终端IP不能缺少' ,'SPBILL_CREATE_IP');
//      }
//      if (empty($params["device_info"])){
//          throw new Exception('设备号不能缺少' ,'DEVICE_INFO');
//      }
//      if (empty($params["auth_code"])){
//          throw new Exception('付款码不能缺少' ,'AUTH_CODE');
//      }
/*      if (empty($params["sub_mch_id"])){
          throw new Exception('' ,'SUB_MCH_ID');
      }*/
/*      if (empty($params["notify_url"])){
          throw new Exception('' ,'NOTIFY_URL');
      }*/
//      if (empty($params["body"])){
//          throw new Exception('商品描述' ,'BODY');
//      }
//      if (empty($params["trade_type"])){
//          throw new Exception('支付场景不能缺少' ,'TRADE_TYPE');
//      }
    //api调用
      $qpayApi = new QpayMchAPI('https://qpay.qq.com/cgi-bin/pay/qpay_micro_pay.cgi', null, 10);
      $qpayApi->setMchId($params['mchId']);
      $qpayApi->setMchKey($params['mchKey']);
      unset($params['mchId'], $params['mchKey']);
      $ret = $qpayApi->reqQpay($params);

      return QpayMchUtil::xmlToArray($ret);
    }
1282291
public function get($url, $params = array())
    {
        $client = new \Guzzle\Http\Client($this->_url);
        $request = $client->get($url, array(), array(
            'query' => $params
        ));
        $request->getCurlOptions()->set(CURLOPT_SSLVERSION, 1); // CURL_SSLVERSION_TLSv1
        $response = $client->send($request);
        if ($response->isSuccessful()) {
            return $response->json();
        } else {
            throw new \Exception("云片短信服务器未有效的响应请求");
        }
    }
1044090
public function loadResult($params=array()) {
		
		$this->openConnection();
		
		$res = NULL;

		try {

			$stat = $this->handler->prepare($this->query);
			$stat->execute((array)$params);
			
			// logger
			$count = $this->handler->query('SELECT FOUND_ROWS()')->fetchColumn();
			$this->logParamQuery($this->query, $count, $params);
			$res = $stat->fetch(\PDO::FETCH_COLUMN);	
		
		} catch (\PDOException $e) {

			$this->handleException($e, $params);

		}
		
		$stat->closeCursor();

		return $res;
		
	}
1371344
public function create(array $params = array())
    {
        $defaults = array(
            'name'      => null,
            'devurl'    => null,
            'is_active' => true,
            'is_public' => false,
        );

        $params = array_filter(
            array_merge($defaults, $params),
            array($this, 'isNotNull')
        );

        if(
            !isset($params['name'])
         || !isset($params['devurl'])
        ) {
            throw new \Exception('Missing mandatory parameters');
        }
        $data = array('project'=>$params);

        return $this->post('/projects.json', $data);
    }