• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP PhpLog类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中PhpLog的典型用法代码示例。如果您正苦于以下问题:PHP PhpLog类的具体用法?PHP PhpLog怎么用?PHP PhpLog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了PhpLog类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getPulbicKeyByCertId

/**
 * 根据证书ID 加载 证书
 *
 * @param unknown_type $certId        	
 * @return string NULL
 */
function getPulbicKeyByCertId($certId)
{
    $log = new \PhpLog(SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL);
    $log->LogInfo('报文返回的证书ID>' . $certId);
    // 证书目录
    $cert_dir = SDK_VERIFY_CERT_DIR;
    $log->LogInfo('验证签名证书目录 :>' . $cert_dir);
    $handle = opendir($cert_dir);
    if ($handle) {
        while ($file = readdir($handle)) {
            clearstatcache();
            $filePath = $cert_dir . '/' . $file;
            if (is_file($filePath)) {
                if (pathinfo($file, PATHINFO_EXTENSION) == 'cer') {
                    if (getCertIdByCerPath($filePath) == $certId) {
                        closedir($handle);
                        $log->LogInfo('加载验签证书成功');
                        return getPublicKey($filePath);
                    }
                }
            }
        }
        $log->LogInfo('没有找到证书ID为[' . $certId . ']的证书');
    } else {
        $log->LogInfo('证书目录 ' . $cert_dir . '不正确');
    }
    closedir($handle);
    return null;
}
开发者ID:xingluxin,项目名称:jianshen,代码行数:35,代码来源:secureUtil.php


示例2: searchOrder

 public function searchOrder($attr, $type = "bank")
 {
     $log = new PhpLog(SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL);
     $log->LogInfo("============处理前台请求开始===============");
     // 初始化日志
     if ($type == "bank") {
         $merId = '898110260110001';
     } else {
         $merId = '898110260110002';
     }
     $attr['txnTime'] = date("YmdHis", strtotime($attr['trade_time']));
     $params = array('version' => '5.0.0', 'encoding' => 'utf-8', 'certId' => $this->secureUtil->getSignCertId($type), 'signMethod' => '01', 'txnType' => '00', 'txnSubType' => '00', 'bizType' => '000000', 'accessType' => '0', 'channelType' => '07', 'orderId' => $attr['trade_code'], 'merId' => $merId, 'txnTime' => $attr['txnTime']);
     //        print_r($params);
     //        exit;
     // 签名
     $this->secureUtil->sign($params, $type);
     // 前台请求地址
     $front_uri = SDK_SINGLE_QUERY_URL;
     $log->LogInfo("前台请求地址为>" . $front_uri);
     // 构造 自动提交的表单
     $html_form = create_html($params, $front_uri);
     $api_client = new FApiClient();
     $res = $api_client->unionPaySend($front_uri, $params, "post");
     $log->LogInfo("-------前台交易自动提交表单>--begin----");
     $log->LogInfo($html_form);
     $log->LogInfo("-------前台交易自动提交表单>--end-------");
     $log->LogInfo("============处理前台请求 结束===========");
     //echo $html_form;
     return $res;
 }
开发者ID:niujie123,项目名称:myself,代码行数:30,代码来源:UnionPay.php


示例3: verify

/**
 * 验签
 *
 * @param String $params_str        	
 * @param String $signature_str        	
 */
function verify($params)
{
    global $log;
    // 初始化日志
    $log = new PhpLog(SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL);
    // 公钥
    $public_key = getPulbicKeyByCertId($params['certId']);
    //	echo $public_key.'<br/>';
    // 签名串
    $signature_str = $params['signature'];
    unset($params['signature']);
    $params_str = coverParamsToString($params);
    $log = new PhpLog(SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL);
    // 初始化日志
    $log->LogInfo('报文去[signature] key=val&串>' . $params_str);
    $signature = base64_decode($signature_str);
    //	echo date('Y-m-d',time());
    $params_sha1x16 = sha1($params_str, FALSE);
    $log->LogInfo('摘要shax16>' . $params_sha1x16);
    $isSuccess = openssl_verify($params_sha1x16, $signature, $public_key, OPENSSL_ALGO_SHA1);
    $log->LogInfo($isSuccess ? '验签成功' : '验签失败');
    return $isSuccess;
}
开发者ID:BruceJi,项目名称:fanwe,代码行数:29,代码来源:secureUtil.php


