本文整理汇总了PHP中getSignCertId函数的典型用法代码示例。如果您正苦于以下问题:PHP getSignCertId函数的具体用法?PHP getSignCertId怎么用?PHP getSignCertId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getSignCertId函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: cx
public function cx($conf)
{
$params = array('version' => '5.0.0', 'encoding' => 'utf-8', 'certId' => getSignCertId(), 'signMethod' => '01', 'txnType' => '00', 'txnSubType' => '00', 'bizType' => '000000', 'accessType' => '0', 'channelType' => '07', 'orderId' => $conf['ordernumber'], 'merId' => '898110248160161', 'txnTime' => date("YmdHis", strtotime($conf['addtime'])));
// 签名
sign($params);
// 发送信息到后台
$result = sendHttpRequest($params, SDK_SINGLE_QUERY_URL);
//返回结果展示
$result_arr = coverStringToArray($result);
$insert = array();
$insert['ordernumber'] = $conf['ordernumber'];
$insert['fqtime'] = $conf['addtime'];
$insert['ylnumber'] = isset($result_arr['queryId']) ? $result_arr['queryId'] : 0;
$insert['yltime'] = isset($result_arr['traceTime']) ? $result_arr['traceTime'] : 0;
$insert['ylstatus'] = $conf['cztype'];
$insert['cxtime'] = date("Y-m-d H:i:s");
$insert['cxstatus'] = $result_arr['respCode'];
$insert['cxmiaosu'] = $result_arr['respMsg'];
$insert['userId'] = $conf['userId'];
$insert['origRespCode'] = isset($result_arr['origRespCode']) ? $result_arr['origRespCode'] : 0;
$insert['origRespMsg'] = isset($result_arr['origRespMsg']) ? $result_arr['origRespMsg'] : 0;
$this->db->insert("yinlian", $insert);
if ($this->db->insert_id() > 0) {
$this->db->query("update `cz` set `cl`=1 where logId=" . $conf['logId']);
}
}
开发者ID:q546530715,项目名称:fenzhi-git,代码行数:26,代码来源:yinlian.php
示例2: dopay
public function dopay($money = null, $order = null, $ordername = null, $reqReserved = '透传信息')
{
//取插件配置参数
$conf = F('pluginunionpay');
if (empty($conf) || APP_DEBUG) {
$data = M('Addons')->field('param')->where("mark='Unionpay'")->find();
$conf = json_decode($data['param'], true);
F('pluginunionpay', $conf);
}
define('UNIONPAY_MEMBER_ID', $conf['MEMBER_ID']);
include_once UNIONPAY_PATH . '/lib/utf8/func/SDKConfig.php';
include_once UNIONPAY_PATH . '/lib/utf8/func/common.php';
include_once UNIONPAY_PATH . '/lib/utf8/func/PinBlock.php';
include_once UNIONPAY_PATH . '/lib/utf8/func/PublicEncrypte.php';
include_once UNIONPAY_PATH . '/lib/utf8/func/secureUtil.php';
include_once UNIONPAY_PATH . '/lib/utf8/func/httpClient.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' => MEMBER_ID, 'orderId' => $order, 'txnTime' => date('YmdHis'), 'txnAmt' => $money * 100, 'currencyCode' => '156', 'orderDesc' => $ordername, 'reqReserved' => $reqReserved);
// 签名
sign($params);
// 前台请求地址
$front_uri = SDK_FRONT_TRANS_URL;
$html_form = create_html($params, $front_uri);
return $html_form;
}
开发者ID:735579768,项目名称:Ainiku,代码行数:31,代码来源:UnionpayPlugin.class.php
示例3: __construct
function __construct($config)
{
$this->params["certId"] = getSignCertId();
$this->params["txnTime"] = date('YmdHis');
$this->params["frontUrl"] = $config['return_url'];
$this->params["backUrl"] = $config["notify_url"];
$this->request_url = $config["request_uri"];
}
开发者ID:onlineshine,项目名称:myzf,代码行数:8,代码来源:unionpay.php
示例4: actionPay
public function actionPay($order_code)
{
$is_login = Yii::app()->session['is_login'];
$uid = Yii::app()->session['uid'];
$username = Yii::app()->session['username'];
if (!isset($is_login) && !isset($uid) && empty($username) && $is_login != 1) {
$this->redirect($this->createUrl('user/login'));
}
$orders = Orders::model()->find('uid=:uid and order_code=:order_code', array(':uid' => $uid, ':order_code' => $order_code));
if (empty($order_code) || empty($orders)) {
throw new CHttpException(400, Yii::t('yii', 'Your request is invalid.'));
}
$pay_price = (int) ($orders->total_price * 100);
$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' => '898110279910126', 'orderId' => $orders->order_code, 'txnTime' => date('YmdHis'), 'txnAmt' => $pay_price, 'currencyCode' => '156', 'defaultPayType' => '0001', 'reqReserved' => $orders->goods_name);
sign($params);
// 前台请求地址
$front_uri = SDK_FRONT_TRANS_URL;
// 构造 自动提交的表单
$html_form = create_html($params, $front_uri);
echo $html_form;
exit;
}
开发者ID:redtreelchao,项目名称:wander-moon,代码行数:22,代码来源:UnionpayController.php
示例5: 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
示例6: define
<?php
define('UNIONPAY_PATH', dirname(__FILE__));
include_once UNIONPAY_PATH . '/lib/common.php';
include_once UNIONPAY_PATH . '/lib/SDKConfig.php';
include_once UNIONPAY_PATH . '/lib/secureUtil.php';
include_once UNIONPAY_PATH . '/lib/httpClient.php';
include_once UNIONPAY_PATH . '/lib/log.class.php';
//PageRetUrl 返回支付后的商户网站页面
$pagereturl = $_GET['front_url'];
/**
* 以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己需要,按照技术文档编写。该代码仅供参考
*/
// 初始化日志
$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' => '826340173990002', 'orderId' => date('Y') . time(), 'txnTime' => date('YmdHis'), 'txnAmt' => 1, 'currencyCode' => '156');
// 签名
sign($params);
/*手机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:jasonhzy,项目名称:unionpay,代码行数:31,代码来源:index.php
示例7: date
require ROOT . '/classes/datamgr/order.cls.php';
include_once ROOT . '/libs/unionpay/utf8/func/common.php';
/**
* 重要:联调测试时请仔细阅读注释!
*
* 产品:跳转网关支付产品<br>
* 交易:消费:前台跳转,有前台通知应答和后台通知应答<br>
* 日期: 2015-09<br>
* 版本: 1.0.0
* 版权: 中国银联<br>
* 说明:以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己需要,按照技术文档编写。该代码仅供参考,不提供编码性能规范性等方面的保障<br>
* 提示:该接口参考文档位置:open.unionpay.com帮助中心 下载 产品接口规范 《网关支付产品接口规范》,<br>
* 《平台接入接口规范-第5部分-附录》(内包含应答码接口规范,全渠道平台银行名称-简码对照表)<br>
* 《全渠道平台接入接口规范 第3部分 文件接口》(对账文件格式说明)<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)以后台通知或交易状态查询交易确定交易成功,前台通知不能作为判断成功的标准.
* 2)交易状态查询交易(Form_6_5_Query)建议调用机制:前台类交易建议间隔(5分、10分、30分、60分、120分)发起交易查询,如果查询到结果成功,则不用再查询。(失败,处理中,查询不到订单均可能为中间状态)。也可以建议商户使用payTimeout(支付超时时间),过了这个时间点查询,得到的结果为最终结果。
*/
$order_no = $_REQUEST["order_no"];
$info = $orderMgr->getOrderByOrderNo($order_no);
$time = date("YmdHis");
$price = $info["price"] * 100;
$price = 1;
$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', 'currencyCode' => '156', 'merId' => "898111448161560", 'orderId' => $info["order_no"], 'txnTime' => $time, 'txnAmt' => $price);
sign($params);
$uri = SDK_FRONT_TRANS_URL;
$html_form = create_html($params, $uri);
echo $html_form;
开发者ID:alucard263096,项目名称:AMK,代码行数:31,代码来源:submit.php
示例8: PhpLog
* 版权: 中国银联<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)对前台交易发起交易状态查询:前台类交易建议间隔(5分、10分、30分、60分、120分)发起交易查询,如果查询到结果成功,则不用再查询。(失败,处理中,查询不到订单均可能为中间状态)。也可以建议商户使用payTimeout(支付超时时间),过了这个时间点查询,得到的结果为最终结果。
* 2)对后台交易发起交易状态查询:后台类资金类交易同步返回00,成功银联有后台通知,商户也可以发起 查询交易,可查询N次(不超过6次),每次时间间隔2N秒发起,即间隔1,2,4,8,16,32S查询(查询到03,04,05继续查询,否则终止查询)。
* 后台类资金类同步返03 04 05响应码及未得到银联响应(读超时)需发起查询交易,可查询N次(不超过6次),每次时间间隔2N秒发起,即间隔1,2,4,8,16,32S查询(查询到03,04,05继续查询,否则终止查询)。
*/
$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' => '00', 'txnSubType' => '00', 'bizType' => '000000', 'accessType' => '0', 'channelType' => '07', 'orderId' => $_POST["orderId"], 'merId' => $_POST["merId"], 'txnTime' => $_POST["txnTime"]);
sign($params);
// 签名
$url = SDK_SINGLE_QUERY_URL;
$log->LogInfo("后台请求地址为>" . $url);
$result = post($params, $url, $errMsg);
if (!$result) {
//没收到200应答的情况
printResult($url, $params, "");
echo "POST请求失败:" . $errMsg;
return;
}
$log->LogInfo("后台返回结果为>" . $result);
$result_arr = convertStringToArray($result);
printResult($url, $params, $result);
//页面打印请求应答数据
开发者ID:alucard263096,项目名称:AMK,代码行数:31,代码来源:Form_6_5_Query.php
示例9: header
<?php
header('Content-type:text/html;charset=utf-8');
define('UNIONPAY_PATH', dirname(__FILE__));
include_once UNIONPAY_PATH . '/lib/common.php';
include_once UNIONPAY_PATH . '/lib/SDKConfig.php';
include_once UNIONPAY_PATH . '/lib/secureUtil.php';
include_once UNIONPAY_PATH . '/lib/httpClient.php';
include_once UNIONPAY_PATH . '/lib/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' => '00', 'txnSubType' => '00', 'bizType' => '000201', 'accessType' => '0', 'channelType' => '08', 'orderId' => '20151443081599', 'merId' => '826340173990002', 'txnTime' => '20150924160056');
// 签名
sign($params);
echo "请求:" . getRequestParamString($params);
$log->LogInfo("后台请求地址为>" . SDK_SINGLE_QUERY_URL);
// 发送信息到后台
$result = sendHttpRequest($params, SDK_SINGLE_QUERY_URL);
$log->LogInfo("后台返回结果为>" . $result);
echo "应答:" . $result;
//返回结果展示
$result_arr = coverStringToArray($result);
echo verify($result_arr) ? '验签成功' : '验签失败';
开发者ID:jasonhzy,项目名称:unionpay,代码行数:25,代码来源:query.php
示例10: intval
<?php
//header ( 'Content-type:text/html;charset=utf-8' );
require_once './config_wap.php';
//银联wap配置文件
$payment_notice_id = intval($_REQUEST['payment_notice_id']);
$payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
$money = round($payment_notice['money'], 2) * 100;
$payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
$payment_info['config'] = unserialize($payment_info['config']);
$parameter = 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' => $payment_info['config']['merId'], 'orderId' => $payment_notice['notice_sn'], 'txnTime' => to_date($payment_notice['create_time'], 'YmdHis'), 'txnAmt' => $money, 'currencyCode' => '156', 'reqReserved' => $payment_notice_id);
//签名
sign($parameter);
// 前台请求地址
$front_uri = SDK_FRONT_TRANS_URL;
$payLinks = create_html($parameter, $front_uri);
/**
$log = new PhpLog ( SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL );
$log->LogInfo ( "前台请求地址为>" . $front_uri );
$log->LogInfo ( "-------前台交易自动提交表单>--begin----" );
$log->LogInfo ( $payLinks );
$log->LogInfo ( "-------前台交易自动提交表单>--end-------" );
$log->LogInfo ( "============处理前台请求 结束===========" );
*/
header('Content-type:text/html;charset=utf-8');
echo $payLinks;
开发者ID:BruceJi,项目名称:fanwe,代码行数:26,代码来源:unionpayapi.php
示例11: 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
示例12:
if(cus[i].checked)
pwd.value+=cus[i].checked?cus[i].value+' ':'';
}
}
}
</script>
</head>
<body>
<form action="BackReceive.php" method="post">
<table width="900px" border="1" align="center">
<tr><td align="left" colspan="2" >发送请求</td></tr>
<tr><td width="30%">版本号</td><td><input type="text" name="flags[version]" value="5.0.0"/></td></tr>
<tr><td width="30%">编码方式</td><td><input type="text" name="flags[encoding]" value="GBK"/></td></tr>
<tr><td width="30%">证书ID</td><td>
<input type="text" name="flags[certId]" value="<?=getSignCertId()?>"/></td></tr>
<tr><td width="30%">签名域</td><td><input type="text" name="flags[signature]" value=""/></td></tr>
<tr><td width="30%">签名方法</td><td><input type="text" name="flags[signMethod]" value=""/></td></tr>
<tr><td width="30%">交易类型</td><td><input type="text" name="flags[txnType]" value=""/></td></tr>
<tr><td width="30%">交易子类</td><td><input type="text" name="flags[txnSubType]" value=""/></td></tr>
<tr><td width="30%">产品类型</td><td><input type="text" name="flags[bizType]" value=""/></td></tr>
<tr><td width="30%">渠道类型</td><td><input type="text" name="flags[channelType]" value=""/></td></tr>
<tr><td width="30%" >持卡人是否加密信息<td>
<input type="checkbox" name="arr[SDK_PAN_ENC]" value="" checked="true"/>密码
<input type="checkbox" name="arr[SDK_CVN2_ENC]" value="" checked="true"/>CVN2
<input type="checkbox" name="arr[SDK_DATE_ENC]" value="" checked="true"/>有效期</td></tr>
<tr><td width="30%">前台地址</td><td><input type="text" name="flags[frontUrl]" value=""/></td></tr>
<tr><td width="30%">后台地址</td><td><input type="text" name="flags[backUrl]" value=""/></td></tr>
<tr><td width="30%">接入类型</td><td><input type="text" name="flags[accessType]" value=""/></td></tr>
<tr><td width="30%">商户ID</td><td><input type="text" name="flags[merId]" value="898340183980105"/></td></tr>
<tr><td width="30%">商户订单号</td><td><input type="text" name="flags[orderId]" value=""/></td></tr>
开发者ID:vasiliki02,项目名称:le2le,代码行数:31,代码来源:SendTest.php
示例13: header
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,代码行数:29,代码来源:Form_6_7_1_AuthDeal_App.php
示例14: sign
/**
* 签名
* @param req 请求要素
* @param resp 应答要素
* @return 是否成功
*/
static function sign(&$params, $cert_path = SDK_SIGN_CERT_PATH, $cert_pwd = SDK_SIGN_CERT_PWD)
{
$params['certId'] = getSignCertId($cert_path, $cert_pwd);
//证书ID
sign($params, $cert_path, $cert_pwd);
}
开发者ID:Lazybin,项目名称:huisa,代码行数:12,代码来源:acp_service.php
示例15: PhpLog
* 版本: 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);
$result_arr = convertStringToArray($result);
printResult($url, $params, $result);
//页面打印请求应答数据
开发者ID:alucard263096,项目名称:AMK,代码行数:31,代码来源:Form_6_7_3_PreauthFinish.php
示例16: define
<?php
//退货接口
define('UNIONPAY_PATH', dirname(__FILE__));
include_once UNIONPAY_PATH . '/lib/common.php';
include_once UNIONPAY_PATH . '/lib/SDKConfig.php';
include_once UNIONPAY_PATH . '/lib/secureUtil.php';
include_once UNIONPAY_PATH . '/lib/httpClient.php';
include_once UNIONPAY_PATH . '/lib/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' => '04', 'txnSubType' => '00', 'bizType' => '000201', 'accessType' => '0', 'channelType' => '08', 'orderId' => date('YmdHis'), 'merId' => '826340173990002', 'origQryId' => '201509241600567417338', 'txnTime' => date('YmdHis'), 'txnAmt' => 1, '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:jasonhzy,项目名称:unionpay,代码行数:24,代码来源:refund.php
示例17: header
<?php
header('Content-type: application/json;charset=UTF-8');
include_once './func/common.php';
include_once './func/SDKConfig.php';
include_once './func/secureUtil.php';
include_once './func/encryptParams.php';
include_once './func/httpClient.php';
include_once './custom_func.php';
if (!isset($_POST['card_info'])) {
die(json_encode(array('status' => 400, 'message' => 'Invalid input: card_info is required.')));
}
$decrypted_post_data = decrypt_post_data($_POST['card_info']);
try {
$card_info = json_decode($decrypted_post_data, True);
} catch (Exception $e) {
die(json_encode(array('status' => 400, 'message' => 'Error parsing post data.')));
}
$params = array('version' => '5.0.0', 'encoding' => 'GBK', 'certId' => getSignCertId(), 'signMethod' => '01', 'txnType' => '77', 'txnSubType' => '02', 'bizType' => '000301', 'channelType' => '07', 'backUrl' => $SDK_BACK_NOTIFY_URL, 'accessType' => '0', 'merId' => $SDK_MER_ID, 'orderId' => gen_order_id(), 'txnTime' => gen_order_time(), 'accType' => $card_info['acc_type'], 'accNo' => $card_info['acc_no'], 'txnAmt' => get_payment_amount(), 'currencyCode' => '156', 'customerInfo' => customerInfo_sms($card_info['acc_no'], $card_info['certif_tp'], $card_info['certif_id'], iconv("UTF-8", "gb2312", $card_info['customer_name']), $card_info['phone_no'], $card_info['pin'], $card_info['cvn2'], $card_info['expired']), 'encryptCertId' => getEncryptCertId());
// 检查字段是否需要加密
encrypt_params($params);
// 签名
sign($params);
// 发送信息到后台
$result = sendHttpRequest($params, $SDK_BACK_TRANS_URL);
$result_array = coverStringToArray($result);
if ($result_array['respCode'] != '00') {
die(json_encode(array('status' => -1, 'message' => 'Error querying Unionpay API.', 'error_resp_code' => $result_array['respCode'], 'error_resp_msg' => iconv('gb2312', 'UTF-8', $result_array['respMsg']))));
}
echo json_encode(array('status' => 200, 'message' => 'Success'));
开发者ID:Chion82,项目名称:Unionpay_PHP_API,代码行数:30,代码来源:send_sms.php
示例18: 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
示例19: 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;
|
请发表评论