Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
yyq
5 years ago
Commit
e377c5ed53974bbce3148053839c17082325de90
1 parent
c547720d
去除支付宝返回结果签名校验,由接口回调判断支付结果
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
36 deletions
apps/cart/controllers/pay.js
apps/cart/helpers/pay/alipay.js
apps/cart/models/pay.js
apps/cart/controllers/pay.js
View file @
e377c5e
...
...
@@ -297,7 +297,6 @@ const payAli = (req, res, next) => {
req
.
ctx
(
payModel
).
getPayAli
(
param
).
then
(
result
=>
{
if
(
result
.
match
===
true
)
{
// 支付成功,发送支付确认接口
req
.
ctx
(
payModel
).
sendPayConfirm
(
param
.
orderCode
,
payProcess
.
PAYMENTS
.
ALIPAY
,
param
.
uid
);
...
...
apps/cart/helpers/pay/alipay.js
View file @
e377c5e
...
...
@@ -36,7 +36,6 @@ class PaySign extends global.yoho.BaseModel {
data
:
options
}).
then
(
result
=>
{
if
(
result
.
code
===
200
)
{
console
.
log
(
result
);
return
{
code
:
200
,
data
:
{
...
...
@@ -83,28 +82,28 @@ const Alipay = {
pay
(
ctx
,
order
,
param
,
protocol
)
{
return
new
PaySign
(
ctx
).
getPayData
(
order
,
param
,
protocol
);
},
notify
(
data
,
param
)
{
let
payParams
=
JSON
.
parse
(
param
.
payParams
);
notify
(
data
,
param
)
{
// eslint-disable-line
// let payParams = JSON.parse(param.payParams);
logger
.
info
(
`
Alipay
notify
,
params
=
$
{
JSON
.
stringify
(
data
)}
`
);
if
(
!
this
.
checkNotify
(
data
,
payParams
))
{
return
{
payResult
:
-
1
};
}
else
{
let
orderCode
=
parseInt
(
data
.
out_trade_no
,
10
);
return
{
bankName
:
''
,
orderCode
:
orderCode
,
payResult
:
data
.
trade_status
===
'TRADE_SUCCESS'
?
200
:
400
,
payTime
:
data
.
gmt_payment
||
''
,
totalFee
:
data
.
total_fee
,
resultMsg
:
data
.
notify_type
,
payOrderCode
:
orderCode
,
tradeNo
:
data
.
trade_no
,
bankBillNo
:
''
};
}
// if (!this.checkNotify(data, payParams)) {
// return { payResult: -1 };
// }
let
orderCode
=
parseInt
(
data
.
out_trade_no
,
10
);
return
{
bankName
:
''
,
orderCode
:
orderCode
,
payResult
:
data
.
trade_status
===
'TRADE_SUCCESS'
?
200
:
400
,
payTime
:
data
.
gmt_payment
||
''
,
totalFee
:
data
.
total_fee
,
resultMsg
:
data
.
notify_type
,
payOrderCode
:
orderCode
,
tradeNo
:
data
.
trade_no
,
bankBillNo
:
''
};
},
checkNotify
(
data
,
payParams
)
{
...
...
apps/cart/models/pay.js
View file @
e377c5e
...
...
@@ -379,21 +379,22 @@ class payModel extends global.yoho.BaseModel {
delete
params
.
q
;
}
if
(
!
this
.
_checkResponse
(
params
))
{
checkResult
.
payResult
=
false
;
}
else
{
_
.
assign
(
checkResult
,
{
bankName
:
''
,
orderCode
:
params
.
out_trade_no
,
payResult
:
params
.
trade_status
===
'TRADE_SUCCESS'
,
payTime
:
params
.
gmt_payment
||
''
,
totalFee
:
params
.
total_fee
,
resultMsg
:
params
.
notify_type
,
payOrderCode
:
params
.
out_trade_no
,
tradeNo
:
params
.
trade_no
,
bankBillNo
:
''
});
}
// if (!this._checkResponse(params)) {
// checkResult.payResult = false;
// } else {
_
.
assign
(
checkResult
,
{
bankName
:
''
,
orderCode
:
params
.
out_trade_no
,
payResult
:
params
.
trade_status
===
'TRADE_SUCCESS'
,
payTime
:
params
.
gmt_payment
||
''
,
totalFee
:
params
.
total_fee
,
resultMsg
:
params
.
notify_type
,
payOrderCode
:
params
.
out_trade_no
,
tradeNo
:
params
.
trade_no
,
bankBillNo
:
''
});
// }
return
checkResult
;
}
...
...
Please
register
or
login
to post a comment