示例4: pay

 public function pay()
 {
     $merId = empty($this->merId) ? MER_ID : $this->merId;
     $orderId = empty($this->orderId) ? date('YmdHis') : $this->orderId;
     $frontUrl = empty($this->frontUrl) ? SDK_FRONT_NOTIFY_URL : $this->frontUrl;
     $backUrl = empty($this->backUrl) ? SDK_BACK_NOTIFY_URL : $this->backUrl;
     // 初始化日志
     $log = new \PhpLog(SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL);
     $log->LogInfo("============处理前台请求开始===============");
     // 初始化日志
     $params = array('version' => '5.0.0', 'encoding' => 'utf-8', 'certId' => getSignCertId(), 'txnType' => '01', 'txnSubType' => '01', 'bizType' => '000201', 'frontUrl' => $frontUrl, 'backUrl' => $backUrl, 'signMethod' => '01', 'channelType' => '08', 'accessType' => '0', 'merId' => $merId, 'orderId' => $orderId, 'txnTime' => date('YmdHis'), 'txnAmt' => $this->txnAmt, 'currencyCode' => '156', 'defaultPayType' => '0001', 'reqReserved' => $this->reqReserved);
     // 签名
     sign($params);
     // 前台请求地址
     $front_uri = SDK_FRONT_TRANS_URL;
     $log->LogInfo("前台请求地址为>" . $front_uri);
     // 构造 自动提交的表单
     $html_form = create_html($params, $front_uri);
     $log->LogInfo("-------前台交易自动提交表单>--begin----");
     //$log->LogInfo ( $html_form );
     $log->LogInfo("-------前台交易自动提交表单>--end-------");
     $log->LogInfo("============处理前台请求 结束===========");
     echo $html_form;
 }
开发者ID:xingluxin,项目名称:jianshen,代码行数:24,代码来源:UnionPay.class.php


示例5: header

<?php

header('Content-type:text/html;charset=GBK');
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/gbk/func/common.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/gbk/func/SDKConfig.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/gbk/func/secureUtil.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/gbk/func/httpClient.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/gbk/func/log.class.php';
/**
 * 文件传输类交易
 */
/**
 *	以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己需要,按照技术文档编写。该代码仅供参考
 */
// 初始化日志
$log = new PhpLog(SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL);
$log->LogInfo("===========处理后台请求开始============");
$params = array('version' => '5.0.0', 'encoding' => 'GBK', 'certId' => getSignCertId(), 'txnType' => '76', 'signMethod' => '01', 'txnSubType' => '01', 'bizType' => '000000', 'accessType' => '0', 'merId' => '700000000000001', 'settleDate' => '0119', 'txnTime' => date('YmdHis'), 'fileType' => '00');
// 签名
sign($params);
echo "请求:" . getRequestParamString($params);
$log->LogInfo("后台请求地址为>" . SDK_FILE_QUERY_URL);
// 发送信息到后台
$result = sendHttpRequest($params, SDK_FILE_QUERY_URL);
$log->LogInfo("后台返回结果为>" . $result);
echo "应答:" . $result;
//返回结果展示
$result_arr = coverStringToArray($result);
echo verify($result_arr) ? '验签成功' : '验签失败';
// 处理文件,保存路径在配置文件中修改,注意预先建立文件夹并授读写权限
deal_file($result_arr);
开发者ID:184609680,项目名称:wcy_O2O_95180,代码行数:31,代码来源:Form_6_6_FileTransfer.php


示例6: header

<?php 
header('Content-type:text/html;charset=utf-8');
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/utf8/func/common.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/utf8/func/SDKConfig.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/utf8/func/secureUtil.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/utf8/func/httpClient.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/utf8/func/log.class.php';
/**
 * 预授权-控件 
 */
/**
 *	以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己需要,按照技术文档编写。该代码仅供参考
 */
