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 e08bb392
authored
May 18, 2023
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_huishouqian' into 'master'
优化代付通道解密方法 See merge request !10
2 parents
523a47b3
f2fea08c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
18 deletions
src/Notify/HsqTransferNotify.php
src/Notify/NotifyStrategy.php
src/Notify/HsqTransferNotify.php
View file @
e08bb39
...
...
@@ -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 @
e08bb39
...
...
@@ -52,6 +52,7 @@ abstract class NotifyStrategy
// 回调商户的业务逻辑
$flag
=
$this
->
callback
(
$notify
,
$notifyData
);
if
(
$flag
)
{
$msg
=
'OK'
;
}
else
{
...
...
@@ -115,4 +116,4 @@ abstract class NotifyStrategy
*
*/
abstract
protected
function
replyNotify
(
$flag
,
$msg
=
'OK'
);
}
}
\ No newline at end of file
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