Commit a64a86c0 by yeran

add orgid for tlpay by yeran

1 parent 36d3fc63
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
return [ return [
'app_id' => '00020281', // 公众账号ID 'app_id' => '00032161', // 公众账号ID
'cus_id' => '55079104816PJXP',// 商户id 'cus_id' => '55079104816PJXP',// 商户id
'md5_key' => '55079104816PJXP04',// md5 秘钥 'md5_key' => '55079104816PJXP04',// md5 秘钥
'sign_type' => 'MD5',// MD5 HMAC-SHA256 'sign_type' => 'MD5',// MD5 HMAC-SHA256
......
...@@ -105,7 +105,14 @@ abstract class BaseData ...@@ -105,7 +105,14 @@ abstract class BaseData
$this->buildData(); $this->buildData();
if ($this->channel === Config::CMB_PAY) { if ($this->channel === Config::CMB_PAY) {
$data = $this->retData['reqData']; $data = $this->retData['reqData'];
} else { } else {
if($this->orgid){
$this->retData['orgid'] = $this->orgid;
$this->retData = ArrayUtil::paraFilter($this->retData);
}
$data = $this->retData; $data = $this->retData;
} }
......
...@@ -56,6 +56,10 @@ final class TLConfig extends ConfigInterface ...@@ -56,6 +56,10 @@ final class TLConfig extends ConfigInterface
const REFUND_RECHARGE = 'REFUND_SOURCE_RECHARGE_FUNDS';// 可用余额退款(限非当日交易订单的退款) const REFUND_RECHARGE = 'REFUND_SOURCE_RECHARGE_FUNDS';// 可用余额退款(限非当日交易订单的退款)
const PLATFORM_APPID = '00032161'; // 平台appId
const orgid = '55079104816UGBA'; // 代为发起交易的机构商户号
/** /**
* 初始化配置文件 * 初始化配置文件
* TLConfig constructor. * TLConfig constructor.
...@@ -83,6 +87,12 @@ final class TLConfig extends ConfigInterface ...@@ -83,6 +87,12 @@ final class TLConfig extends ConfigInterface
// 检查 分配的公众账号ID // 检查 分配的公众账号ID
if (key_exists('app_id', $config) && !empty($config['app_id'])) { if (key_exists('app_id', $config) && !empty($config['app_id'])) {
$this->appId = $config['app_id']; $this->appId = $config['app_id'];
if(self::PLATFORM_APPID == $this->appId){
$this->orgid = self::orgid;
}else{
$this->orgid = null;
}
} else { } else {
throw new PayException('必须提供支付平台分配的公众账号ID'); throw new PayException('必须提供支付平台分配的公众账号ID');
} }
......
...@@ -47,7 +47,6 @@ class TLCancelData extends TLBaseData ...@@ -47,7 +47,6 @@ class TLCancelData extends TLBaseData
'oldreqsn' => $this->oldreqsn,//原交易的商户交易单号 'oldreqsn' => $this->oldreqsn,//原交易的商户交易单号
'oldtrxid' => $this->oldtrxid,//原交易的收银宝平台流水 'oldtrxid' => $this->oldtrxid,//原交易的收银宝平台流水
]; ];
// 移除数组中的空值 // 移除数组中的空值
$this->retData = ArrayUtil::paraFilter($signData); $this->retData = ArrayUtil::paraFilter($signData);
} }
......
...@@ -29,6 +29,8 @@ class BackTLChargeData extends TLBaseData ...@@ -29,6 +29,8 @@ class BackTLChargeData extends TLBaseData
'package' => 'prepay_id=' . $this->chnltrxid, 'package' => 'prepay_id=' . $this->chnltrxid,
'signType' => 'MD5',// 签名算法,暂支持MD5 'signType' => 'MD5',// 签名算法,暂支持MD5
]; ];
} }
protected function checkDataParam() protected function checkDataParam()
......
...@@ -53,7 +53,6 @@ class TLChargeData extends ChargeBaseData ...@@ -53,7 +53,6 @@ class TLChargeData extends ChargeBaseData
'acct' => $this->acct 'acct' => $this->acct
]; ];
// 移除数组中的空值 // 移除数组中的空值
$this->retData = ArrayUtil::paraFilter($signData); $this->retData = ArrayUtil::paraFilter($signData);
......
...@@ -33,6 +33,7 @@ class TLQueryData extends TLBaseData ...@@ -33,6 +33,7 @@ class TLQueryData extends TLBaseData
'trxid' => $this->trxid,//支付的收银宝平台流水 'trxid' => $this->trxid,//支付的收银宝平台流水
]; ];
$this->retData = ArrayUtil::paraFilter($this->retData); $this->retData = ArrayUtil::paraFilter($this->retData);
} }
......
...@@ -67,7 +67,7 @@ class QueryContext ...@@ -67,7 +67,7 @@ class QueryContext
case Config::CMB_REFUND:// 招商退款查询 case Config::CMB_REFUND:// 招商退款查询
$this->query = new CmbRefundQuery($config); $this->query = new CmbRefundQuery($config);
break; break;
case Config::TL_QUERY:// 招商退款查询 case Config::TL_QUERY:// 通联退款查询
$this->query = new TLQuery($config); $this->query = new TLQuery($config);
break; break;
default: default:
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!