// 初始化日志
$log = new PhpLog(SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL);
$log->LogInfo("============处理前台请求开始===============");
// 初始化日志
$params = array('version' => '5.0.0', 'encoding' => 'utf-8', 'certId' => getSignCertId(), 'txnType' => '02', 'txnSubType' => '01', 'bizType' => '000201', 'frontUrl' => SDK_FRONT_NOTIFY_URL, 'backUrl' => SDK_BACK_NOTIFY_URL, 'signMethod' => '01', 'channelType' => '08', 'accessType' => '0', 'merId' => '888888888888888', 'orderId' => date('YmdHis'), 'txnTime' => date('YmdHis'), 'txnAmt' => '100', 'currencyCode' => '156', 'orderDesc' => '订单描述', 'reqReserved' => ' 透传信息');
// 签名
sign($params);
echo "请求:" . getRequestParamString($params);
$log->LogInfo("后台请求地址为>" . SDK_App_Request_Url);
// 发送信息到后台
$result = sendHttpRequest($params, SDK_App_Request_Url);
$log->LogInfo("后台返回结果为>" . $result);
echo "应答:" . $result;
//返回结果展示
$result_arr = coverStringToArray($result);
echo verify($result_arr) ? '验签成功' : '验签失败';
?>
开发者ID:184609680,项目名称:wcy_O2O_95180,代码行数:30,代码来源:Form_6_7_1_AuthDeal_App.php


示例7: header

<?php 
header('Content-type:text/html;charset=utf-8');
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/utf8/func/common.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/utf8/func/SDKConfig.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/utf8/func/secureUtil.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/utf8/func/log.class.php';
/**
 * 消费交易-前台 
 */
/**
 *	以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己需要,按照技术文档编写。该代码仅供参考
 */
// 初始化日志
$log = new PhpLog(SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL);
$log->LogInfo("============处理前台请求开始===============");
// 初始化日志
$params = array('version' => '5.0.0', 'encoding' => 'utf-8', 'certId' => getSignCertId(), 'txnType' => '01', 'txnSubType' => '01', 'bizType' => '000201', 'frontUrl' => SDK_FRONT_NOTIFY_URL, 'backUrl' => SDK_BACK_NOTIFY_URL, 'signMethod' => '01', 'channelType' => '08', 'accessType' => '0', 'merId' => '888888888888888', 'orderId' => date('YmdHis'), 'txnTime' => date('YmdHis'), 'txnAmt' => '100', 'currencyCode' => '156', 'defaultPayType' => '0001', 'reqReserved' => ' 透传信息');
// 签名
sign($params);
// 前台请求地址
$front_uri = SDK_FRONT_TRANS_URL;
$log->LogInfo("前台请求地址为>" . $front_uri);
// 构造 自动提交的表单
$html_form = create_html($params, $front_uri);
$log->LogInfo("-------前台交易自动提交表单>--begin----");
$log->LogInfo($html_form);
$log->LogInfo("-------前台交易自动提交表单>--end-------");
$log->LogInfo("============处理前台请求 结束===========");
echo $html_form;
开发者ID:184609680,项目名称:wcy_O2O_95180,代码行数:29,代码来源:Form_6_2_FrontConsume.php


示例8: PhpLog

 * 产品:跳转网关支付产品<br>
 * 交易:预授权完成:后台交易,有同步应答和后台通知应答<br>
 * 日期: 2015-09<br>
 * 版本: 1.0.0 
 * 版权: 中国银联<br>
 * 说明:以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己需要,按照技术文档编写。该代码仅供参考,不提供编码性能规范性等方面的保障<br>
 * 该接口参考文档位置:open.unionpay.com帮助中心 下载  产品接口规范  《网关支付产品接口规范》<br>
 *              《平台接入接口规范-第5部分-附录》(内包含应答码接口规范,全渠道平台银行名称-简码对照表)<br>
 * 测试过程中的如果遇到疑问或问题您可以:1)优先在open平台中查找答案:
 * 							        调试过程中的问题或其他问题请在 https://open.unionpay.com/ajweb/help/faq/list 帮助中心 FAQ 搜索解决方案
 *                             测试过程中产生的6位应答码问题疑问请在https://open.unionpay.com/ajweb/help/respCode/respCodeList 输入应答码搜索解决方案
 *                          2) 咨询在线人工支持: open.unionpay.com注册一个用户并登陆在右上角点击“在线客服”,咨询人工QQ测试支持。
 * 交易说明:1)以后台通知或交易状态查询交易(Form_6_5_Query)确定交易成功。建议发起查询交易的机制:可查询N次(不超过6次),每次时间间隔2N秒发起,即间隔1,2,4,8,16,32S查询(查询到03,04,05继续查询,否则终止查询)
 *       2)预授权完成交易必须在预授权交易30日内发起,否则预授权交易自动解冻。预授权完成金额可以是预授权金额的(0-115%]
 */
