@jayfong/x-server 2.1.7 → 2.2.0
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.
- package/lib/_cjs/services/pay.js +3 -2
- package/lib/services/pay.d.ts +2 -0
- package/lib/services/pay.js +3 -2
- package/package.json +1 -1
package/lib/_cjs/services/pay.js
CHANGED
|
@@ -56,8 +56,9 @@ class PayService {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
async prepareWepay(options) {
|
|
59
|
+
const appId = options.appId || this.options.wepay.appId;
|
|
59
60
|
const res = await this.wepayRequest('https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi', {
|
|
60
|
-
appid:
|
|
61
|
+
appid: appId,
|
|
61
62
|
mchid: this.options.wepay.merchantId,
|
|
62
63
|
description: options.goodsName,
|
|
63
64
|
out_trade_no: options.tradeNumber,
|
|
@@ -78,7 +79,7 @@ class PayService {
|
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
const params = {
|
|
81
|
-
appId:
|
|
82
|
+
appId: appId,
|
|
82
83
|
timestamp: String(Math.round(Date.now() / 1000)),
|
|
83
84
|
nonceStr: Math.random().toString().substr(2, 12),
|
|
84
85
|
package: `prepay_id=${res.prepay_id}`,
|
package/lib/services/pay.d.ts
CHANGED
package/lib/services/pay.js
CHANGED
|
@@ -44,8 +44,9 @@ export class PayService {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
async prepareWepay(options) {
|
|
47
|
+
const appId = options.appId || this.options.wepay.appId;
|
|
47
48
|
const res = await this.wepayRequest('https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi', {
|
|
48
|
-
appid:
|
|
49
|
+
appid: appId,
|
|
49
50
|
mchid: this.options.wepay.merchantId,
|
|
50
51
|
description: options.goodsName,
|
|
51
52
|
out_trade_no: options.tradeNumber,
|
|
@@ -66,7 +67,7 @@ export class PayService {
|
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
const params = {
|
|
69
|
-
appId:
|
|
70
|
+
appId: appId,
|
|
70
71
|
timestamp: String(Math.round(Date.now() / 1000)),
|
|
71
72
|
nonceStr: Math.random().toString().substr(2, 12),
|
|
72
73
|
package: `prepay_id=${res.prepay_id}`,
|