當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CommonUtil::trimString方法代碼示例

本文整理匯總了PHP中CommonUtil::trimString方法的典型用法代碼示例。如果您正苦於以下問題:PHP CommonUtil::trimString方法的具體用法?PHP CommonUtil::trimString怎麽用?PHP CommonUtil::trimString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CommonUtil的用法示例。


在下文中一共展示了CommonUtil::trimString方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_cft_package

 protected function get_cft_package()
 {
     try {
         if (null == $this->partnerKey || "" == $this->partnerKey) {
             throw new SDKRuntimeException("密鑰不能為空!" . "<br>");
         }
         $commonUtil = new CommonUtil();
         ksort($this->parameters);
         $unSignParaString = $commonUtil->formatQueryParaMap($this->parameters, false);
         $paraString = $commonUtil->formatQueryParaMap($this->parameters, true);
         $md5SignUtil = new MD5SignUtil();
         return $paraString . "&sign=" . $md5SignUtil->sign($unSignParaString, $commonUtil->trimString($this->partnerKey));
     } catch (SDKRuntimeException $e) {
         die($e->errorMessage());
     }
 }
開發者ID:chenpusn,項目名稱:guoxian,代碼行數:16,代碼來源:WxPayHelper.class.php

示例2: get_sign

 protected function get_sign()
 {
     try {
         if (null == PARTNERKEY || "" == PARTNERKEY) {
             throw new SDKRuntimeException("");
         }
         if ($this->check_sign_parameters() == false) {
             throw new SDKRuntimeException("");
         }
         $commonUtil = new CommonUtil();
         ksort($this->parameters);
         $unSignParaString = $commonUtil->formatQueryParaMap($this->parameters, false);
         $md5SignUtil = new MD5SignUtil();
         return $md5SignUtil->sign($unSignParaString, $commonUtil->trimString(PARTNERKEY));
     } catch (SDKRuntimeException $e) {
         die($e->errorMessage());
     }
 }
開發者ID:jasonhzy,項目名稱:wxhb,代碼行數:18,代碼來源:WxXianjinHelper.php

示例3: get_sign

 /**
  例如:
 	appid:    wxd111665abv58f4f
 		mch_id:    10000100
 		device_info:  1000
 		Body:    test
 		nonce_str:  ibuaiVcKdpRxkhJA
 		第一步:對參數按照 key=value 的格式,並按照參數名 ASCII 字典序排序如下:
 		stringA="appid=wxd930ea5d5a258f4f&body=test&device_info=1000&mch_i
 		d=10000100&nonce_str=ibuaiVcKdpRxkhJA";
 		第二步:拚接支付密鑰:
 		stringSignTemp="stringA&key=192006250b4c09247ec02edce69f6a2d"
 		sign=MD5(stringSignTemp).toUpperCase()="9A0A8659F005D6984697E2CA0A
 		9CF3B7"
 */
 protected function get_sign()
 {
     define('PARTNERKEY', "4YULIIKklHlMVnp5sVZek2KqVTihAhLt");
     try {
         if (null == PARTNERKEY || "" == PARTNERKEY) {
             throw new SDKRuntimeException("密鑰不能為空!" . "<br>");
         }
         if ($this->check_sign_parameters() == false) {
             //檢查生成簽名參數
             throw new SDKRuntimeException("生成簽名參數缺失!" . "<br>");
         }
         $commonUtil = new CommonUtil();
         ksort($this->parameters);
         $unSignParaString = $commonUtil->formatQueryParaMap($this->parameters, false);
         $md5SignUtil = new MD5SignUtil();
         return $md5SignUtil->sign($unSignParaString, $commonUtil->trimString(PARTNERKEY));
     } catch (SDKRuntimeException $e) {
         //            echo 'get sign error';die;
         die($e->errorMessage());
     }
 }
開發者ID:noikiy,項目名稱:vsuninpay,代碼行數:36,代碼來源:WxHongBaoHelper.php

