Exemplo n.º 1
0
 function retXmlHttpCall($opposite_address)
 {
     $queryXml = null;
     $objH = new HttpClientUtil();
     try {
         $queryXml = $objH->httpClientCall($this->getURL($opposite_address), $this->getInputCharset());
     } catch (Exception $e) {
         throw new SDKRuntimeException("http请求失败:" + $e . getMessage());
     } catch (SDKRuntimeException $e) {
         die($e->errorMessage());
     }
     $xmlParse = new XmlParseUtil();
     return $xmlParse->openapiXmlToMap($queryXml, $this->getInputCharset());
 }
Exemplo n.º 2
0
 /**
  * 生成支付跳转链接
  * 
  * @return Wap支付中心URL
  * @throws Exception Wap支付中心连接异常, Wap支付中心初始化返回异常
  */
 function getURL()
 {
     $paraString = parent::genParaStr();
     $domain = parent::getDomain();
     $url = $domain . parent::$this->WAP_PAY_OPPOSITE_ADDRESS . '?' . $paraString;
     try {
         $http = new HttpClientUtil();
         $util = new XmlParseUtil();
         $str = $http->httpClientCall($url, "utf-8");
         $wapPayInitResponse = new WapPayInitResponse($util->openapiXmlToMap($str, "utf-8"), parent::getSecretKey());
     } catch (SDKRuntimeException $e) {
         die($e->errorMessage());
         throw new SDKRuntimeException('Wap支付中心连接异常.' . $e->getMessage(), e);
     }
     if ($wapPayInitResponse && $wapPayInitResponse->isRetCodeOK()) {
         return $wapPayInitResponse->getURL();
     } else {
         throw new SDKRuntimeException('Wap支付中心初始化返回异常.' . $wapPayInitResponse->getMessage());
     }
 }
Exemplo n.º 3
0
 function CommonResponse5($xml, $charset, $secretKey, $hasRetcode, $hasSign)
 {
     $xmlUtil = new XmlParseUtil();
     $this->CommonResponse4($xmlUtil->openapiXmlToMap($xml, $charset), $secretKey, $hasRetcode, $hasSign);
 }