$log = new PhpLog(SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL);
// 初始化日志
$log->LogInfo("===========处理后台请求开始============");
$params = array('version' => '5.0.0', 'encoding' => 'utf-8', 'certId' => getSignCertId(), 'signMethod' => '01', 'txnType' => '03', 'txnSubType' => '00', 'bizType' => '000201', 'accessType' => '0', 'channelType' => '07', 'backUrl' => SDK_BACK_NOTIFY_URL, 'orderId' => $_POST["orderId"], 'merId' => $_POST["merId"], 'origQryId' => $_POST["origQryId"], 'txnTime' => $_POST["txnTime"], 'txnAmt' => $_POST["txnAmt"]);
sign($params);
// 签名
$url = SDK_BACK_TRANS_URL;
$log->LogInfo("后台请求地址为>" . $url);
$result = post($params, $url, $errMsg);
if (!$result) {
    //没收到200应答的情况
    printResult($url, $params, "");
    echo "POST请求失败:" . $errMsg;
    return;
}
$log->LogInfo("后台返回结果为>" . $result);
开发者ID:alucard263096,项目名称:AMK,代码行数:31,代码来源:Form_6_7_3_PreauthFinish.php


示例9: deal_file

/**
 * 处理报文中的文件
 *
 * @param unknown_type $params        	
 */
function deal_file($params)
{
    $log = new PhpLog(SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL);
    if (isset($params['fileContent'])) {
        $log->LogInfo("---------处理后台报文返回的文件---------");
        $fileContent = $params['fileContent'];
        if (empty($fileContent)) {
            $log->LogInfo('文件内容为空');
        } else {
            // 文件内容 解压缩
            $content = gzuncompress(base64_decode($fileContent));
            $root = SDK_FILE_DOWN_PATH;
            $filePath = null;
            if (empty($params['fileName'])) {
                $log->LogInfo("文件名为空");
                $filePath = $root . $params['merId'] . '_' . $params['batchNo'] . '_' . $params['txnTime'] . '.txt';
            } else {
                $filePath = $root . $params['fileName'];
            }
            $handle = fopen($filePath, "w+");
            if (!is_writable($filePath)) {
                $log->LogInfo("文件:" . $filePath . "不可写,请检查!");
            } else {
                file_put_contents($filePath, $content);
                $log->LogInfo("文件位置 >:" . $filePath);
            }
            fclose($handle);
        }
    }
}
开发者ID:redtreelchao,项目名称:wander-moon,代码行数:35,代码来源:common.php


示例10: deflate_file

/**
 * 压缩文件 对应java deflate
 *
 * @param unknown_type $params        	
 */
function deflate_file(&$params)
{
    //global $log;
    $log = new PhpLog(SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL);
    foreach ($_FILES as $file) {
        $log->LogInfo("---------处理文件---------");
        if (file_exists($file['tmp_name'])) {
            $params['fileName'] = $file['name'];
            $file_content = file_get_contents($file['tmp_name']);
            $file_content_deflate = gzcompress($file_content);
            $params['fileContent'] = base64_encode($file_content_deflate);
            $log->LogInfo("压缩后文件内容为>" . base64_encode($file_content_deflate));
        } else {
            $log->LogInfo(">>>>文件上传失败<<<<<");
        }
    }
}
开发者ID:Lazybin,项目名称:huisa,代码行数:22,代码来源:common.php


示例11: intval

<?php

require_once '../load.php';
include_once SYS_PATH_WAP . '/unionpay/lib/SDKConfig.php';
include_once SYS_PATH_WAP . '/unionpay/lib/common.php';
include_once SYS_PATH_WAP . '/unionpay/lib/secureUtil.php';
include_once SYS_PATH_WAP . '/unionpay/lib/httpClient.php';
include_once SYS_PATH_WAP . '/unionpay/lib/log.class.php';
$rt = $app->action('shopping', 'get_order_pay_info');
$total_fee = intval($rt['order_amount'] * 100);
// 初始化日志
$log = new PhpLog(SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL);
// 初始化日志
$params = array('version' => '5.0.0', 'encoding' => 'utf-8', 'certId' => getSignCertId(), 'txnType' => '01', 'txnSubType' => '01', 'bizType' => '000201', 'frontUrl' => SDK_FRONT_NOTIFY_URL, 'backUrl' => SDK_BACK_NOTIFY_URL, 'signMethod' => '01', 'channelType' => '08', 'accessType' => '0', 'merId' => '826340173990002', 'orderId' => $rt['order_sn'], 'txnTime' => date('YmdHis'), 'txnAmt' => $total_fee, 'currencyCode' => '156');
// 签名
sign($params);
/*手机WAP支付方式*/
// 构造 自动提交的表单
$html_form = create_html($params, SDK_FRONT_TRANS_URL);
$log->LogInfo("-------前台交易自动提交表单>--begin----");
$log->LogInfo($html_form);
$log->LogInfo("-------前台交易自动提交表单>--end-------");
echo $html_form;
开发者ID:zhaoshengloveqingqing,项目名称:fenxiao,代码行数:23,代码来源:unionpay.php


