Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
ldy
/
payment
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a64a86c0
authored
Jun 14, 2018
by
yeran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add orgid for tlpay by yeran
1 parent
36d3fc63
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
22 additions
and
4 deletions
examples/TLConfig.php
src/Common/BaseData.php
src/Common/TLConfig.php
src/Common/TLpay/Data/Cancel/TLCancelData.php
src/Common/TLpay/Data/Charge/BackTLChargeData.php
src/Common/TLpay/Data/Charge/TLChargeData.php
src/Common/TLpay/Data/Query/TLQueryData.php
src/QueryContext.php
examples/TLConfig.php
View file @
a64a86c
...
...
@@ -7,7 +7,7 @@
return
[
'app_id'
=>
'000
2028
1'
,
// 公众账号ID
'app_id'
=>
'000
3216
1'
,
// 公众账号ID
'cus_id'
=>
'55079104816PJXP'
,
// 商户id
'md5_key'
=>
'55079104816PJXP04'
,
// md5 秘钥
'sign_type'
=>
'MD5'
,
// MD5 HMAC-SHA256
...
...
src/Common/BaseData.php
View file @
a64a86c
...
...
@@ -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
;
}
...
...
src/Common/TLConfig.php
View file @
a64a86c
...
...
@@ -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'
);
}
...
...
src/Common/TLpay/Data/Cancel/TLCancelData.php
View file @
a64a86c
...
...
@@ -47,7 +47,6 @@ class TLCancelData extends TLBaseData
'oldreqsn'
=>
$this
->
oldreqsn
,
//原交易的商户交易单号
'oldtrxid'
=>
$this
->
oldtrxid
,
//原交易的收银宝平台流水
];
// 移除数组中的空值
$this
->
retData
=
ArrayUtil
::
paraFilter
(
$signData
);
}
...
...
src/Common/TLpay/Data/Charge/BackTLChargeData.php
View file @
a64a86c
...
...
@@ -29,6 +29,8 @@ class BackTLChargeData extends TLBaseData
'package'
=>
'prepay_id='
.
$this
->
chnltrxid
,
'signType'
=>
'MD5'
,
// 签名算法,暂支持MD5
];
}
protected
function
checkDataParam
()
...
...
src/Common/TLpay/Data/Charge/TLChargeData.php
View file @
a64a86c
...
...
@@ -53,7 +53,6 @@ class TLChargeData extends ChargeBaseData
'acct'
=>
$this
->
acct
];
// 移除数组中的空值
$this
->
retData
=
ArrayUtil
::
paraFilter
(
$signData
);
...
...
src/Common/TLpay/Data/Query/TLQueryData.php
View file @
a64a86c
...
...
@@ -33,6 +33,7 @@ class TLQueryData extends TLBaseData
'trxid'
=>
$this
->
trxid
,
//支付的收银宝平台流水
];
$this
->
retData
=
ArrayUtil
::
paraFilter
(
$this
->
retData
);
}
...
...
src/QueryContext.php
View file @
a64a86c
...
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment