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
10293756
Commit
10293756
authored
Apr 10, 2020
by
宋毅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tj
parent
79c72d9b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
34 deletions
+36
-34
center-app/app/base/api/impl/payment/aliPayment.js
+28
-27
center-app/app/base/service/impl/utilsSve/utilsAlibankSve.js
+8
-7
No files found.
center-app/app/base/api/impl/payment/aliPayment.js
View file @
10293756
...
@@ -16,34 +16,34 @@ class AliPayment extends APIBase {
...
@@ -16,34 +16,34 @@ class AliPayment extends APIBase {
}
}
async
test
(
pobj
,
qobj
,
req
)
{
async
test
(
pobj
,
qobj
,
req
)
{
// var pobj = { appInfo: { uapp_id: 22 }, actionBody: { total_fee: 0.01, order_num: "111222", body_desc: "标题描述1" } };
// var pobj = { appInfo: { uapp_id: 22 }, actionBody: { total_fee: 0.01, order_num: "111222", body_desc: "标题描述1" } };
//
var actionBody = {
var
actionBody
=
{
//
"discount": "0.00",
"discount"
:
"0.00"
,
//
"payment_type": "1",
"payment_type"
:
"1"
,
// "trade_no": "2020040922001436491431713713
",
"trade_no"
:
"2020041022001436491432094684
"
,
// "subject": "888
",
"subject"
:
"商标辅助注册
"
,
//
"buyer_email": "306***@qq.com",
"buyer_email"
:
"306***@qq.com"
,
// "gmt_create": "2020-04-09 19:57:49
",
"gmt_create"
:
"2020-04-10 15:13:36
"
,
//
"notify_type": "trade_status_sync",
"notify_type"
:
"trade_status_sync"
,
//
"quantity": "1",
"quantity"
:
"1"
,
// "out_trade_no": "OT36202004091957Ac7M
",
"out_trade_no"
:
"OT36202004101513TFB6-36-328
"
,
//
"seller_id": "2088001575712426",
"seller_id"
:
"2088001575712426"
,
// "notify_time": "2020-04-09 19:57:50
",
"notify_time"
:
"2020-04-10 15:13:36
"
,
// "body": "888
",
"body"
:
"商标辅助注册
"
,
//
"trade_status": "TRADE_SUCCESS",
"trade_status"
:
"TRADE_SUCCESS"
,
//
"is_total_fee_adjust": "N",
"is_total_fee_adjust"
:
"N"
,
//
"total_fee": "0.01",
"total_fee"
:
"0.01"
,
// "gmt_payment": "2020-04-09 19:57:49
",
"gmt_payment"
:
"2020-04-10 15:13:36
"
,
//
"seller_email": "2022815690@qq.com",
"seller_email"
:
"2022815690@qq.com"
,
//
"price": "0.01",
"price"
:
"0.01"
,
//
"buyer_id": "2088302381536494",
"buyer_id"
:
"2088302381536494"
,
// "notify_id": "202004090022219574903649145597955
4",
"notify_id"
:
"202004100022215133603649145609128
4"
,
//
"use_coupon": "N",
"use_coupon"
:
"N"
,
//
"sign_type": "RSA",
"sign_type"
:
"RSA"
,
// "sign": "fa3cGcw+Y5VoIruvWtwN3/XPScPbaeXJI9v+p3I82z3Im0PloxZ/wVallZPJnFGqSIbhp6L3Czajbrz2dzdDPiWCpatH7j7CCTYaIxPXBKAcYuBINfQN3UqHLY2Nq1LS1jfCKwMeufGOUqW1+2yDbQB8TFAAApbvHf63l2Cfgc4
="
"sign"
:
"jXVMSUx9S7hr5LIUTDICW3B9aWiSZuP+xl7tOm+0USJHPQWMZHKgK3YM8fNY1vLHd6Vo0fK4eIaiVMruwVG91GcyE0lGZqkYXstuusa8J1PQxUyAsD/0CXjLFrYBa5GuwfiCOt0iP0SjjZ4TB6NzHxxdgTAg0MESlcjcnSnLda8
="
// };
}
//
var result = await this.utilsAlibankSve.verifyAliPayReturnSign(pobj, actionBody);
var
result
=
await
this
.
utilsAlibankSve
.
verifyAliPayReturnSign
(
pobj
,
actionBody
);
// // var result = await this.utilsAlibankSve.getH5AliDingPayInfo(pobj, pobj.actionBody);
// // var result = await this.utilsAlibankSve.getH5AliDingPayInfo(pobj, pobj.actionBody);
//
return result;
return
result
;
}
}
}
}
module
.
exports
=
AliPayment
;
module
.
exports
=
AliPayment
;
\ No newline at end of file
center-app/app/base/service/impl/utilsSve/utilsAlibankSve.js
View file @
10293756
...
@@ -97,6 +97,7 @@ class utilsTlBankSve extends AppServiceBase {
...
@@ -97,6 +97,7 @@ class utilsTlBankSve extends AppServiceBase {
if
(
outTradeInfo
.
length
<
2
)
{
if
(
outTradeInfo
.
length
<
2
)
{
return
{
status
:
-
307
,
msg
:
"out_trade_no into is error"
};
return
{
status
:
-
307
,
msg
:
"out_trade_no into is error"
};
}
}
pobj
.
appInfo
=
{
uapp_id
:
outTradeInfo
[
1
]
};
var
getSignStrResult
=
await
this
.
getSortSignStr
(
actionBody
);
var
getSignStrResult
=
await
this
.
getSortSignStr
(
actionBody
);
if
(
getSignStrResult
.
status
!=
0
)
{
if
(
getSignStrResult
.
status
!=
0
)
{
return
getSignStrResult
;
return
getSignStrResult
;
...
@@ -123,13 +124,13 @@ class utilsTlBankSve extends AppServiceBase {
...
@@ -123,13 +124,13 @@ class utilsTlBankSve extends AppServiceBase {
key
.
importKey
(
publicKey
,
'pkcs8-public-pem'
);
//导入密钥并设定格式
key
.
importKey
(
publicKey
,
'pkcs8-public-pem'
);
//导入密钥并设定格式
// const publicDer = key.exportKey('pkcs8-private');
// const publicDer = key.exportKey('pkcs8-private');
let
signature
=
key
.
verify
(
Buffer
.
from
(
signParamStr
),
verifySignStr
,
sourceEncoding
,
signatureEncoding
);
let
signature
=
key
.
verify
(
Buffer
.
from
(
signParamStr
),
verifySignStr
,
sourceEncoding
,
signatureEncoding
);
this
.
logCtl
.
info
({
//
this.logCtl.info({
appid
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_id
:
""
,
//
appid: pobj.appInfo ? pobj.appInfo.uapp_id : "",
appkey
:
pobj
.
appInfo
?
pobj
.
appInfo
.
uapp_key
:
""
,
//
appkey: pobj.appInfo ? pobj.appInfo.uapp_key : "",
op
:
"center-app/app/base/service/impl/utilsSve/utilsAlibankSve.js/getCreateAliSignStr"
,
//
op: "center-app/app/base/service/impl/utilsSve/utilsAlibankSve.js/getCreateAliSignStr",
content
:
"参数:"
+
paramStr
+
"返回结果signStr:"
+
signature
,
//
content: "参数:" + paramStr + "返回结果signStr:" + signature,
optitle
:
"获取钉钉支付签名信息返回"
,
//
optitle: "获取钉钉支付签名信息返回",
});
//
});
return
signature
;
return
signature
;
}
}
...
...
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