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


PHP CommonUtil::create_noncestr方法代碼示例

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


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

示例1: CommonUtil

<?php

include_once "WxPayHelper.php";
$commonUtil = new CommonUtil();
$wxPayHelper = new WxPayHelper();
$user_ip = $_SERVER["REMOTE_ADDR"];
$notify_failed_url = "http://www.inink.cn/mobile/index.php";
$notify_url = "http://www.inink.cn/mobile/user.php";
$out_trade_no = $commonUtil->create_noncestr();
$wx_goods_name = '';
$wxPayHelper->setParameter("bank_type", "WX");
$wxPayHelper->setParameter("body", $wx_goods_name);
$wxPayHelper->setParameter("partner", "1218290401");
$wxPayHelper->setParameter("out_trade_no", $out_trade_no);
$wxPayHelper->setParameter("total_fee", "1");
$wxPayHelper->setParameter("fee_type", "1");
$wxPayHelper->setParameter("notify_url", $notify_url);
$wxPayHelper->setParameter("spbill_create_ip", $user_ip);
$wxPayHelper->setParameter("input_charset", "UTF-8");
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<head>
<meta name="Generator" content="ECSHOP v2.7.3" />
<META content="IE=7.0000" http-equiv="X-UA-Compatible">
<TITLE>微信支付測試</TITLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=viewport 
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<META name=apple-themes-web-app-capable content=yes>
開發者ID:will0306,項目名稱:bianli100,代碼行數:31,代碼來源:jsapicall.php

示例2: CommonUtil

<?php

include_once "WxPayHelper.php";
$commonUtil = new CommonUtil();
$wxPayHelper = new WxPayHelper();
$wxPayHelper->setParameter("bank_type", "WX");
$wxPayHelper->setParameter("body", "test");
$wxPayHelper->setParameter("partner", "1900000109");
$wxPayHelper->setParameter("out_trade_no", $commonUtil->create_noncestr());
$wxPayHelper->setParameter("total_fee", "1");
$wxPayHelper->setParameter("fee_type", "1");
$wxPayHelper->setParameter("notify_url", "htttp://www.baidu.com");
$wxPayHelper->setParameter("spbill_create_ip", "127.0.0.1");
$wxPayHelper->setParameter("input_charset", "GBK");
echo $wxPayHelper->create_app_package("test");
echo "<br>";
echo $wxPayHelper->create_biz_package();
echo "<br>";
echo $wxPayHelper->create_native_package();
開發者ID:dlpc,項目名稱:wxshoppingmall,代碼行數:19,代碼來源:example.php

示例3: intval

}
//判斷是否領過了
$ulingnum = mysql_num_rows(mysql_query("select * from " . DBQIAN . "user_xianjin where ucode='{$ucode}' and uwxcode='{$uwxcode}' and xtype=1 limit 1"));
if ($ulingnum > 0 && $actioncode == 0) {
    $actioncode = 2;
}
//計算大小
if ($actioncode == 0) {
    $thismoney = intval($hongbaorow['hminmoney']);
    if ($thismoney == 0) {
        $thismoney = 1;
    }
    if ($hongbaorow['hmaxmoney'] > $hongbaorow['hminmoney'] && $hongbaorow['hmaxmoney'] > 0 && $hongbaorow['hminmoney'] > 0) {
        $thismoney = rand($hongbaorow['hminmoney'], $hongbaorow['hmaxmoney']);
    }
    $wxHongBaoHelper->setParameter("nonce_str", $commonUtil->create_noncestr());
    //隨機字符串
    $wxHongBaoHelper->setParameter("partner_trade_no", MCHID . date('His') . rand(10000, 99999));
    //商戶訂單號
    $wxHongBaoHelper->setParameter("mchid", MCHID);
    //商戶號
    $wxHongBaoHelper->setParameter("mch_appid", APPID);
    //公眾賬號appid
    $wxHongBaoHelper->setParameter("openid", $ucode);
    //用戶openid
    $wxHongBaoHelper->setParameter("check_name", "NO_CHECK");
    //校驗用戶姓名選項
    $wxHongBaoHelper->setParameter("amount", $thismoney);
    //金額
    $wxHongBaoHelper->setParameter("re_user_name", "李四");
    //企業付款描述信息
開發者ID:jasonhzy,項目名稱:wxhb,代碼行數:31,代碼來源:ajax.pay.php


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