示例12: file_put_contents

    ?>
</td>
			<td><?php 
    echo $val;
    ?>
</td>
		</tr>
			<?php 
}
?>
			<tr>
			<td width='30%'>验证签名</td>
			<td><?php 
if (isset($_POST['signature'])) {
    file_put_contents(dirname(__FILE__) . '\\', json_encode($_POST));
    $log = new PhpLog(SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL);
    $log->LogInfo("============支付成功后台接心数据===============");
    $log->LogInfo(json_encode($_POST));
    echo verify($_POST) ? '验签成功' : '验签失败';
    $orderId = $_POST['orderId'];
    //其他字段也可用类似方式获取
} else {
    echo '签名为空';
}
?>
</td>
		</tr>
	</table>
</body>
</html>
开发者ID:735579768,项目名称:Ainiku,代码行数:30,代码来源:BackReceive.php


示例13: unionpay

 function unionpay()
 {
     include_once LIB_PATH . 'ORG/Payment/UnionPay/mobile/lib/common.php';
     include_once LIB_PATH . 'ORG/Payment/UnionPay/mobile/lib/SDKConfig.php';
     include_once LIB_PATH . 'ORG/Payment/UnionPay/mobile/lib/secureUtil.php';
     include_once LIB_PATH . 'ORG/Payment/UnionPay/mobile/lib/httpClient.php';
     include_once LIB_PATH . 'ORG/Payment/UnionPay/mobile/lib/log.class.php';
     $order_sn = $_GET['order_sn'];
     $token = $this->token;
     $wecha_id = $this->wechat_id;
     if (empty($order_sn)) {
         $this->error('没有订单号');
     }
     $trade = M('b2c_wingtrade')->where(array('order_sn' => $order_sn, 'token' => $token))->find();
     if ($trade && $trade['is_pay'] == '1') {
         $this->success('该订单已付款,不能重复付款!');
     }
     $pay_type = $_GET['pay_type'];
     if ($pay_type == '1') {
         $order = M('hotel_order')->where(array('sn' => $order_sn, 'token' => $token, 'order_status' => 3))->find();
     } elseif ($pay_type == '2') {
         $order = M('dine_order')->where(array('sn' => $order_sn, 'status' => 2))->find();
     } else {
         $order = M('b2c_order')->where(array('sn' => $order_sn, 'token' => $token, 'status' => 1))->find();
     }
     if (!$order) {
         $this->error('该订单不存在');
     }
     $payment_where = array('token' => $token, 'pay_code' => 'unionpay', 'enabled' => '1', 'pay_type' => $pay_type);
     if (!empty($this->branch_id)) {
         $payment_where['branch_id'] = $this->branch_id;
     }
     $payment = M('b2c_payment')->where($payment_where)->find();
     //$wingpay_config = unserialize($payment['pay_config']);
     if (empty($payment)) {
         $this->error('商家未设置银联支付方式!请联系商家客服!');
     }
     //PageRetUrl 返回支付后的商户网站页面
     $pagereturl = $_GET['front_url'];
     /**
      *	以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己需要,按照技术文档编写。该代码仅供参考
      */
     // 初始化日志
     $log = new PhpLog(SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL);
     $log->LogInfo("============处理前台请求开始===============");
     if ($pay_type == '1') {
         $total_fee = intval($order['prepayment'] * 100);
     } elseif ($pay_type == '2') {
         $total_fee = intval($order['price'] * 100);
     } else {
         $total_fee = intval($order['price'] * 100);
     }
     $order_time = date('YmdHis');
     // 初始化日志
     $params = array('version' => '5.0.0', 'encoding' => 'UTF-8', 'certId' => getSignCertId(), 'txnType' => '01', 'txnSubType' => '01', 'bizType' => '000000', 'frontUrl' => SDK_FRONT_NOTIFY_URL, 'backUrl' => SDK_BACK_NOTIFY_URL, 'signMethod' => '01', 'channelType' => '08', 'accessType' => '0', 'merId' => '898340148160231', 'orderId' => $order_sn, 'txnTime' => $order_time, 'txnAmt' => $total_fee, 'currencyCode' => '156', 'defaultPayType' => '0001');
     // 签名
     sign($params);
     $data = array('token' => $token, 'order_sn' => $order_sn, 'is_pay' => '0', 'set_params' => serialize(array_merge($params, array('return_url' => $pagereturl, 'pay_type' => $pay_type))), 'update_time' => time());
     if (!$trade) {
         $data['create_time'] = time();
         M('b2c_wingtrade')->add($data);
     } else {
         M('b2c_wingtrade')->where(array('token' => $token, 'order_sn' => $order_sn, 'is_pay' => '0'))->save($data);
     }
     /*手机WAP支付方式*/
     // 前台请求地址
     $front_uri = SDK_FRONT_TRANS_URL;
     $log->LogInfo("前台请求地址为>" . $front_uri);
     // 构造 自动提交的表单
     $html_form = create_html($params, $front_uri);
     $log->LogInfo("-------前台交易自动提交表单>--begin----");
     $log->LogInfo($html_form);
     $log->LogInfo("-------前台交易自动提交表单>--end-------");
     $log->LogInfo("============处理前台请求 结束===========");
     echo $html_form;
 }
