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 389be2d9
authored
Jul 22, 2019
by
wangyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 调整公众号支付
1 parent
d0622ee2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
43 deletions
src/Common/Fu/Data/BackPubChargeData.php
src/Common/Sw/Data/BackPubChargeData.php
src/Common/Fu/Data/BackPubChargeData.php
View file @
389be2d
...
...
@@ -12,31 +12,33 @@ class BackPubChargeData extends FuBaseData
public
function
getData
()
{
$data
=
[];
switch
(
$this
->
trade_type
)
{
case
'JSAPI'
:
//微信公众号
case
'LETPAY'
:
//小程序
$data
=
[
'appId'
=>
$this
->
subAppid
??
$this
->
sdk_appid
,
'timeStamp'
=>
$this
->
sdk_timestamp
??
time
(),
'nonceStr'
=>
$this
->
sdk_noncestr
,
'package'
=>
$this
->
sdk_package
,
'signType'
=>
$this
->
sdk_signtype
,
'paySign'
=>
$this
->
sdk_paysign
];
break
;
case
'FWC'
:
$data
=
[
'transaction_id'
=>
$this
->
reserved_transaction_id
];
break
;
default
:
//TODO: 貌似不需要根据订单类型判断,返回参数中存在 reserved_pay_info 字段,该字段为JSON字符串,与发起支付时所需要参数相同,可以直接根据该字段值返回package
if
(
!
empty
(
$this
->
reserved_pay_info
))
{
switch
(
$this
->
trade_type
)
{
case
'JSAPI'
:
//微信公众号
case
'LETPAY'
:
//小程序
$data
=
[
'appId'
=>
$this
->
subAppid
??
$this
->
sdk_appid
,
'timeStamp'
=>
$this
->
sdk_timestamp
??
time
(),
'nonceStr'
=>
$this
->
sdk_noncestr
,
'package'
=>
$this
->
sdk_package
,
'signType'
=>
$this
->
sdk_signtype
,
'paySign'
=>
$this
->
sdk_paysign
];
break
;
case
'FWC'
:
$data
=
[
'transaction_id'
=>
$this
->
reserved_transaction_id
];
break
;
default
:
}
}
$this
->
retData
[
'package'
]
=
$data
;
$this
->
retData
[
'package'
]
=
!
empty
(
$this
->
reserved_pay_info
)
?
json_decode
(
$this
->
reserved_pay_info
,
true
)
:
$data
;
$this
->
retData
[
'other'
]
=
[
'out_trade_no'
=>
$this
->
reserved_fy_order_no
?:
''
,
'attach'
=>
$this
->
reserved_addn_inf
?:
''
];
return
parent
::
getData
();
}
...
...
src/Common/Sw/Data/BackPubChargeData.php
View file @
389be2d
...
...
@@ -18,33 +18,37 @@ class BackPubChargeData extends SwBaseData
public
function
getData
()
{
$data
=
[];
switch
(
$this
->
pay_type
){
case
'010'
:
{
//微信
$data
=
[
'appId'
=>
$this
->
appId
,
'timeStamp'
=>
time
()
.
''
,
'nonceStr'
=>
$this
->
nonceStr
,
'package'
=>
$this
->
package_str
,
'signType'
=>
$this
->
signType
,
// 签名算法,暂支持MD5
];
switch
(
$this
->
pay_type
)
{
case
'010'
:
{
//微信
$data
=
[
'appId'
=>
$this
->
appId
,
'timeStamp'
=>
$this
->
timeStamp
,
'nonceStr'
=>
$this
->
nonceStr
,
'package'
=>
$this
->
package_str
,
'signType'
=>
$this
->
signType
,
// 签名算法,暂支持MD5
'paySign'
=>
$this
->
paySign
];
break
;
}
break
;
}
case
'020'
:
{
//支付宝
$data
=
[
'ali_trade_no'
=>
$this
->
ali_trade_no
,
];
case
'020'
:
{
//支付宝
$data
=
[
'ali_trade_no'
=>
$this
->
ali_trade_no
,
];
break
;
}
case
'060'
:
{
$data
=
[
'token_id'
=>
$this
->
token_id
,
];
break
;
}
case
'060'
:
{
$data
=
[
'token_id'
=>
$this
->
token_id
,
];
break
;
}
break
;
}
}
$this
->
retData
[
'jspackage'
]
=
$data
;
$this
->
retData
[
'other'
]
=
[
...
...
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