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 035e2785
authored
May 18, 2023
by
郑建康(PHP)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代付通道解密方法
1 parent
78531dd1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
18 deletions
src/Notify/HsqTransferNotify.php
src/Notify/NotifyStrategy.php
src/Notify/HsqTransferNotify.php
View file @
035e278
...
...
@@ -51,7 +51,14 @@ class HsqTransferNotify extends NotifyStrategy
$tmp2
=
explode
(
"="
,
$val
);
$result_data
[
$tmp2
[
0
]]
=
$tmp2
[
1
];
}
return
$result_data
;
if
(
empty
(
$this
->
config
->
publicKey
))
return
false
;
$publicKey
=
$this
->
config
->
publicKey
;
$retData
=
$result_data
[
'data_content'
];
//解密
$decrypt
=
BaoFooRsaUtil
::
decryptByCERFile
(
$retData
,
$publicKey
);
$data_content
=
DataParser
::
toArray
(
$decrypt
);
$result
=
$data_content
[
'trans_reqDatas'
][
'trans_reqData'
]
??
''
;
return
$result
;
}
/**
...
...
@@ -75,22 +82,7 @@ class HsqTransferNotify extends NotifyStrategy
*/
protected
function
verifySign
(
array
$retData
)
{
if
(
empty
(
$this
->
config
->
publicKey
))
return
false
;
$publicKey
=
$this
->
config
->
publicKey
;
$retData
=
$retData
[
'data_content'
];
//解密
$decrypt
=
BaoFooRsaUtil
::
decryptByCERFile
(
$retData
,
$publicKey
);
$data_content
=
DataParser
::
toArray
(
$decrypt
);
$result
=
$data_content
[
'trans_reqDatas'
][
'trans_reqData'
]
??
''
;
if
(
$result
)
{
//验签成功
return
$result
;
}
else
{
return
false
;
}
return
true
;
}
/**
...
...
src/Notify/NotifyStrategy.php
View file @
035e278
...
...
@@ -51,7 +51,7 @@ abstract class NotifyStrategy
}
// 回调商户的业务逻辑
$flag
=
$this
->
callback
(
$notify
,
$
checkRet
);
$flag
=
$this
->
callback
(
$notify
,
$
notifyData
);
if
(
$flag
)
{
$msg
=
'OK'
;
...
...
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