示例4: get_sign

 /**
  * 例如:
  * appid:    wxd930ea5d5a258f4f
  * mch_id:    10000100
  * device_info:  1000
  * Body:    test
  * nonce_str:  ibuaiVcKdpRxkhJA
  * 第一步:對參數按照 key=value 的格式,並按照參數名 ASCII 字典序排序如下:
  * stringA="appid=wxd930ea5d5a258f4f&body=test&device_info=1000&mch_i
  * d=10000100&nonce_str=ibuaiVcKdpRxkhJA";
  * 第二步:拚接支付密鑰:
  * stringSignTemp="stringA&key=192006250b4c09247ec02edce69f6a2d"
  * sign=MD5(stringSignTemp).toUpperCase()="9A0A8659F005D6984697E2CA0A
  * 9CF3B7"
  */
 protected function get_sign()
 {
     try {
         if (null == $this->apiSecret || "" == $this->apiSecret) {
             throw new SDKRuntimeException("密鑰不能為空!" . "<br>");
         }
         if ($this->check_sign_parameters() == false) {
             //檢查生成簽名參數
             throw new SDKRuntimeException("生成簽名參數缺失!" . "<br>");
         }
         $commonUtil = new CommonUtil();
         ksort($this->parameters);
         $unSignParaString = $commonUtil->formatQueryParaMap($this->parameters, false);
         $md5SignUtil = new MD5SignUtil();
         return $md5SignUtil->sign($unSignParaString, $commonUtil->trimString($this->apiSecret));
     } catch (SDKRuntimeException $e) {
         die($e->errorMessage());
     }
 }
開發者ID:pfinal,項目名稱:wechat,代碼行數:34,代碼來源:Helper.php

示例5: setParameter

 /**
  *設置業務參數值
  */
 function setParameter($parameter, $parameterValue)
 {
     $commonUtil = new CommonUtil();
     $this->parameters[$commonUtil->trimString($parameter)] = $commonUtil->trimString($parameterValue);
 }
開發者ID:nick198205,項目名稱:yiqixiu,代碼行數:8,代碼來源:CommonRequest.class.php

示例6: setParameter

 function setParameter($parameter, $parameterValue)
 {
     $this->parameters[CommonUtil::trimString($parameter)] = CommonUtil::trimString($parameterValue);
 }
開發者ID:zhaoshengloveqingqing,項目名稱:Wechat,代碼行數:4,代碼來源:CftWapPayHelper.class.php

示例7: getPayInfo

 /**
  * 獲取錯誤信息
  */
 function getPayInfo()
 {
     $info = $this->getParameter($this->RETMSG);
     if (null == CommonUtil::trimString($info) && !$this->isPayed()) {
         $info = "訂單尚未支付成功";
     }
     return $info;
 }
開發者ID:ailingsen,項目名稱:pigcms,代碼行數:11,代碼來源:CommonResponse.class.php

示例8: orderquery

 public function orderquery($access_token, $trade)
 {
     $url = 'https://api.weixin.qq.com/pay/orderquery?access_token=' . $access_token;
     // generate package
     $pkg['out_trade_no'] = $trade['order_sn'];
     $pkg['partner'] = $this->PARTNERID;
     $commonUtil = new CommonUtil();
     ksort($pkg);
     $unSignParaString = $commonUtil->formatQueryParaMap($pkg, false);
     $md5SignUtil = new MD5SignUtil();
     $pkg_sign = $md5SignUtil->sign($unSignParaString, $commonUtil->trimString($this->PARTNERKEY));
     $package_str = $unSignParaString . '&sign=' . strtoupper($pkg_sign);
     $data["appid"] = $this->APPID;
     $data["package"] = $package_str;
     $data["timestamp"] = strval(time());
     $data['app_signature'] = $this->get_biz_sign($data);
     $data['sign_method'] = 'sha1';
     $json_data = json_encode($data);
     $ret = $this->sendPost($url, $json_data);
     Log::record('wxpay orderquery order_sn:' . $trade['order_sn'] . ' res:' . print_r($ret, true), Log::INFO);
     Log::save();
     return $ret;
 }
開發者ID:zhaoshengloveqingqing,項目名稱:Wechat,代碼行數:23,代碼來源:LzWxPayHelper.class.php

示例9: getPayInfo

 public function getPayInfo()
 {
     $info = $this->getParameter($this->RETMSG);
     if (NULL == CommonUtil::trimString($info) && !$this->isPayed()) {
         $info = '訂單尚未支付成功';
     }
     return $info;
 }
開發者ID:fkssei,項目名稱:pigcms10,代碼行數:8,代碼來源:CommonResponse.class.php


注:本文中的CommonUtil::trimString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。