url = $url; $this->isSSL = $isSSL; $this->timeout = $timeout; } public function reqQpay($params){ $ret = array(); //商户号 $params["mch_id"] = QpayMchConf::MCH_ID; //随机字符串 $params["nonce_str"] = QpayMchUtil::createNoncestr(); //签名 $params["sign"] = QpayMchUtil::getSign($params); //生成xml $xml = QpayMchUtil::arrayToXml($params); if(isset($this->isSSL)){ $ret = QpayMchUtil::reqByCurlSSLPost($xml, $this->url, $this->timeout); }else{ $ret = QpayMchUtil::reqByCurlNormalPost($xml, $this->url, $this->timeout); } return $ret; } }