q-koa 10.4.0 → 10.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1077,7 +1077,9 @@ exports.notify = async (ctx) => {
|
|
|
1077
1077
|
}
|
|
1078
1078
|
const model = prefix ? `${prefix}_order` : 'order'
|
|
1079
1079
|
let transactionid = ''
|
|
1080
|
+
let openid = ''
|
|
1080
1081
|
try {
|
|
1082
|
+
openid = result.xml.openid
|
|
1081
1083
|
transactionid = result.xml.transaction_id
|
|
1082
1084
|
} catch (e) {}
|
|
1083
1085
|
|
|
@@ -1090,6 +1092,7 @@ exports.notify = async (ctx) => {
|
|
|
1090
1092
|
order_price,
|
|
1091
1093
|
transactionid,
|
|
1092
1094
|
out_trade_no: result.xml.out_trade_no,
|
|
1095
|
+
openid,
|
|
1093
1096
|
})
|
|
1094
1097
|
}
|
|
1095
1098
|
|
|
@@ -451,10 +451,13 @@ exports.pc_pay = async ({
|
|
|
451
451
|
config = 'weixin_mp',
|
|
452
452
|
pay_config = 'weixin_pay',
|
|
453
453
|
out_trade_no: _out_trade_no,
|
|
454
|
-
is_admin,
|
|
454
|
+
is_admin = false,
|
|
455
455
|
type = 'PC-WEIXIN',
|
|
456
|
-
prefix,
|
|
456
|
+
prefix = '',
|
|
457
457
|
}) => {
|
|
458
|
+
if (!order_id) throw new Error('缺order_id')
|
|
459
|
+
if (!price) throw new Error('缺price')
|
|
460
|
+
if (!name) throw new Error('缺name')
|
|
458
461
|
const { app, appName } = getAppByCtx(ctx)
|
|
459
462
|
const appConfig = getConfig(app)
|
|
460
463
|
const app_id = (await appConfig.getObject(config)).app_id
|