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
e932d231
Commit
e932d231
authored
Jun 22, 2020
by
linboxuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ucommune orderConfirm api
parent
7e7353f1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
42 deletions
+48
-42
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
+1
-0
center-channel/app/base/service/impl/utilsSve/utilsUcommuneSve.js
+23
-21
center-channel/app/config/routes/api.js
+17
-6
center-channel/package-lock.json
+7
-15
No files found.
center-channel/app/base/service/impl/utilsSve/utilsOrderSve.js
View file @
e932d231
...
...
@@ -477,6 +477,7 @@ class UtilsOrderService extends AppServiceBase {
if
(
parmas
.
trade_status
!=
"TRADE_FINISHED"
&&
parmas
.
trade_status
!=
"TRADE_SUCCESS"
)
{
return
system
.
getResult
(
null
,
"trade_status状态有误,100473"
);
}
// 2020 0621验签操作
var
url
=
this
.
centerAppUrl
+
"payment/aliPayment/verifyAliPayReturnSign"
;
var
opResult
=
await
this
.
restPostUrl
(
parmas
,
url
);
if
(
opResult
.
status
!=
0
)
{
...
...
center-channel/app/base/service/impl/utilsSve/utilsUcommuneSve.js
View file @
e932d231
...
...
@@ -78,8 +78,8 @@ class UtilsUcommuneService extends AppServiceBase {
*/
async
orderConfirm
(
pobj
,
actionBody
)
{
await
this
.
orderConfirmValidate
(
pobj
,
actionBody
);
pobj
.
actionType
=
"get
OrderDetails
"
// 获取订单详细信息 用来拼接字符串 totalsum为总金额,返回给前端
var
reqUrl
=
this
.
centerOrderUrl
+
"action/order/springBoard"
;
pobj
.
actionType
=
"get
PayOrderInfo
"
// 获取订单详细信息 用来拼接字符串 totalsum为总金额,返回给前端
var
reqUrl
=
settings
.
centerOrderUrl
()
+
"action/order/springBoard"
;
var
orderResult
=
await
this
.
restPostUrl
(
pobj
,
reqUrl
);
if
(
orderResult
.
status
!=
0
)
{
return
system
.
getResult
(
null
,
"Failed to get orderResult 100470"
);
...
...
@@ -89,10 +89,11 @@ class UtilsUcommuneService extends AppServiceBase {
let
params
=
{
"partner"
:
"2019022163300183"
,
"seller_id"
:
"353494220@qq.com"
,
"out_trade_no"
:
orderResult
.
data
.
channelOrderNo
,
"subject"
:
orderResult
.
data
.
channelItemName
,
"body"
:
orderResult
.
data
.
channelItemName
,
"total_fee"
:
orderResult
.
data
.
payTotalSum
,
// "out_trade_no" : orderResult.data.channelOrderNo ,
"out_trade_no"
:
orderResult
.
data
.
receiptVoucher
.
sourceOrderNo
+
"-"
+
pobj
.
appInfo
.
uapp_id
.
toString
()
+
"-"
+
orderResult
.
data
.
orderProduct
.
id
.
toString
(),
"subject"
:
orderResult
.
data
.
orderProduct
.
channelItemName
,
"body"
:
orderResult
.
data
.
orderProduct
.
channelItemName
,
"total_fee"
:
Number
(
orderResult
.
data
.
receiptVoucher
.
totalSum
)
,
"service"
:
"alipay.trade.app.pay"
,
"payment_type"
:
"1"
,
"_input_charset"
:
"utf-8"
,
...
...
@@ -172,22 +173,23 @@ class UtilsUcommuneService extends AppServiceBase {
// console.log(alipayResponse);
}
if
(
actionBody
.
payWay
==
3
)
{
// 微信
let
sign
=
await
PayUtil
.
getSign
(
null
,
"3"
)
let
sign
=
await
PayUtil
.
getSign
(
'wx6f3ebe44defe336a'
,
"3"
)
let
params
=
{
"partner"
:
"2019022163300183"
,
"seller_id"
:
"353494220@qq.com"
,
"out_trade_no"
:
orderResult
.
data
.
channelOrderNo
,
"subject"
:
orderResult
.
data
.
channelItemName
,
"body"
:
orderResult
.
data
.
channelItemName
,
"total_fee"
:
orderResult
.
data
.
payTotalSum
,
"service"
:
"alipay.trade.app.pay"
,
"payment_type"
:
"1"
,
"_input_charset"
:
"utf-8"
,
"it_b_pay"
:
"10m"
,
"notify_url"
:
this
.
centerChannelUrl
+
"orderNotify/aliPayNotify"
,
"enable_paymethod"
:
"balance,moneyFund,coupon,pcredit,pcreditpayInstallment,creditCard,creditCardExpress,creditCardCartoon,credit_group,debitCardExpress,mcard,pcard,promotion"
,
"sign"
:
sign
,
"sign_type"
:
"RSA2"
,
// "partner" : "2019022163300183" ,
// "seller_id" : "353494220@qq.com" ,
// "out_trade_no" : orderResult.data.channelOrderNo ,
// "subject" : orderResult.data.channelItemName ,
// "body" : orderResult.data.channelItemName ,
// "total_fee" : orderResult.data.payTotalSum ,
// "service" : "alipay.trade.app.pay" ,
// "payment_type" : "1" ,
// "_input_charset" : "utf-8" ,
// "it_b_pay" : "10m" ,
// "notify_url" : this.centerChannelUrl + "orderNotify/aliPayNotify" ,
// "enable_paymethod" : "balance,moneyFund,coupon,pcredit,pcreditpayInstallment,creditCard,creditCardExpress,creditCardCartoon,credit_group,debitCardExpress,mcard,pcard,promotion" ,
// "sign" : sign ,
// "sign_type" : "RSA2",
}
let
str
=
""
;
for
(
var
k
in
params
)
{
...
...
center-channel/app/config/routes/api.js
View file @
e932d231
...
...
@@ -419,15 +419,26 @@ module.exports = function (app) {
// 支付回调通知
app
.
post
(
'/orderNotify/aliPayNotify'
,
async
function
(
req
,
res
)
{
try
{
var
client_ip
=
system
.
get_client_ip
(
req
);
var
result
=
await
utilsOrderSve
.
aliPay
Notify
(
req
.
body
);
var
result
=
await
utilsOrderSve
.
opH5AliDingPayBack
Notify
(
req
.
body
);
logCtl
.
info
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"aliPayNotify记录回调处理结果,method=notify
"
,
op
:
"app/config/routes/api.js/orderNotif
y/aliPayNotify"
,
content
:
"回调参数:"
+
JSON
.
stringify
(
req
.
body
)
+
"回调
结果:"
+
JSON
.
stringify
(
result
),
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"记录阿里钉钉支付回调处理结果
"
,
op
:
"center-channel/tlpa
y/aliPayNotify"
,
content
:
"支付回调处理
结果:"
+
JSON
.
stringify
(
result
),
clientIp
:
client_ip
||
""
});
var
returnObj
=
JSON
.
stringify
(
result
);
return
res
.
end
(
returnObj
);
if
(
result
.
status
!=
0
)
{
return
res
.
end
(
"FAIL"
);
}
return
res
.
end
(
"success"
);
}
catch
{
logCtl
.
error
({
optitle
:
(
new
Date
()).
Format
(
"yyyy-MM-dd hh:mm:ss"
)
+
"阿里钉钉支付回调处理异常"
,
op
:
"center-channel/tlpay/aliPayNotify"
,
content
:
"回调参数:req="
+
JSON
.
stringify
(
req
)
+
"error:"
+
error
.
stack
,
clientIp
:
client_ip
||
""
});
}
});
};
center-channel/package-lock.json
View file @
e932d231
...
...
@@ -7925,14 +7925,6 @@
"resolved"
:
"https://registry.npmjs.org/validator/-/validator-9.4.1.tgz"
,
"integrity"
:
"sha512-YV5KjzvRmSyJ1ee/Dm5UED0G+1L4GZnLN3w6/T+zZm8scVua4sOhYKWTUrKa0H/tMiJyO9QLHMPN+9mB/aMunA=="
},
"var"
:
{
"version"
:
"0.4.0"
,
"resolved"
:
"https://registry.npmjs.org/var/-/var-0.4.0.tgz"
,
"integrity"
:
"sha512-olxlLAssnt9UPL5UAErYTaCJhpwaDfkuSxOEB5eUclEJbl4xi7EhOIaOh6Y8KTQHIKUnyd2DygRLSnTaXtXuGg=="
,
"requires"
:
{
"lodash"
:
"^4.17.4"
}
},
"vary"
:
{
"version"
:
"1.1.2"
,
"resolved"
:
"https://registry.npmjs.org/vary/-/vary-1.1.2.tgz"
,
...
...
@@ -8142,18 +8134,18 @@
}
},
"xml2js"
:
{
"version"
:
"0.4.
23
"
,
"resolved"
:
"https://registry.npmjs.org/xml2js/-/xml2js-0.4.
23
.tgz"
,
"integrity"
:
"sha512-
ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug
=="
,
"version"
:
"0.4.
19
"
,
"resolved"
:
"https://registry.npmjs.org/xml2js/-/xml2js-0.4.
19
.tgz"
,
"integrity"
:
"sha512-
esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q
=="
,
"requires"
:
{
"sax"
:
">=0.6.0"
,
"xmlbuilder"
:
"~
11.0.0
"
"xmlbuilder"
:
"~
9.0.1
"
}
},
"xmlbuilder"
:
{
"version"
:
"
11.0.1
"
,
"resolved"
:
"https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-
11.0.1
.tgz"
,
"integrity"
:
"sha
512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA=
="
"version"
:
"
9.0.7
"
,
"resolved"
:
"https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-
9.0.7
.tgz"
,
"integrity"
:
"sha
1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0
="
},
"xmlhttprequest-ssl"
:
{
"version"
:
"1.5.5"
,
...
...
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