开发者ID:zhaoshengloveqingqing,项目名称:Wechat,代码行数:76,代码来源:ShopAction.class.php


示例14: get_code

 /**
  * 生成支付代码
  * @param   array   $order  订单信息
  * @param   array   $payment    支付方式信息
  */
 function get_code($order, $payment, $agent_type)
 {
     // 初始化变量
     if (!defined('EC_CHARSET')) {
         $charset = 'UTF-8';
     } else {
         $charset = strtoupper(EC_CHARSET);
     }
     // 初始化日志
     //global $log;
     $log = new PhpLog(SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL);
     $log->LogInfo("============处理前台请求开始===============");
     // 初始化日志
     $orderNumber = $order['order_sn'] . $this->_formatSN($order['log_id']);
     $isVirtual = exist_virtual_card_goods($order['order_id']);
     $member_id = SDK_MEMBER_PC_REAL_ID;
     $cert_path = SDK_MEMBER_MOBILE_REAL_ID;
     $frontEndUrl = return_url(basename(__FILE__, '.php'));
     $backEndUrl = return_url(basename(__FILE__, '.php'));
     if ($agent_type == '07') {
         if ($isVirtual) {
             $member_id = SDK_MEMBER_PC_VIRTUAL_ID;
             $cert_path = SDK_SIGN_PC_VIRTUAL_PATH;
         } else {
             $member_id = SDK_MEMBER_PC_REAL_ID;
             $cert_path = SDK_SIGN_PC_REAL_PATH;
         }
         $params = array('version' => '5.0.0', 'encoding' => 'utf-8', 'certId' => getSignCertId($cert_path), 'txnType' => '01', 'txnSubType' => '01', 'bizType' => '000201', 'frontUrl' => $frontEndUrl, 'backUrl' => $backEndUrl, 'signMethod' => '01', 'channelType' => '07', 'accessType' => '0', 'merId' => $member_id, 'orderId' => $orderNumber, 'txnTime' => date('YmdHis'), 'txnAmt' => $order['order_amount'] * 100, 'currencyCode' => '156', 'defaultPayType' => '0001', 'reqReserved' => ' 透传信息');
     } else {
         if ($isVirtual) {
             $member_id = SDK_MEMBER_MOBILE_VIRTUAL_ID;
             $cert_path = SDK_SIGN_MOBILE_VIRTUAL_PATH;
         } else {
             $member_id = SDK_MEMBER_MOBILE_REAL_ID;
             $cert_path = SDK_SIGN_MOBILE_REAL_PATH;
         }
         $params = array('version' => '5.0.0', 'encoding' => 'utf-8', 'certId' => getSignCertId($cert_path), 'txnType' => '01', 'txnSubType' => '01', 'bizType' => '000201', 'frontUrl' => $frontEndUrl, 'backUrl' => $backEndUrl, 'signMethod' => '01', 'channelType' => '08', 'accessType' => '0', 'merId' => $member_id, 'orderId' => $orderNumber, 'txnTime' => date('YmdHis'), 'txnAmt' => $order['order_amount'] * 100, 'currencyCode' => '156', 'defaultPayType' => '0001', 'reqReserved' => ' 透传信息');
     }
     sign($params, $cert_path);
     // 前台请求地址
     $front_uri = SDK_FRONT_TRANS_URL;
     $log->LogInfo("前台请求地址为>" . $front_uri);
     // 构造 自动提交的表单
     $button = "<input type='submit' value='银联支付' />";
     $html_form = create_html($params, $front_uri, $button);
     $log->LogInfo("-------前台交易自动提交表单>--begin----");
     $log->LogInfo($html_form);
     $log->LogInfo("-------前台交易自动提交表单>--end-------");
     $log->LogInfo("============处理前台请求 结束===========");
     return $html_form;
     // $params = array(
     //        "version"            =>  '1.0.0',                      //接口版本
     //        "signMethod"         =>  'md5',                        //加密方式
     //        "charset"            =>  $charset,                     //编码
     //        "transType"          =>  '01',                         //交易类型
     //        "origQid"            =>  '',
     //        "merId"              =>  $merId,                       //收款账号
     //        "merAbbr"            =>  $merAbbr,                     //商户名称
     //        "acqCode"            =>  '',
     //        "merCode"            =>  '',
     //        "commodityUrl"       =>  '',                           //商品url
     //        "commodityName"      =>  '',                           //商品名字
     //        "commodityUnitPrice" =>  '',                           //商品单价
     //        "commodityQuantity"  =>  '',                           //商品数量
     //        "commodityDiscount"  =>  '',
     //        "transferFee"        =>  '',
     //        "orderNumber"        =>  $orderNumber,                 //订单号,必须唯一
     //        "orderAmount"        =>  $order['order_amount'] * 100, //交易金额 转化为分
     //        "orderCurrency"      =>  '156',                        //交易币种,CURRENCY_CNY=>人民币
     //        "orderTime"          =>  date('YmdHis'),               //交易时间, YYYYmmhhddHHMMSS
     //        "customerIp"         =>  $_SERVER['REMOTE_ADDR'],      //用户IP
     //        "customerName"       =>  '',
     //        "defaultPayType"     =>  '',
     //        "defaultBankNumber"  =>  '',
     //        "transTimeout"       =>  '',
     //        "frontEndUrl"        =>  $frontEndUrl,                 // 前台回调URL
     //        "backEndUrl"         =>  $backEndUrl,                  // 后台回调URL
     //        "merReserved"        =>  ''
     // );
     // $params['signature']    =$this->sign($params, $security_key,'md5');
     // $button = "<input type='submit' value='" . $GLOBALS['_LANG']['upop_button'] . "' />";
     // $html = $this->create_html($params,$front_pay_url,$button);
     // return $html;
     // 签名
 }
