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
c93218df
Commit
c93218df
authored
Sep 11, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
c9aaa20f
Pipeline
#13689
passed with stage
in 4 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 @
c93218df
...
@@ -4,6 +4,7 @@ const Controller = require('egg').Controller;
...
@@ -4,6 +4,7 @@ const Controller = require('egg').Controller;
const
xml2js
=
require
(
'xml2js'
).
parseString
;
const
xml2js
=
require
(
'xml2js'
).
parseString
;
class
OrderController
extends
Controller
{
class
OrderController
extends
Controller
{
//订单支付详情页信息
async
getOrderPayInfo
()
{
async
getOrderPayInfo
()
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
...
@@ -14,7 +15,7 @@ class OrderController extends Controller {
...
@@ -14,7 +15,7 @@ class OrderController extends Controller {
}
}
//我的历史
首页
//我的历史
订单
async
getRecord
()
{
async
getRecord
()
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
...
@@ -25,7 +26,7 @@ class OrderController extends Controller {
...
@@ -25,7 +26,7 @@ class OrderController extends Controller {
ctx
.
success
({
results
});
ctx
.
success
({
results
});
}
}
//
微信支付
//
支付订单
async
payOrder
()
{
async
payOrder
()
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
...
@@ -36,8 +37,8 @@ class OrderController extends Controller {
...
@@ -36,8 +37,8 @@ class OrderController extends Controller {
ctx
.
success
({
result
});
ctx
.
success
({
result
});
}
}
//微信支付通知
//微信支付
异步
通知
async
payNotice
()
{
async
Wexin
payNotice
()
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
let
data
=
''
;
let
data
=
''
;
...
...
app/router/credit.js
View file @
c93218df
...
@@ -7,7 +7,7 @@ module.exports = app => {
...
@@ -7,7 +7,7 @@ module.exports = app => {
router
.
get
(
'/history/:type'
,
'credit.order.getRecord'
);
router
.
get
(
'/history/:type'
,
'credit.order.getRecord'
);
router
.
post
(
'/order/pay'
,
'credit.order.payOrder'
);
router
.
post
(
'/order/pay'
,
'credit.order.payOrder'
);
router
.
get
(
'/order/pay/:order_id'
,
'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/check_pay/:order_id'
,
'credit.order.checkPay'
);
router
.
get
(
'/order/info/:order_id'
,
'credit.order.getOrderPayInfo'
);
router
.
get
(
'/order/info/:order_id'
,
'credit.order.getOrderPayInfo'
);
...
...
app/service/credit/order.js
View file @
c93218df
...
@@ -301,7 +301,7 @@ class OrderService extends Service {
...
@@ -301,7 +301,7 @@ class OrderService extends Service {
if
(
price
<=
0
)
{
if
(
price
<=
0
)
{
ctx
.
failed
(
'error price'
);
ctx
.
failed
(
'error price'
);
}
}
if
(
type
===
'w
exin
'
)
{
if
(
type
===
'w
xpay
'
)
{
let
body
=
'黑名单报告检测支付'
;
let
body
=
'黑名单报告检测支付'
;
if
(
order
.
type
===
2
)
{
if
(
order
.
type
===
2
)
{
...
@@ -312,7 +312,7 @@ class OrderService extends Service {
...
@@ -312,7 +312,7 @@ class OrderService extends Service {
order_id
,
order_id
,
trade_no
:
moment
().
valueOf
()
+
ctx
.
helper
.
PrefixInteger
(
order_id
,
11
),
trade_no
:
moment
().
valueOf
()
+
ctx
.
helper
.
PrefixInteger
(
order_id
,
11
),
total_fee
:
price
,
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
,
product_id
:
order
.
order_no
,
scene_info
:
JSON
.
stringify
({
h5_info
:
{
type
:
'Wap'
,
wap_url
:
this
.
config
.
PHP_URL
,
wap_name
:
'我的信用'
},
}),
scene_info
:
JSON
.
stringify
({
h5_info
:
{
type
:
'Wap'
,
wap_url
:
this
.
config
.
PHP_URL
,
wap_name
:
'我的信用'
},
}),
};
};
...
@@ -331,6 +331,7 @@ class OrderService extends Service {
...
@@ -331,6 +331,7 @@ class OrderService extends Service {
await
this
.
addCreditPay
(
pay_data
);
await
this
.
addCreditPay
(
pay_data
);
await
this
.
updateOrderStateToCancel
(
order
);
await
this
.
updateOrderStateToCancel
(
order
);
await
this
.
updateOrderPrice
(
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
};
return
{
url
:
ret
.
mweb_url
,
order_id
:
order_id
,
trade_no
:
data
.
trade_no
};
}
else
if
(
type
===
'alipay'
)
{
}
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