Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郝肖肖
8 years ago
Commit
6e0a56e73a8105f1163aff7565f4d33f830b2bde
1 parent
01a1a127
支付updateOrdersPaymentByCode调用不须要调用savePrePayInfo接口
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
33 deletions
apps/shopping/helpers/pay/sign.js
apps/shopping/helpers/payment.js
apps/shopping/models/pay-api.js
apps/shopping/models/pay.js
apps/shopping/helpers/pay/sign.js
View file @
6e0a56e
...
...
@@ -14,7 +14,7 @@ const Sign = {
}).
sort
();
return
keys
.
map
(
k
=>
{
return
k
+
'='
+
args
[
k
]
;
return
k
+
'='
+
decodeURI
(
args
[
k
])
;
}).
join
(
'&'
);
},
...
...
@@ -26,7 +26,7 @@ const Sign = {
}).
sort
();
return
keys
.
map
(
k
=>
{
return
k
.
toLowerCase
()
+
'='
+
encodeURI
Component
(
args
[
k
]);
return
k
.
toLowerCase
()
+
'='
+
encodeURI
(
args
[
k
]);
}).
join
(
'&'
);
}
};
...
...
apps/shopping/helpers/payment.js
View file @
6e0a56e
...
...
@@ -90,14 +90,12 @@ const Payment = {
beforePay
(
user
,
order
,
method
,
bankCode
)
{
return
Promise
.
all
([
OrderData
.
updateOrderPayment
(
order
.
order_code
,
method
,
user
.
uid
),
PayData
.
savePrePayInfo
(
order
.
order_code
,
method
,
user
.
uid
),
PayData
.
getBankByOrder
(
order
.
order_code
)
]).
then
(
result
=>
{
let
paymentRecord
=
result
[
0
];
let
prePayResult
=
result
[
1
];
let
bankRecord
=
result
[
2
];
let
bankRecord
=
result
[
1
];
if
(
!
paymentRecord
||
paymentRecord
.
code
!==
200
||
!
prePayResult
||
prePayResult
.
code
!==
200
)
{
if
(
!
paymentRecord
||
paymentRecord
.
code
!==
200
)
{
let
message
=
paymentRecord
&&
paymentRecord
.
message
?
paymentRecord
.
message
:
'系统繁忙,请稍后再试'
;
return
{
code
:
400
,
message
:
message
};
...
...
apps/shopping/models/pay-api.js
View file @
6e0a56e
...
...
@@ -61,16 +61,6 @@ const sendPayConfirm = (code, payment, uid) => {
});
};
/* 选择支付,校验时间间隔,插入数据,为用户取消订单做准备<用户支付取消订单,10分钟间隔>。*/
const
savePrePayInfo
=
(
code
,
payment
,
uid
)
=>
{
return
api
.
get
(
''
,
{
method
:
'app.order.savePrePayInfo'
,
orderCode
:
code
,
payment
:
payment
,
uid
:
uid
});
};
const
sendMessage
=
(
mobile
,
template
,
codes
)
=>
{
return
api
.
get
(
''
,
{
method
:
'app.message.sendMsg'
,
...
...
@@ -87,6 +77,5 @@ module.exports = {
setOrderPayBank
,
updateOrderPayBank
,
sendPayConfirm
,
savePrePayInfo
,
sendMessage
};
...
...
apps/shopping/models/pay.js
View file @
6e0a56e
...
...
@@ -179,21 +179,6 @@ const updateOrderPayBank = (code, payment, bankCode) => {
};
/**
* 选择支付,校验时间间隔,插入数据
* @param code
* @param payment
* @param uid
*/
const
savePrePayInfo
=
(
code
,
payment
,
uid
)
=>
{
return
co
(
function
*
()
{
let
data
=
yield
api
.
savePrePayInfo
(
code
,
payment
,
uid
);
return
data
;
})();
};
/**
* 支付确认
* @param code
* @param payment
...
...
@@ -271,7 +256,6 @@ module.exports = {
updateOrderPayBank
,
sendPayConfirm
,
procOrderData
,
savePrePayInfo
,
payments
};
...
...
Please
register
or
login
to post a comment