Commit a64a86c0 by yeran

add orgid for tlpay by yeran

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