开发者ID:nanhuacrab,项目名称:ecshop,代码行数:90,代码来源:upop.php


示例15: PhpLog

<?php

/**
	后台通知
*/
require_once './config_wap.php';
//银联wap配置文件
$log = new PhpLog(SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL);
$log->LogInfo("进入后台通知");
$param = $_REQUEST;
if (!isset($param['signature'])) {
    return 0;
}
if (!verify($param)) {
    return 0;
}
$outer_notice_sn = $param['queryId'];
$payment_notice_sn = $param['orderId'];
if ($param['respCode'] == '00') {
    require_once APP_ROOT_PATH . "system/libs/cart.php";
    $rs = payment_paid($payment_notice_sn, $outer_notice_sn);
    return 1;
} else {
    $log->LogInfo("后台通知处理失败");
    return 0;
}
开发者ID:BruceJi,项目名称:fanwe,代码行数:26,代码来源:notify_url.php


示例16: header

<?php 
header('Content-type:text/html;charset=utf-8');
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/utf8/func/common.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/utf8/func/SDKConfig.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/utf8/func/secureUtil.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/utf8/func/httpClient.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/utf8/func/log.class.php';
/**
 *	预授权完成
 */
/**
 *	以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己需要,按照技术文档编写。该代码仅供参考
 */
