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
1f243d91
Commit
1f243d91
authored
Jul 29, 2020
by
孙亚楠
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'bpo-web' of gitlab.gongsibao.com:jiangyong/zhichan into bpo-web
parents
74aab6d0
92b525d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
2 deletions
+66
-2
bpo-web/app/base/api/impl/bpoSDPJApi.js
+66
-2
No files found.
bpo-web/app/base/api/impl/bpoSDPJApi.js
View file @
1f243d91
...
@@ -65,8 +65,13 @@ class BpoSDPJApi {
...
@@ -65,8 +65,13 @@ class BpoSDPJApi {
return
this
.
getBaseResult
(
1002001
,
"mchtId不存在"
);
return
this
.
getBaseResult
(
1002001
,
"mchtId不存在"
);
}
}
if
(
!
obj
.
outTradeNo
)
{
if
(
!
obj
.
outTradeNo
)
{
return
this
.
getBaseResult
(
1002001
,
"
outTradeNo
不存在"
);
return
this
.
getBaseResult
(
1002001
,
"
商户订单号[outTradeNo]
不存在"
);
}
}
let
otnLen
=
this
.
trim
(
obj
.
outTradeNo
).
length
;
if
(
otnLen
<
10
||
otnLen
>
32
)
{
return
this
.
getBaseResult
(
1002001
,
"商户订单号[outTradeNo]长度10-32"
);
}
if
(
!
obj
.
amt
)
{
if
(
!
obj
.
amt
)
{
return
this
.
getBaseResult
(
1002001
,
"请设置申请金额"
);
return
this
.
getBaseResult
(
1002001
,
"请设置申请金额"
);
}
}
...
@@ -416,7 +421,7 @@ class BpoSDPJApi {
...
@@ -416,7 +421,7 @@ class BpoSDPJApi {
"mchtId"
:
cashInfo
.
mchtId
,
"mchtId"
:
cashInfo
.
mchtId
,
"nonceStr"
:
nonceStr
,
"nonceStr"
:
nonceStr
,
"notityUrl"
:
"https://bpohhr.gongsibao.com/api/econtractApi/transferNotify"
,
"notityUrl"
:
"https://bpohhr.gongsibao.com/api/econtractApi/transferNotify"
,
"outTradeNo"
:
cashInfo
.
outTradeNo
+
"abcd1234a2"
,
"outTradeNo"
:
cashInfo
.
outTradeNo
,
"signType"
:
"MD5"
,
"signType"
:
"MD5"
,
"tradeTime"
:
tradeTime
,
"tradeTime"
:
tradeTime
,
"bizContent"
:
bizContent
,
"bizContent"
:
bizContent
,
...
@@ -482,6 +487,65 @@ class BpoSDPJApi {
...
@@ -482,6 +487,65 @@ class BpoSDPJApi {
return
uuid
.
join
(
''
);
return
uuid
.
join
(
''
);
}
}
async
wxnotify
(
obj
,
req
)
{
console
.
log
(
"------------- wx-sdpj转账回调 --------------"
,
obj
);
try
{
// 1. 获取转账二维码信息
let
cashInfo
=
await
this
.
ccashinfoSve
.
findOne
({
app_id
:
obj
.
appId
,
mchtId
:
obj
.
busiId
,
outTradeNo
:
obj
.
outTradeNo
,
});
if
(
!
cashInfo
)
{
console
.
log
(
"------------- wx-sdpj转账回调 cashInfo不存在--------------"
);
return
{
code
:
""
};
}
if
(
cashInfo
.
trade_status
==
"00"
)
{
return
{
code
:
"0000"
};
}
console
.
log
(
"------------- wx-sdpj转账回调 cashInfo --------------"
,
cashInfo
);
// 获取商户api信息
let
api
=
await
this
.
ecompanybusiSve
.
findOne
({
appId
:
cashInfo
.
app_id
,
etemplate_id
:
cashInfo
.
ecid
,
mchtId
:
cashInfo
.
mchtId
,
});
console
.
log
(
"------------- wx-sdpj转账回调 api --------------"
,
api
);
if
(
!
api
)
{
console
.
log
(
"------------- wx-sdpj转账回调 api不存在--------------"
);
return
{
code
:
""
};
}
// 验证签名
let
sign
=
system
.
getSign
(
obj
,
api
.
key
,
this
.
EXCEPT_KEYS
);
console
.
log
(
"------------- wx-sdpj转账回调 签名 --------------"
,
obj
.
sign
,
sign
);
if
(
sign
!=
obj
.
sign
)
{
console
.
log
(
"------------- wx-sdpj转账回调 签名错误 --------------"
);
return
{
code
:
""
};
}
// 回调逻辑判断
let
respCode
=
this
.
trim
(
obj
.
respCode
);
if
(
respCode
==
"00"
)
{
cashInfo
.
trade_status
=
"00"
;
cashInfo
.
trade_desc
=
"交易成功"
;
await
cashInfo
.
save
();
return
{
code
:
"0000"
};
}
else
if
(
respCode
==
"02"
)
{
cashInfo
.
trade_status
=
"02"
;
cashInfo
.
trade_desc
=
obj
.
respDesc
||
"交易失败"
;
}
else
{
}
return
{
code
:
""
};
}
catch
(
e
)
{
console
.
log
(
e
);
}
}
getSuccessResult
(
msg
=
"success"
,
data
=
{})
{
getSuccessResult
(
msg
=
"success"
,
data
=
{})
{
return
this
.
getBaseResult
(
0
,
msg
,
data
);
return
this
.
getBaseResult
(
0
,
msg
,
data
);
}
}
...
...
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