Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pay
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
pay
Commits
027fb54b
Commit
027fb54b
authored
Aug 20, 2021
by
wanjilong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 修复 raw REQUEST,接收POST
parent
03040b99
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
Order.php
application/modules/Pay/controllers/Order.php
+2
-2
Hook.php
application/plugins/Hook.php
+4
-1
No files found.
application/modules/Pay/controllers/Order.php
View file @
027fb54b
...
...
@@ -40,7 +40,8 @@ class OrderController extends Base
public
function
refundAction
()
{
$params
=
$this
->
params
;
$params
=
$this
->
getRequest
()
->
getPost
();
if
(
!
empty
(
$params
[
'order_item_id'
]))
{
if
(
!
is_array
(
$params
[
'order_item_id'
]))
{
$params
[
'order_item_id'
]
=
explode
(
','
,
$params
[
'order_item_id'
]);
...
...
@@ -50,7 +51,6 @@ class OrderController extends Base
$params
[
'order_item_id'
]
=
[];
}
if
(
empty
(
$params
[
'order_id'
]))
{
throw
new
PayException
([
'cus'
=>
1
]);
}
...
...
application/plugins/Hook.php
View file @
027fb54b
...
...
@@ -46,7 +46,7 @@ class Hook extends \Yaf\Plugin_Abstract {
}
public
function
preDispatch
(
\Yaf\Request_Abstract
$request
,
\Yaf\Response_Abstract
$response
)
{
// application/json形式,仅处理$_POST, 不整合$_GET
, $_REQUEST
// application/json形式,仅处理$_POST, 不整合$_GET
if
(
$request
->
isPost
()
&&
$request
->
getServer
(
'CONTENT_TYPE'
)
==
'application/json'
)
{
...
...
@@ -57,10 +57,13 @@ class Hook extends \Yaf\Plugin_Abstract {
}
$_POST
=
json_decode
(
$jsonPost
,
true
);
if
(
!
is_array
(
$_POST
))
{
$_POST
=
[];
FileLog
::
error
(
'bp-gateway'
,
'json decode error raw:'
.
$jsonPost
);
}
$_REQUEST
=
array_merge
(
$_REQUEST
,
$_POST
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment