Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
51business
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
方斌
51business
Commits
4f742b67
Commit
4f742b67
authored
Sep 11, 2019
by
Hsinli
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of t-git.51gjj.com:fangbin/51business
parents
7880190a
c93218df
Pipeline
#13690
passed with stage
in 26 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
order.js
app/controller/credit/order.js
+5
-4
credit.js
app/router/credit.js
+1
-1
order.js
app/service/credit/order.js
+3
-2
No files found.
app/controller/credit/order.js
View file @
4f742b67
...
...
@@ -4,6 +4,7 @@ const Controller = require('egg').Controller;
const
xml2js
=
require
(
'xml2js'
).
parseString
;
class
OrderController
extends
Controller
{
//订单支付详情页信息
async
getOrderPayInfo
()
{
const
{
ctx
}
=
this
;
...
...
@@ -14,7 +15,7 @@ class OrderController extends Controller {
}
//我的历史
首页
//我的历史
订单
async
getRecord
()
{
const
{
ctx
}
=
this
;
...
...
@@ -25,7 +26,7 @@ class OrderController extends Controller {
ctx
.
success
({
results
});
}
//
微信支付
//
支付订单
async
payOrder
()
{
const
{
ctx
}
=
this
;
...
...
@@ -36,8 +37,8 @@ class OrderController extends Controller {
ctx
.
success
({
result
});
}
//微信支付通知
async
payNotice
()
{
//微信支付
异步
通知
async
Wexin
payNotice
()
{
const
{
ctx
}
=
this
;
let
data
=
''
;
...
...
app/router/credit.js
View file @
4f742b67
...
...
@@ -7,7 +7,7 @@ module.exports = app => {
router
.
get
(
'/history/:type'
,
'credit.order.getRecord'
);
router
.
post
(
'/order/pay'
,
'credit.order.payOrder'
);
router
.
get
(
'/order/pay/:order_id'
,
'credit.order.payOrder'
);
router
.
post
(
'/order/
pay_notice'
,
'credit.order.
payNotice'
);
router
.
post
(
'/order/
wx_pay_notice'
,
'credit.order.Wexin
payNotice'
);
router
.
get
(
'/order/check_pay/:order_id'
,
'credit.order.checkPay'
);
router
.
get
(
'/order/info/:order_id'
,
'credit.order.getOrderPayInfo'
);
...
...
app/service/credit/order.js
View file @
4f742b67
...
...
@@ -301,7 +301,7 @@ class OrderService extends Service {
if
(
price
<=
0
)
{
ctx
.
failed
(
'error price'
);
}
if
(
type
===
'w
exin
'
)
{
if
(
type
===
'w
xpay
'
)
{
let
body
=
'黑名单报告检测支付'
;
if
(
order
.
type
===
2
)
{
...
...
@@ -312,7 +312,7 @@ class OrderService extends Service {
order_id
,
trade_no
:
moment
().
valueOf
()
+
ctx
.
helper
.
PrefixInteger
(
order_id
,
11
),
total_fee
:
price
,
notify_url
:
`
${
this
.
config
.
OUT_P_NODE_URL
}
/51business/api/credit/order/pay_notice`
,
notify_url
:
`
${
this
.
config
.
OUT_P_NODE_URL
}
/51business/api/credit/order/
wx_
pay_notice`
,
product_id
:
order
.
order_no
,
scene_info
:
JSON
.
stringify
({
h5_info
:
{
type
:
'Wap'
,
wap_url
:
this
.
config
.
PHP_URL
,
wap_name
:
'我的信用'
},
}),
};
...
...
@@ -331,6 +331,7 @@ class OrderService extends Service {
await
this
.
addCreditPay
(
pay_data
);
await
this
.
updateOrderStateToCancel
(
order
);
await
this
.
updateOrderPrice
(
order
);
await
ctx
.
prometheusModel
.
CreditOrder
.
update
({
method
:
type
,
state
:
'支付中'
},
{
where
:
{
id
:
order
.
id
}
});
return
{
url
:
ret
.
mweb_url
,
order_id
:
order_id
,
trade_no
:
data
.
trade_no
};
}
else
if
(
type
===
'alipay'
)
{
...
...
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