本文整理汇总了PHP中Merchant::sign方法的典型用法代码示例。如果您正苦于以下问题:PHP Merchant::sign方法的具体用法?PHP Merchant::sign怎么用?PHP Merchant::sign使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Merchant
的用法示例。
在下文中一共展示了Merchant::sign方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: error_reporting
<?php
/**
* 商户查询功能demo
* $Author: zhaoshuangxi
*/
error_reporting(0);
require "config.php";
require "http.php";
require "merchant.class.php";
$http = Http::factory(Http::TYPE_STREAM);
$arr = array("version" => $config['version'], "charset" => $config['charset'], "signMethod" => $config['signMethod'], "transType" => "005", "merId" => $config['merchantId'], "merchantKey" => $config['merchantKey'], "mercOrderNo" => "1234500026", "signature" => "");
$arr['signature'] = Merchant::sign($arr);
$res = $http->post($config['postUrl'], $arr);
print $res;
示例2: sign
public function sign()
{
// dump($_POST);
/*
$version = "1.0.0"; // //版本号
$charset = "UTF-8"; // 字符编码
$transType = "001"; // 消费类型
$transCode = "0001"; // 交易代码
$merchantId = "900000000009"; //商户号
// $platMerchantId = ""; // 平台商户号
$backEndUrl = "http:ppp2p.mifengwo.me"; //通知url
$frontEndUrl = "http:ppp2p.mifengwo.me"; //返回url
// $sameOrderFlag = ""; // 同一订单号重复提交标志
// $orderTime = ""; // 交易开始日期
$mercOrderNo = "1234567890"; //商户订单号、 流水号
// $merchantTransDesc = ""; //商户自定义交易说明
// $language = ""; //语言
// $commodityList1 = ""; //商品1
// $commodityList2 = ""; //商品2
$orderAmount = "1"; //交易金额
$orderCurrency = "CNY"; //交易币种
// $distributeInfo = ""; //分润信息
// $customerMerchantId = ""; //用户在商户的会员号
// $customerPAFId = ""; // 用户平安付账户名
// $customerName = ""; //用户姓名
// $customerIdType = ""; //用户证件类型
// $customerIdNo = ""; //用户证件号码
// $specifiedPayType = ""; //指定支付方式
// $specifiedBankNumber = ""; //指定银行编码
// $transTimeout = ""; // 交易超时时间
// $antiPhishingTimeStamp = ""; //防钓鱼时间戳
// $customerIp = ""; //用户Ip
// $customerRefer = ""; //用户网站
// $token = ""; //联合登陆散列码
// $mercRetrunPara = ""; //商户回传参数
// $merReserved = ""; //商户保留域
// $merReserved2 = ""; //商户保留域2
// $businessScene = ""; //业务场景
$signMethod = "SHA-256"; //签名方法
$origMercOrderNo = ""; //原商户订单号
$origOrderTraceNo = ""; //原始平安交易号
$merchantKey = "9286ed7a54e94c5e96820896d02c412d"; //商户签约密钥
$signature = ""; // 签名信息
//我们把请求参数一个个拼接
$data = ''; //
$data = $data.$version;
$data = $data.$charset;
$data = $data.$transType;
$data = $data.$transCode;
$data = $data.$merchantId;
// $data = $data.$platMerchantId;
$data = $data.$backEndUrl;
$data = $data.$frontEndUrl;
// $data = $data.$sameOrderFlag;
// $data = $data.$orderTime;
$data = $data.$mercOrderNo;
// $data = $data.$merchantTransDesc;
// $data = $data.$language;
// $data = $data.$commodityList1;
// $data = $data.$commodityList2;
$data = $data.$orderAmount;
$data = $data.$orderCurrency;
// $data = $data.$distributeInfo;
// $data = $data.$customerMerchantId;
// $data = $data.$customerPAFId;
// $data = $data.$customerName;
// $data = $data.$customerIdType;
// $data = $data.$customerIdNo;
// $data = $data.$specifiedPayType;
// $data = $data.$specifiedBankNumber;
// $data = $data.$transTimeout;
// $data = $data.$antiPhishingTimeStamp;
// $data = $data.$customerIp;
// $data = $data.$customerRefer;
// $data = $data.$token;
// $data = $data.$mercRetrunPara;
// $data = $data.$merReserved;
// $data = $data.$merReserved2;
// $data = $data.$businessScene;
$data = $data.$signMethod;
$data = $data.$origMercOrderNo;
$data = $data.$origOrderTraceNo;
// $data = $data.$merchantKey;
// $data = $data.$signature;
*/
// dump($_POST);
// $data = array(
// "version" => "1.0.0",
// "charset" => "UTF-8",
// "transType" => "001",
// "transCode" => "0001",
// "merchantId" => "900000000009",
// "backEndUrl" => "http://ppp2p.mifengwo.me",
// "frontEndUrl" => "http://ppp2p.mifengwo.me",
// "mercOrderNo" => "201504281110",
// "orderAmount" => "1",
//.........这里部分代码省略.........
示例3: error_reporting
<?php
/**
* 商户消费功能demo
* $Author: zhaoshuangxi
*/
error_reporting(0);
require "config.php";
require "http.php";
require "merchant.class.php";
$http = Http::factory(Http::TYPE_STREAM);
$arr = array("version" => $config['version'], "charset" => $config['charset'], "signMethod" => $config['signMethod'], "transType" => "001", "transCode" => "0003", "merchantId" => $config['merchantId'], "mercOrderNo" => "12345", "orderAmount" => "1", "orderCurrency" => "CNY", "token" => "YzkxYzQ2NTE2YWFlNDlhYTUzNmE3YWMyZTA5ZTNlYmM", "transCode" => "0003", "signature" => "");
$arr['signature'] = Merchant::sign($arr, $config['merchantKey']);
$res = $http->post($config['postUrl'], $arr);