// 初始化日志
$log = new PhpLog(SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL);
$log->LogInfo("===========处理后台请求开始============");
$params = array('version' => '5.0.0', 'encoding' => 'utf-8', 'certId' => getSignCertId(), 'signMethod' => '01', 'txnType' => '03', 'txnSubType' => '00', 'bizType' => '000201', 'accessType' => '0', 'channelType' => '07', 'orderId' => date('YmdHis'), 'merId' => '888888888888888', 'origQryId' => '201502281110005523968', 'txnTime' => date('YmdHis'), 'txnAmt' => '100', 'backUrl' => SDK_BACK_NOTIFY_URL, 'reqReserved' => ' 透传信息');
// 签名
sign($params);
echo "请求:" . getRequestParamString($params);
$log->LogInfo("后台请求地址为>" . SDK_BACK_TRANS_URL);
// 发送信息到后台
$result = sendHttpRequest($params, SDK_BACK_TRANS_URL);
$log->LogInfo("后台返回结果为>" . $result);
echo "应答:" . $result;
//返回结果展示
$result_arr = coverStringToArray($result);
echo verify($result_arr) ? '验签成功' : '验签失败';
?>

开发者ID:184609680,项目名称:wcy_O2O_95180,代码行数:29,代码来源:Form_6_7_3_AuthFinish.php


示例17: pay

 function pay()
 {
     $this->load->database();
     $logId = $this->input->get('logId');
     $rw = $this->db->query(" select * from `moneylog`  where  `logId`=" . $logId)->row();
     // 初始化日志
     $log = new PhpLog(SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL);
     $log->LogInfo("============处理前台请求开始===============");
     // 初始化日志
     $params = array('version' => '5.0.0', 'encoding' => 'UTF-8', 'certId' => getSignCertId(), 'txnType' => '01', 'txnSubType' => '01', 'bizType' => '000000', 'frontUrl' => SDK_FRONT_NOTIFY_URL, 'backUrl' => SDK_BACK_NOTIFY_URL, 'signMethod' => '01', 'channelType' => '07', 'accessType' => '0', 'merId' => '898110260120032', 'orderId' => $rw->ordernumber, 'txnTime' => date('YmdHis'), 'txnAmt' => $rw->shouru * 100, 'currencyCode' => '156', 'defaultPayType' => '0001');
     // 签名
     sign($params);
     // 前台请求地址
     $front_uri = SDK_FRONT_TRANS_URL;
     $log->LogInfo("前台请求地址为>" . $front_uri);
     // 构造 自动提交的表单
     $html_form = create_html($params, $front_uri);
     $log->LogInfo("-------前台交易自动提交表单>--begin----");
     $log->LogInfo($html_form);
     $log->LogInfo("-------前台交易自动提交表单>--end-------");
     $log->LogInfo("============处理前台请求 结束===========");
     echo $html_form;
 }
开发者ID:q546530715,项目名称:fenzhi-git,代码行数:23,代码来源:cz.php


示例18: cancelpay

 public function cancelpay($oid)
 {
     $order = M('Order');
     $map['oid'] = $oid;
     $oinfo = $order->where($map)->find();
     if ($oinfo['paytype'] == '0') {
         $log = new \PhpLog(SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL);
         $log->LogInfo("============处理前台请求开始===============");
         // 初始化日志
         $params = array('version' => '5.0.0', 'encoding' => 'utf-8', 'certId' => getSignCertId(), 'signMethod' => '01', 'txnType' => '32', 'txnSubType' => '00', 'bizType' => '000201', 'accessType' => '0', 'channelType' => '07', 'orderId' => build_order_no(), 'merId' => '898110275120075', 'txnTime' => date('YmdHis'), 'backUrl' => SDK_CDE_BACK_NOTIFY_URL, 'reqReserved' => ' 透传信息');
         $params['origQryId'] = $oinfo['trade_no'];
         $cdeposit = $oinfo['deposit'] + $oinfo['c_price'];
         $params['txnAmt'] = 10;
         //floatval($cdeposit) * 100;
         sign($params);
         //echo "请求:" . getRequestParamString ( $params );
         $log->LogInfo("后台请求地址为>" . SDK_BACK_TRANS_URL);
         // 发送信息到后台
         $result = sendHttpRequest($params, SDK_BACK_TRANS_URL);
         $log->LogInfo("后台返回结果为>" . $result);
         //echo "应答:" . $result;
         //返回结果展示
         $result_arr = coverStringToArray($result);
         if (verify($result_arr)) {
             if ($result_arr['respCode'] == '00') {
                 return true;
             } else {
                 return false;
             }
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:huangkaijin,项目名称:clyy,代码行数:36,代码来源:BpayController.class.php



注:本文中的PhpLog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP PhpThumbFactory类代码示例发布时间:2022-05-23
下一篇:
PHP PhpFox类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap