|
|
@@ -134,17 +134,19 @@ export class WeixinService {
|
|
|
this.privateKey,
|
|
|
JSON.stringify(data)
|
|
|
)
|
|
|
+ const nonceStr = /nonce_str="(\S+?)"/.exec(result.config.headers['Authorization'])[1]
|
|
|
+ console.log(nonceStr)
|
|
|
Logger.log(JSON.stringify(result.data, null, 2), 'weixin')
|
|
|
if (result.status === 200) {
|
|
|
const timeStamp = parseInt((new Date().getTime() / 1000).toString()).toString()
|
|
|
- const nonceStr = Kits.generateStr()
|
|
|
+ // const nonceStr = Kits.generateStr()
|
|
|
const packageStr = `prepay_id=${result.data.prepay_id}`
|
|
|
const signType = 'RSA'
|
|
|
const signStr =
|
|
|
[this.weixinConfiguration.appId, timeStamp, nonceStr, packageStr].join(String.fromCharCode(10)) +
|
|
|
String.fromCharCode(10)
|
|
|
const paySign = Kits.sha256WithRsa(signStr, this.privateKey)
|
|
|
- console.log(signStr.replace(/\n/g, '\\n'))
|
|
|
+ console.log(signStr)
|
|
|
console.log(paySign)
|
|
|
return {
|
|
|
appId: this.weixinConfiguration.appId,
|