awesome-wechat-sdk
Advanced tools
Comparing version 2.5.2 to 2.5.3
@@ -177,17 +177,3 @@ "use strict"; | ||
}; | ||
const stringPaySignTemp = Object.keys(params).sort().map(k => [k, params[k]].join('=')).join('&'); | ||
debug('stringPaySignTemp: %s', stringPaySignTemp); | ||
let hash; | ||
if (signType === 'MD5') { | ||
hash = crypto.createHash('md5'); | ||
} | ||
else if (signType === 'HMAC-SHA256') { | ||
hash = crypto.createHmac('sha256', await this.getKey()); | ||
} | ||
else { | ||
throw new Error('unsupported signType, only support MD5 or HMAC-SHA256'); | ||
} | ||
hash.update(stringPaySignTemp); | ||
const paySign = hash.digest('hex').toUpperCase(); | ||
debug('paySign: %s', paySign); | ||
const sign = await this.getSign(params, signType); | ||
return { | ||
@@ -198,3 +184,3 @@ timestamp: timeStamp, | ||
signType, | ||
paySign | ||
paySign: sign | ||
}; | ||
@@ -201,0 +187,0 @@ } |
{ | ||
"name": "awesome-wechat-sdk", | ||
"version": "2.5.2", | ||
"version": "2.5.3", | ||
"description": "an awesome sdk for wechat oauth, api and message middleware", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -289,15 +289,3 @@ import * as crypto from 'crypto'; | ||
}; | ||
const stringPaySignTemp = Object.keys(params).sort().map(k => [k, params[k]].join('=')).join('&'); | ||
debug('stringPaySignTemp: %s', stringPaySignTemp); | ||
let hash; | ||
if (signType === 'MD5') { | ||
hash = crypto.createHash('md5'); | ||
} else if (signType === 'HMAC-SHA256') { | ||
hash = crypto.createHmac('sha256', await this.getKey()); | ||
} else { | ||
throw new Error('unsupported signType, only support MD5 or HMAC-SHA256'); | ||
} | ||
hash.update(stringPaySignTemp); | ||
const paySign = hash.digest('hex').toUpperCase(); | ||
debug('paySign: %s', paySign); | ||
const sign = await this.getSign(params, signType); | ||
return { | ||
@@ -308,3 +296,3 @@ timestamp: timeStamp, | ||
signType, | ||
paySign | ||
paySign: sign | ||
}; | ||
@@ -311,0 +299,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
307843
4539