Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
c9fc6ca0
Commit
c9fc6ca0
authored
Jan 12, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
27b265fe
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
center-channel/app/base/api/impl/payment/paymentApi.js
+9
-7
center-channel/app/config/routes/api.js
+5
-0
center-channel/app/config/settings.js
+1
-1
No files found.
center-channel/app/base/api/impl/payment/paymentApi.js
View file @
c9fc6ca0
...
...
@@ -5,7 +5,7 @@ class PaymentAPI extends APIBase {
constructor
()
{
super
();
this
.
execlient
=
system
.
getObject
(
"util.execClient"
);
this
.
center
PaymentUrl
=
settings
.
centerPayment
Url
();
this
.
center
AppUrl
=
settings
.
centerApp
Url
();
}
/**
...
...
@@ -21,22 +21,24 @@ class PaymentAPI extends APIBase {
if
(
!
pobj
.
actionType
)
{
return
system
.
getResult
(
null
,
"actionType参数不能为空"
);
}
var
result
=
await
this
.
opActionProcess
(
pobj
.
actionProcess
,
pobj
.
actionType
,
pobj
.
actionBody
,
req
);
var
result
=
await
this
.
opActionProcess
(
pobj
,
pobj
.
actionType
,
pobj
.
actionBody
,
req
);
return
result
;
}
async
opActionProcess
(
action_process
,
action_type
,
action_body
,
req
)
{
async
opActionProcess
(
pobj
,
action_type
,
action_body
,
req
)
{
var
opResult
=
null
;
var
url
=
""
;
switch
(
action_type
)
{
// sy
case
"getQrCode"
:
//pc端订单支付二维码生成
url
=
this
.
center
PaymentUrl
+
"api/
payment/paymentApi/getQrCode"
;
url
=
this
.
center
AppUrl
+
"
payment/paymentApi/getQrCode"
;
break
;
case
"queryOrder"
:
//通联支付查询
url
=
this
.
centerPaymentUrl
+
"api/payment/paymentApi/queryOrder"
;
url
=
this
.
centerAppUrl
+
"payment/paymentApi/queryOrder"
;
break
;
case
"receiveCallBackNotify"
:
//通联支付查询
url
=
this
.
centerAppUrl
+
"payment/paymentApi/receiveCallBackNotify"
;
break
;
default
:
opResult
=
system
.
getResult
(
null
,
"action_type参数错误"
);
break
;
...
...
@@ -44,7 +46,7 @@ class PaymentAPI extends APIBase {
if
(
url
)
{
opResult
=
system
.
getResultSuccess
(
null
,
"action_type参数错误"
);
}
var
opResultstr
=
await
this
.
execlient
.
execPost
(
action_body
,
url
);
var
opResultstr
=
await
this
.
execlient
.
execPost
(
pobj
,
url
);
opResult
=
JSON
.
parse
(
opResultstr
.
stdout
)
return
opResult
;
}
...
...
center-channel/app/config/routes/api.js
View file @
c9fc6ca0
...
...
@@ -19,6 +19,11 @@ module.exports = function (app) {
next
();
return
;
}
if
(
req
.
body
.
actionType
==
"receiveCallBackNotify"
)
{
req
.
body
.
actionBody
.
app_hosts
=
req
.
host
;
next
();
return
;
}
var
token
=
req
.
headers
[
"token"
]
||
""
;
if
(
!
token
)
{
result
.
msg
=
"req headers token can not be empty"
;
...
...
center-channel/app/config/settings.js
View file @
c9fc6ca0
...
...
@@ -29,7 +29,7 @@ var settings = {
},
centerAppUrl
:
function
()
{
if
(
this
.
env
==
"dev"
)
{
return
"http://
centerapp.apps.com
:4010/"
;
return
"http://
192.168.18.34
:4010/"
;
}
else
{
return
"https://centerapp/"
;
}
...
...
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